summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2010-02-08 12:02:18 -0800
committerBob Gilligan <gilligan@vyatta.com>2010-02-08 12:02:18 -0800
commit3f6bb58b0f98f8ca9dd986f8f274906c33596083 (patch)
tree7ec3c7ae4fbdf518560c49ba98d6e7e9747dc9f0
parentd1c814b29aeb7dd2b581a4ffea23bde61331bcf5 (diff)
downloadvyatta-cfg-system-3f6bb58b0f98f8ca9dd986f8f274906c33596083.tar.gz
vyatta-cfg-system-3f6bb58b0f98f8ca9dd986f8f274906c33596083.zip
Bugfix 5225: Include the OS version number in the grub menu entry.
-rwxr-xr-xscripts/install-system6
-rwxr-xr-xscripts/install/install-postinst-new2
-rwxr-xr-xscripts/vyatta-grub-setup26
3 files changed, 22 insertions, 12 deletions
diff --git a/scripts/install-system b/scripts/install-system
index d214d93d..bc2277fd 100755
--- a/scripts/install-system
+++ b/scripts/install-system
@@ -1015,11 +1015,15 @@ install_grub () {
fi
fi
+ version=$(egrep -i version /opt/vyatta/etc/version | awk '{ print $3 }')
+
# if union install tell vyatta-grub-setup
if [ ! -z $UNION ]; then
- version=$(egrep -i version /opt/vyatta/etc/version | awk '{ print $3 }')
grub_args="-u $version"
+ else
+ grub_args="-v $version"
fi
+
if /opt/vyatta/sbin/vyatta-grub-setup $grub_args "$ROOT_PARTITION" "$grub_options" /mnt/rootfs >>$INSTALL_LOG
then
echo "OK"
diff --git a/scripts/install/install-postinst-new b/scripts/install/install-postinst-new
index d2187434..e099e030 100755
--- a/scripts/install/install-postinst-new
+++ b/scripts/install/install-postinst-new
@@ -138,7 +138,7 @@ grub_root=$WRITE_ROOT
grub_setup_args="-u $version"
if [ "$INSTALL_TYPE" == 'old' ]; then
grub_root=$INST_ROOT
- grub_setup_args=''
+ grub_setup_args="-v $version"
elif [ "$INSTALL_TYPE" != 'union' ]; then
echo 'Invalid install type. Exiting...'
exit 1
diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup
index 68d12614..3a38bd5f 100755
--- a/scripts/vyatta-grub-setup
+++ b/scripts/vyatta-grub-setup
@@ -26,12 +26,18 @@
#
#
+# The OS version we are installing
+version=""
+
UNION="false"
-while getopts u: c
+while getopts u:v: c
do
case $c in
u) UNION=true;
- livedir=$OPTARG;;
+ livedir=$OPTARG;
+ version=$livedir;;
+
+ v) version=$OPTARG;;
esac
done
shift `expr $OPTIND - 1`
@@ -198,7 +204,7 @@ fi
if [ -f "$ROOTFSDIR/boot/vmlinuz" ] && ! eval $UNION ; then
# Set first system boot option. Make KVM the default console in this one.
- echo -e "menuentry \"Vyatta (KVM console)\" {"
+ echo -e "menuentry \"Vyatta $version (KVM console)\" {"
echo -e "\tlinux /boot/vmlinuz $GRUB_OPTIONS $VGA_LOGO $vty_console"
echo -e "\tinitrd /boot/initrd.img"
echo -e "}"
@@ -206,7 +212,7 @@ fi
# Set the second system boot option. Make the serial port be the default
# console in this one.
echo
- echo -e "menuentry \"Vyatta (Serial console)\" {"
+ echo -e "menuentry \"Vyatta $version (Serial console)\" {"
echo -e "\tlinux /boot/vmlinuz $GRUB_OPTIONS $serial_console"
echo -e "\tinitrd /boot/initrd.img"
echo -e "}"
@@ -216,12 +222,12 @@ fi
if [ -n "$union_kernel_versions" ]; then
for kversion in $union_kernel_versions; do
echo
- echo -e "menuentry \"Vyatta linux$kversion (KVM console)\" {"
+ echo -e "menuentry \"Vyatta $version linux$kversion (KVM console)\" {"
echo -e "\tlinux /boot/$livedir/vmlinuz$kversion $GRUB_OPTIONS $vga_logo $vty_console"
echo -e "\tinitrd /boot/$livedir/initrd.img$kversion"
echo -e "}"
echo
- echo -e "menuentry \"Vyatta linux$kversion (Serial console)\" {"
+ echo -e "menuentry \"Vyatta $version linux$kversion (Serial console)\" {"
echo -e "\tlinux /boot/$livedir/vmlinuz$kversion $GRUB_OPTIONS $serial_console"
echo -e "\tinitrd /boot/$livedir/initrd.img$kversion"
echo -e "}"
@@ -232,12 +238,12 @@ fi
if [ -n "$kernel_versions" ]; then
for kversion in $kernel_versions; do
echo
- echo -e "menuentry \"Vyatta linux$kversion (KVM console)\" {"
+ echo -e "menuentry \"Vyatta $version linux$kversion (KVM console)\" {"
echo -e "\tlinux /boot/vmlinuz$kversion $GRUB_OPTIONS $vga_logo $vty_console"
echo -e "\tinitrd /boot/initrd.img$kversion"
echo -e "}"
echo
- echo -e "menuentry \"Vyatta linux$kversion (Serial console)\" {"
+ echo -e "menuentry \"Vyatta $version linux$kversion (Serial console)\" {"
echo -e "\tlinux /boot/vmlinuz$kversion $GRUB_OPTIONS $serial_console"
echo -e "\tinitrd /boot/initrd.img$kversion"
echo -e "}"
@@ -252,13 +258,13 @@ fi
fi
echo
- echo -e "menuentry \"Lost password change (KVM console)\" {"
+ echo -e "menuentry \"Lost password change $version (KVM console)\" {"
echo -e "\tlinux $reset_boot_path/vmlinuz $GRUB_OPTIONS $vga_logo $vty_console init=$pass_reset"
echo -e "\tinitrd $reset_boot_path/initrd.img"
echo -e "}"
echo
- echo -e "menuentry \"Lost password change (Serial console)\" {"
+ echo -e "menuentry \"Lost password change $version (Serial console)\" {"
echo -e "\tlinux $reset_boot_path/vmlinuz $GRUB_OPTIONS $serial_console init=$pass_reset"
echo -e "\tinitrd $reset_boot_path/initrd.img"
echo -e "}"