add zypper refresh cmds to genimage to update cache when running genimage against an existing image
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5422 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
cc28c8abcb
commit
279f7ae8d4
@ -323,6 +323,9 @@ unless ($onlyinitrd) {
|
||||
}
|
||||
}
|
||||
|
||||
# Refresh the zypper cache in case there is still old data out there
|
||||
system("zypper -R $rootimg_dir refresh");
|
||||
|
||||
#my $yumcmd = "yum -y -c /tmp/genimage.$$.yum.conf --installroot=$rootimg_dir --disablerepo=* ";
|
||||
#$yumcmd .= "install ";
|
||||
#mkpath("$rootimg_dir/var/lib/yum");
|
||||
|
@ -130,6 +130,7 @@ unless ($onlyinitrd) {
|
||||
close($fd);
|
||||
#system("zypper -R $installroot/netboot/$osver/$arch/$profile/rootimg/ sa file:$srcdir");
|
||||
my $yumcmd = "yum -y -c /tmp/genimage.$$.yum.conf --installroot=$installroot/netboot/$osver/$arch/$profile/rootimg/ ";
|
||||
my $yumcmd_base = $yumcmd;
|
||||
$yumcmd .= "install ";
|
||||
mkpath("$installroot/netboot/$osver/$arch/$profile/rootimg/var/lib/yum");
|
||||
#my $yumcmd = "zypper -R $installroot/netboot/$osver/$arch/$profile/rootimg/ install -y ";
|
||||
@ -160,13 +161,14 @@ unless ($onlyinitrd) {
|
||||
$yumcmd =~ s/ $/\n/;
|
||||
my $rc = system($yumcmd);
|
||||
if ($rc) {
|
||||
print "zypper invocation failed\n";
|
||||
print "yum invocation failed\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# run zypper update to update any installed rpms
|
||||
# run yum update to update any installed rpms
|
||||
# needed when running genimage again after updating software in repositories
|
||||
my $yumcmd_update = "zypper -R $rootimg_dir update ";
|
||||
my $yumcmd_update = $yumcmd_base . " update ";
|
||||
$yumcmd_update =~ s/ $/\n/;
|
||||
$rc = system("$yumcmd_update");
|
||||
# ignore any return code
|
||||
|
||||
|
@ -289,6 +289,10 @@ unless ($onlyinitrd) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Refresh the zypper cache in case there is still old data out there
|
||||
system("zypper -R $rootimg_dir refresh");
|
||||
|
||||
#my $yumcmd = "yum -y -c /tmp/genimage.$$.yum.conf --installroot=$rootimg_dir --disablerepo=* ";
|
||||
#$yumcmd .= "install ";
|
||||
#mkpath("$rootimg_dir/var/lib/yum");
|
||||
|
Loading…
x
Reference in New Issue
Block a user