From 3a65b11326b560567e2f1b4c2c2d056a98668d04 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 11 Mar 2015 04:04:04 -0400 Subject: [PATCH] defect 4586: when run genimage for ubuntu, grub_pc package cannot be configured correctly (postinst failed). It will cause the failure of genimage. use environment variable [DEBIAN_FRONTEND=noninteractive] for each apt-get run to make the apt-get default action is to say yes for any question --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 3f906064a..4edff6ac0 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -280,15 +280,11 @@ unless ($onlyinitrd) { my @line=split(" ",`ls -lh $installroot/$osver/$arch/dists/ | grep dr`); my $dist = $line[@line-1]; -# my $aptgetcmd = "chroot $rootimg_dir apt-get update && chroot $rootimg_dir apt-get $non_interactive "; - - # If there is env in otherpkg list - # apt-get update and apt-get install should be added env param - my $aptgetcmd = "chroot $rootimg_dir apt-get update"; - my $aptgetcmdby="chroot $rootimg_dir apt-get $non_interactive "; - - - my $aptcachecmd = "chroot $rootimg_dir apt-get update && chroot $rootimg_dir apt-cache $non_interactive "; + # If there is env in otherpkg list + # apt-get update and apt-get install should be added env param + my $aptgetcmd = "DEBIAN_FRONTEND=noninteractive chroot $rootimg_dir apt-get update"; + my $aptgetcmdby = "DEBIAN_FRONTEND=noninteractive chroot $rootimg_dir apt-get $non_interactive "; + my $aptcachecmd = "DEBIAN_FRONTEND=noninteractive chroot $rootimg_dir apt-get update && chroot $rootimg_dir apt-cache $non_interactive "; my $aptcmd1 = "debootstrap"; #my $aptcmd2 = "--arch $uarch $dist $rootimg_dir file://$installroot/$osver/$arch/"; my $aptcmd2;