2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 11:42:05 +00:00

fix rw rootimg for sles12.2

This commit is contained in:
bybai 2017-03-10 03:24:44 -05:00
parent 1e11c4e24b
commit 2be6b6e91e

View File

@ -181,6 +181,8 @@ sub process_request {
system("mkdir -p $rootimg_dir/xcatpost");
system("cp -r $installroot/postscripts/* $rootimg_dir/xcatpost/");
# update rw to ro for sles
updateFstab($rootimg_dir,$profile,$arch);
#get the root password for the node
my $pass = xCAT::PasswordUtils::crypt_system_password();
@ -258,7 +260,6 @@ sub process_request {
return;
}
# now get the files for the node
my @synclist = xCAT::Utils->runcmd("ilitefile $imagename", 0, 1);
unless (@synclist) {
@ -569,6 +570,8 @@ sub process_request {
system("rm -f $xcat_packimg_tmpfile");
}
chdir($oldpath);
}
sub liteMe {
@ -968,5 +971,33 @@ sub liteItem {
}
}
=head3
updateFstab
=cut
sub updateFstab {
$rootimg_dir = shift;
$profile = shift;
$arch = shift;
my $rootfs_name = $profile . "_" . $arch;
my $tfstab;
open($tfstab, "<", "$rootimg_dir/etc/fstab");
my @fsdents = <$tfstab>;
close($tfstab);
open($tfstab, ">", "$rootimg_dir/etc/fstab");
foreach my $line (@fsdents) {
if ( $line =~ /^$rootfs_name/ ) {
$line =~ s/rw/ro/;
}
print $tfstab $line;
}
close($tfstab);
}
1;