mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-03 21:02:34 +00:00 
			
		
		
		
	-the defect 2987733 is fixed;
if the entry with one name ended with "/", "-l" should be used to detect whether it is a link or not git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5784 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		@@ -229,13 +229,31 @@ sub process_request {
 | 
			
		||||
                xCAT::Utils->runcmd("rm -rf $default", 0, 1);   # not sure whether it's necessary right now
 | 
			
		||||
            } else {
 | 
			
		||||
                my $target = $rootimg_dir.$f;
 | 
			
		||||
                if (-l $target) {
 | 
			
		||||
                if (-l $target) {   #not one directory
 | 
			
		||||
                    my $location = readlink $target;
 | 
			
		||||
                    # if it is not linked from tmpfs, it should be modified by the .postinstall file
 | 
			
		||||
                    if ($location =~ /\.statelite\/tmpfs/) {
 | 
			
		||||
                        xCAT::Utils->runcmd("rm -rf $target", 0, 1);
 | 
			
		||||
                        my $default = $rootimg_dir . "/.default" . $f;
 | 
			
		||||
                        xCAT::Utils->runcmd("cp -a $default $target", 0, 1);
 | 
			
		||||
                        if( -e $default) {
 | 
			
		||||
                            xCAT::Utils->runcmd("cp -a $default $target", 0, 1);
 | 
			
		||||
                        }else { # maybe someone deletes the copy in .default directory
 | 
			
		||||
                            xCAT::Utils->runcmd("touch $target", 0, 1);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                } else {    
 | 
			
		||||
                    chop $target;
 | 
			
		||||
                    if( -l $target ) {
 | 
			
		||||
                        my $location = readlink $target;
 | 
			
		||||
                        if ($location =~ /\.statelite\/tmpfs/) {
 | 
			
		||||
                            xCAT::Utils->runcmd("rm -rf $target", 0, 1);
 | 
			
		||||
                            my $default = $rootimg_dir . "/.default" . $f;
 | 
			
		||||
                            if( -e $default) {
 | 
			
		||||
                                xCAT::Utils->runcmd("cp -a $default $target", 0, 1);
 | 
			
		||||
                            } else {
 | 
			
		||||
                                xCAT::Utils->runcmd("mkdir $target", 0, 1);
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user