]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/paks/linux-pae/install.sh
initrd: add early microcode load
[ipfire-2.x.git] / src / paks / linux-pae / install.sh
index c980a0136bfd81732965bfda823522846531895d..fd71621d5752430293127c70c2a280a0dbcf2053 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,34 +60,28 @@ 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  
 
-
-ROOT="$(find_partition "/")"
-case $ROOT in
-       xvd* )
-               #
-               # We are on XEN so create new grub.conf / menu.lst for pygrub
-               #
-               echo "timeout 10"                          > /boot/grub/grub.conf
-               echo "default 0"                          >> /boot/grub/grub.conf
-               echo "title IPFire (pae-kernel)"          >> /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
-               echo "# savedefault 0"                    >> /boot/grub/grub.conf
-               ln -s grub.conf $MNThdd/boot/grub/menu.lst
-               ;;
-       * )
-               #
-               # Update grub2 config
-               #
-               grub-mkconfig > /boot/grub/grub.cfg
-               ;;
-esac
-
-# request a reboot if pae is supported
-if [ ! "$(grep "^flags.* pae " /proc/cpuinfo)" == "" ]; then
-       touch /var/run/need_reboot
+if [ -e /boot/grub/grub.cfg ]; then
+       #
+       # Update grub2 config
+       #
+       grub-mkconfig > /boot/grub/grub.cfg
+else
+       #
+       # 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
+       echo "# savedefault 0"                    >> /boot/grub/grub.conf
+       ln -s grub.conf $MNThdd/boot/grub/menu.lst
 fi
+
+# request a reboot
+touch /var/run/need_reboot
 sync && sync
\ No newline at end of file