From a3c90c3227a51561f1da90ddce81e1afad698e33 Mon Sep 17 00:00:00 2001 From: Deepti Kulkarni Date: Thu, 12 Apr 2012 03:08:38 -0700 Subject: bug fix for 5792 - Fix the op-mode system image commands for live-cd --- scripts/show-image-storage.pl | 4 ++++ scripts/vyatta-boot-image.pl | 3 +++ 2 files changed, 7 insertions(+) diff --git a/scripts/show-image-storage.pl b/scripts/show-image-storage.pl index 80294a5..f8de35e 100644 --- a/scripts/show-image-storage.pl +++ b/scripts/show-image-storage.pl @@ -41,7 +41,11 @@ sub better_units { # Figure out where the images live... my $imagedir = "/live/image/boot"; +my $livecd = "/live/image/live"; if (! -e $imagedir) { + if (-d $livecd) { + die "System running on Live-CD\n"; + } # Must be running on Old non-image system. $imagedir = "/boot"; if (! -e $imagedir) { diff --git a/scripts/vyatta-boot-image.pl b/scripts/vyatta-boot-image.pl index 555496b..52d5198 100755 --- a/scripts/vyatta-boot-image.pl +++ b/scripts/vyatta-boot-image.pl @@ -38,6 +38,7 @@ 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"; +my $LIVE_CD = '/live/image/live'; # # Globals @@ -542,6 +543,8 @@ if (-e $UNION_GRUB_CFG) { $grub_cfg = $UNION_GRUB_CFG; } elsif (-e $OLD_GRUB_CFG) { $grub_cfg = $OLD_GRUB_CFG; +} elsif ((! -d $UNION_BOOT) && (-d $LIVE_CD)) { + die "System running on Live-CD\n"; } else { print "Can not open Grub config file\n"; exit 1; -- cgit v1.2.3