diff options
-rwxr-xr-x | scripts/grub-setup | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/scripts/grub-setup b/scripts/grub-setup index 115df53d..301d386f 100755 --- a/scripts/grub-setup +++ b/scripts/grub-setup @@ -30,7 +30,7 @@ ROOT_PARTITION="$1" GRUB_OPTIONS="$2" ROOTFSDIR="$3" -[ "$GRUB_OPTIONS" -a "$ROOT_PARTITION" ] || exit 1 +[ "$ROOT_PARTITION" ] || exit 1 # Grub options GRUB_OPTIONS="$GRUB_OPTIONS quiet" @@ -54,17 +54,17 @@ serial_console="console=tty0 console=ttyS0,9600" # 65000 (16bit) | 785 788 791 794 # 16.7 Mill.(24bit)| 786 789 792 795 # -vga_logo="vga=788" - - # TODO: This needs to be changed to map to the correct drive - part=$(echo ${ROOT_PARTITION} | sed 's/[^0-9]//g') - if [ "$(cat /sys/block/$ORIG_INSTALL_DRIVE/removable)" == 0 ]; then - root=$(grep $ORIG_INSTALL_DRIVE $ROOTFSDIR/boot/grub/device.map | /usr/bin/awk -F')' '{ print $1 }') - root="$root,$part)" - else - root="(hd0,$part)" - echo "This looks like a removable device. Setting root grub device to $root." - fi +vga_logo="vga=785" + +#### # TODO: This needs to be changed to map to the correct drive +#### part=$(echo ${ROOT_PARTITION} | sed 's/[^0-9]//g') +#### if [ "$(cat /sys/block/$ORIG_INSTALL_DRIVE/removable)" == 0 ]; then +#### root=$(grep $ORIG_INSTALL_DRIVE $ROOTFSDIR/boot/grub/device.map | /usr/bin/awk -F')' '{ print $1 }') +#### root="$root,$part)" +#### else +#### root="(hd0,$part)" +#### echo "This looks like a removable device. Setting root grub device to $root." +#### fi # get list of kernels, except Xen kernel_versions=$(ls /boot/vmlinuz-* 2> /dev/null | grep -v xen | sed 's:/boot/vmlinuz::g' | sort -r) @@ -104,7 +104,7 @@ vga_logo="vga=788" # set serial console options echo -e "serial --unit=0 --speed=9600" echo "terminal serial" - echo "set root=$root" + echo "set root=$grub_root" echo "" echo "echo -n Press ESC to enter the Grub menu..." @@ -121,7 +121,8 @@ vga_logo="vga=788" if [ -f "/boot/vmlinuz" ]; then # Set first system boot option. Make KVM the default console in this one. echo -e "menuentry \"Vyatta OFR (KVM console)\" {" - echo -e "\tlinux /boot/vmlinuz $grub_root $GRUB_OPTIONS $vga_logo $vty_console" + #echo -e "\tlinux /boot/vmlinuz $grub_root $GRUB_OPTIONS $vga_logo $vty_console" + echo -e "\tlinux /boot/vmlinuz $GRUB_OPTIONS $vga_logo $vty_console" echo -e "\tinitrd /boot/initrd.img" echo -e "}" @@ -178,3 +179,8 @@ vga_logo="vga=788" echo -e "\tinitrd /boot/initrd.img" echo -e "}" ) >"$ROOTFSDIR"/boot/grub/grub.cfg + +( [ -s /boot/grub/menu.lst ] && + upgrade-from-grub-legacy && + rm -f /boot/grub/menu.lst* +) || true |