From c451cfab924e25a1f75e90fb38b9343a29e74075 Mon Sep 17 00:00:00 2001 From: Bob Gilligan Date: Wed, 19 Oct 2011 16:55:07 -0700 Subject: Bugfix 7502: Correctly display image names on Xen. --- scripts/vyatta-boot-image.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/vyatta-boot-image.pl b/scripts/vyatta-boot-image.pl index 91d3f0b..448192d 100755 --- a/scripts/vyatta-boot-image.pl +++ b/scripts/vyatta-boot-image.pl @@ -36,6 +36,7 @@ my $VER_FILE = '/opt/vyatta/etc/version'; my $OLD_IMG_VER_STR = 'Old-non-image-installation'; my $OLD_GRUB_CFG = '/boot/grub/grub.cfg'; my $DISK_BOOT = '/boot'; +my $XEN_DEFAULT_IMAGE = "$UNION_BOOT/%%default_image"; # # Globals @@ -58,7 +59,14 @@ sub parseGrubCfg { my $in_entry = 0; my $idx = 0; my $running_boot_cmd=`cat /proc/cmdline`; - $running_boot_cmd =~ s/BOOT_IMAGE=//; + if (! ($running_boot_cmd =~ s/BOOT_IMAGE=//)) { + # Mis-formatted boot cmd. It might be Xen, which boots with pygrub. + # We use a symlink in this case to point to the default image. + # + if (-l $XEN_DEFAULT_IMAGE) { + $running_boot_cmd = readlink($XEN_DEFAULT_IMAGE); + } + } while (<$fd>) { if ($in_entry) { if (/^}/) { -- cgit v1.2.3