From 54e38a38a44fec449f57a10d1391e570634f1feb Mon Sep 17 00:00:00 2001 From: mxi1 Date: Fri, 5 Mar 2010 06:54:52 +0000 Subject: [PATCH] --permission is added for statelite mode, you can set the permission of /.statelite now git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5378 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/netboot/sles/genimage | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index bdf82672e..169dfd01f 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -48,6 +48,7 @@ my $postinstall_filename; my $rootimg_dir; my $rwfiles; #these files are used by statelite for tmpfs rw my $mode; +my $permission; #the permission works only for statelite mode currently sub xdie { system("rm -rf /tmp/xcatinitrd.$$"); @@ -80,8 +81,10 @@ GetOptions( 'l=s' => \$rootlimit, 't=s' => \$tmplimit, 'k=s' => \$kernelver, - 'm=s' => \$mode #provide options for the mode of "genimage" + 'm=s' => \$mode, #provide options for the mode of "genimage" + 'permission=s' => \$permission ); + if (@ARGV > 0) { $imagename=$ARGV[0]; if ($arch or $osver or $profile) { @@ -146,6 +149,13 @@ if (@ARGV > 0) { $destdir=$ref1->{'rootimgdir'}; } +if ($mode eq "statelite") { + if (!$permission) { + $permission = "755"; + } +} + + if (!$arch) { $arch = `uname -m`; chomp($arch); @@ -605,7 +615,7 @@ EOS1 print $inifile "mount -t proc /proc /proc\n"; print $inifile "mount -t sysfs /sys /sys\n"; - print $inifile "mount -o mode=0755 -t tmpfs /dev /dev\n"; + print $inifile "mount -o mode=$permission -t tmpfs /dev /dev\n"; # the default permission will be 755 print $inifile "mkdir /dev/pts\n"; print $inifile "mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts\n"; print $inifile "mkdir /dev/shm\n"; @@ -747,10 +757,10 @@ if [ "\$NFSROOT" = "1" ]; then shell done grep '\\(shell\\)' /proc/cmdline >/dev/null && shell - mount -t tmpfs rw \$NEWROOT/\$RWDIR + mount -t tmpfs rw -o mode=755 \$NEWROOT/\$RWDIR mkdir -p \$NEWROOT/\$RWDIR/tmpfs - #mount the /root/.ssh, it needs more strict permission in order for ssh work + mount the /root/.ssh, it needs more strict permission in order for ssh work if [ ! -e "\$NEWROOT/root/.ssh" ] then mkdir -p \$NEWROOT/root/.ssh