2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-23 08:14:04 +00:00

Fix SLE15 genimage with existing passwd

SLE15 code was overwriting valid /etc/passwd on
partially built images.
This commit is contained in:
Jarrod Johnson
2019-06-11 10:59:32 -04:00
parent bff53d4eae
commit 3110dc8fd7
+7 -5
View File
@@ -397,11 +397,13 @@ unless ($onlyinitrd) {
#my $yumcmd = "yum -y -c /tmp/genimage.$$.yum.conf --installroot=$rootimg_dir --disablerepo=* ";
#$yumcmd .= "install ";
#mkpath("$rootimg_dir/var/lib/yum");
mkpath("$rootimg_dir/etc/");
my $passwdfile;
open($passwdfile, ">", "$rootimg_dir/etc/passwd");
print $passwdfile "root:x:0:0:root:/root:/bin/bash\n";
my $yumcmd;
if (! -f "$rootimg_dir/etc/passwd") {
mkpath("$rootimg_dir/etc/");
my $passwdfile;
open($passwdfile, ">", "$rootimg_dir/etc/passwd");
print $passwdfile "root:x:0:0:root:/root:/bin/bash\n";
}
my $yumcmd;
if ($osver_host < 11) {
$yumcmd = "zypper -R $rootimg_dir $non_interactive install ";
} else {