From 48b21d9656f39761c22e2594c2f815ab6746bf40 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Mon, 13 May 2013 11:08:43 +0000 Subject: [PATCH] defect 3543: fixed the issue that /etc/ cannot be set to tmpfs. It was caused by the /etc/mtab which is a speicfic file which is needed for mount command. And move the localdisk mount point creating to genimage git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16265 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/statelite.pm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/statelite.pm b/xCAT-server/lib/xcat/plugins/statelite.pm index 2972635ca..7aae70149 100644 --- a/xCAT-server/lib/xcat/plugins/statelite.pm +++ b/xCAT-server/lib/xcat/plugins/statelite.pm @@ -21,7 +21,6 @@ Getopt::Long::Configure("pass_through"); my $cmdname = "liteimg"; my $statedir = ".statelite"; -my $lddir = ".sllocal"; my $verbose = "0"; sub handled_commands { return { @@ -319,8 +318,10 @@ sub process_request { } } else { if ($tmpc[0] =~ m/link/) { + if ($tmpc[1] != "/etc/mtab") { $callback->({error=>[qq{Based on the option of $f, $fc should not use "link"-based options}], errorcode=>[1]}); return; + } } } if ( ($tmp[0] =~ m{persistent}) and ($tmpc[0] !~ m{persistent}) ) { @@ -558,12 +559,6 @@ sub liteMe { xCAT::Utils->runcmd("mkdir -p $rootimg_dir/$statedir/tmpfs", 0, 1); } - # ceate the dir for local disk mount point - unless (-d "$rootimg_dir/$lddir") { - $callback->({info=>["creating $rootimg_dir/$lddir"]}); - xCAT::Utils->runcmd("mkdir -p $rootimg_dir/$lddir", 0, 1); - } - foreach my $line (keys %{$hashNewRef}) { liteItem($rootimg_dir, $line, 0, $callback); if($hashNewRef->{$line}) { # there're children @@ -774,6 +769,9 @@ sub liteItem { # 1. copy original contents if they exist to .default directory # 2. remove file # 3. create symbolic link to .statelite + if ($entry[1] == "/etc/mtab") { + $isChild = 0; + } if ($isChild == 0) { #check if the file has been moved to .default by its parent or by last liteimg, if yes, then do nothing