From 089315126ce23459cd5c69e69a72a57a3ded144b Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Thu, 20 Nov 2014 02:00:45 -0500 Subject: [PATCH] fix bug 4410: Command genimage failed on Ubuntu 14.04.1 ppc64el --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 2b41a05cd..678b7e006 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -64,6 +64,7 @@ my $permission; # the permission works only for statelite mode currently my $tempfile; my $prompt; my $noupdate; +my $kernelimage; sub xdie { @@ -315,6 +316,9 @@ unless ($onlyinitrd) { } push @npa, $kernelname; } + elsif ($p =~ /linux-image-generic/) { + $kernelimage = "linux-image-generic"; + } elsif ($p =~ /^@/) { push @npa, "\"$p\""; } @@ -471,6 +475,13 @@ unless ($onlyinitrd) { #my $aptgetcmd_update = $yumcmd_base . " upgrade "; my $aptgetcmd_update = $aptgetcmd . "&&". $aptgetcmdby . " upgrade "; $rc = system("$aptgetcmd_update"); + if ($kernelimage) { + if ($kernelver) { + $kernelimage = "linux-image-".$kernelver."-generic"; + } + my $aptgetcmd_install = $aptgetcmd . "&&". $aptgetcmdby. " install --no-install-recommends ".$kernelimage; + $rc = system("$aptgetcmd_install"); + } print("Umount /proc, /dev, /sys, pkgdir and otherpkgdir to the rootimg.\n"); umount_chroot($rootimg_dir); # ignore any return code