From e100a5c19aaf1e64bf48efe97fd47d4c6e373b0f Mon Sep 17 00:00:00 2001 From: ertaozh Date: Tue, 12 May 2015 23:14:44 -0400 Subject: [PATCH] fix bug 4635: Ubuntu genimage failure leaves bind mounts --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index ee80ba6ed..603cdfb79 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -369,8 +369,7 @@ unless ($onlyinitrd) { if ($pkglist) { $updates{'pkglist'} = $pkglist if ($tempfile); } else { - print "Unable to find package list for $profile!"; - exit 1; + xdie "Unable to find package list for $profile!"; } my %pkg_hash=imgutils::get_package_names($pkglist); @@ -380,8 +379,7 @@ unless ($onlyinitrd) { my $pkgnames = ""; foreach (keys(%{$pkg_hash{$pass}})) { if($_ eq "INCLUDEBAD") { - print "Unable to open the following pkglist files:\n".join("\n",@{$pkg_hash{$pass}{INCLUDEBAD}}); - exit 1; + xdie "Unable to open the following pkglist files:\n".join("\n",@{$pkg_hash{$pass}{INCLUDEBAD}}); } if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next;} @@ -406,8 +404,7 @@ unless ($onlyinitrd) { } } if ($found eq 0) { - print "Cannot find the kernel with version $kernelver.\n"; - exit 1; + xdie "Cannot find the kernel with version $kernelver.\n"; } push @npa, $kernelname; } @@ -434,8 +431,7 @@ unless ($onlyinitrd) { print "$envlist $aptgetcmdby install $pkgnames\n"; my $rc = system("$envlist $aptgetcmdby install --allow-unauthenticated $pkgnames"); if ($rc) { - print "Failed to install packages $pkgnames\n"; - exit 1; + xdie "Failed to install packages $pkgnames\n"; } } @@ -492,9 +488,7 @@ unless ($onlyinitrd) { foreach $pass (sort {$a <=> $b} (keys(%extra_hash))) { foreach (keys(%{$extra_hash{$pass}})) { if($_ eq "INCLUDEBAD") { - #print "Unable to open the following pkglist files:\n".join("\n",@{$extra_hash{$pass}{INCLUDEBAD}}); xdie "Unable to open the following pkglist files:\n".join("\n",@{$extra_hash{$pass}{INCLUDEBAD}}); - # exit 1; } if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next;} @@ -554,8 +548,6 @@ unless ($onlyinitrd) { print "$envlist $aptgetcmd\n"; my $rc = system("$envlist $aptgetcmd"); if ($rc) { - #print "apt-get invocation failed\n"; - #exit 1; xdie "apt-get invocation failed\n"; } } else {