diff options
author | Bob Gilligan <gilligan@vyatta.com> | 2011-10-19 16:55:07 -0700 |
---|---|---|
committer | Bob Gilligan <gilligan@vyatta.com> | 2011-10-19 16:55:07 -0700 |
commit | c451cfab924e25a1f75e90fb38b9343a29e74075 (patch) | |
tree | 4c804f2f61966371d0e9bc6f60d97ac571ba09c7 | |
parent | 35569f85d29c167ccfe1170121dd30a6b8f3a1f8 (diff) | |
download | vyatta-op-c451cfab924e25a1f75e90fb38b9343a29e74075.tar.gz vyatta-op-c451cfab924e25a1f75e90fb38b9343a29e74075.zip |
Bugfix 7502: Correctly display image names on Xen.
-rwxr-xr-x | scripts/vyatta-boot-image.pl | 10 |
1 files changed, 9 insertions, 1 deletions
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 (/^}/) { |