]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/paks/linux-pae/install.sh
linux-pae: fix grub.conf creation on pv machines
[people/pmueller/ipfire-2.x.git] / src / paks / linux-pae / install.sh
index 27e665f9243b1e18be7a31b5d23b6843be7957fe..fa84c801ccd48bd8d60d853956f5735bfb7f9666 100644 (file)
@@ -17,7 +17,7 @@
 # along with IPFire; if not, write to the Free Software                    #
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA #
 #                                                                          #
-# Copyright (C) 2007-2014 IPFire-Team <info@ipfire.org>.                   #
+# Copyright (C) 2007-2016 IPFire-Team <info@ipfire.org>.                   #
 #                                                                          #
 ############################################################################
 #
@@ -42,10 +42,17 @@ function find_partition() {
        return 0
 }
 
+if [ "$(grep "^flags.* pae " /proc/cpuinfo)" == "" ]; then
+       rm -f /opt/pakfire/db/installed/meta-linux-pae
+       /usr/bin/logger -p syslog.emerg -i pakfire \
+               "linux-pae: no pae support found, aborted!"
+       exit 1
+fi
+
 extract_files
 #
 KVER=xxxKVERxxx
-
+ROOT=`find_partition /`
 #
 # Create new module depency
 #
@@ -53,20 +60,23 @@ depmod -a $KVER-ipfire-pae
 #
 # Made initramdisk
 #
-/usr/bin/dracut --force --xz /boot/initramfs-$KVER-ipfire-pae.img $KVER-ipfire-pae  
+/usr/bin/dracut --force --early-microcode --xz /boot/initramfs-$KVER-ipfire-pae.img $KVER-ipfire-pae  
 
 if [ -e /boot/grub/grub.cfg ]; then
        #
        # Update grub2 config
        #
        grub-mkconfig > /boot/grub/grub.cfg
-else
+fi
+
+if [ -e /boot/grub/grub.conf ]; then
        #
        # xen pv with pygrub need grub.conf / menu.lst
        #
        echo "timeout 10"                          > /boot/grub/grub.conf
        echo "default 0"                          >> /boot/grub/grub.conf
        echo "title IPFire (pae-kernel)"          >> /boot/grub/grub.conf
+       echo "  root (hd0)"                       >> /boot/grub/grub.conf
        echo "  kernel /vmlinuz-$KVER-ipfire-pae root=/dev/$ROOT rootdelay=10 panic=10 console=hvc0" \
                                                  >> /boot/grub/grub.conf
        echo "  initrd /initramfs-$KVER-ipfire-pae.img" >> /boot/grub/grub.conf
@@ -74,8 +84,6 @@ else
        ln -s grub.conf $MNThdd/boot/grub/menu.lst
 fi
 
-# request a reboot if pae is supported
-if [ ! "$(grep "^flags.* pae " /proc/cpuinfo)" == "" ]; then
-       touch /var/run/need_reboot
-fi
+# request a reboot
+touch /var/run/need_reboot
 sync && sync
\ No newline at end of file