mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-27 01:15:34 +00:00 
			
		
		
		
	support tar for redhat6.8
This commit is contained in:
		| @@ -488,14 +488,24 @@ sub process_request { | ||||
|         $oldmask = umask 0077; | ||||
|     } elsif ($method =~ /tar/) { | ||||
|         if (!$exlistloc) { | ||||
|             $excludestr = "find . -xdev -print0 | tar --selinux --xattrs-include='*' --no-recursion --use-compress-program=$compress --null -T - -cf ../rootimg.$suffix"; | ||||
|             my $checkoption = `tar --xattrs-include 2>&1`; | ||||
|             if ($checkoption =~ /unrecognized/) { | ||||
|                 $excludestr = "find . -xdev -print0 | tar --selinux --no-recursion --use-compress-program=$compress --null -T - -cf ../rootimg.$suffix"; | ||||
|             } else { | ||||
|                 $excludestr = "find . -xdev -print0 | tar --selinux --xattrs-include='*' --no-recursion --use-compress-program=$compress --null -T - -cf ../rootimg.$suffix"; | ||||
|             } | ||||
|         } else { | ||||
|             chdir("$rootimg_dir"); | ||||
|             system("$excludestr >> $xcat_packimg_tmpfile"); | ||||
|             if ($includestr) { | ||||
|                 system("$includestr >> $xcat_packimg_tmpfile"); | ||||
|             } | ||||
|             $excludestr = "cat $xcat_packimg_tmpfile| tar --selinux --xattrs-include='*' --no-recursion --use-compress-program=$compress -T - -cf  ../rootimg.$suffix"; | ||||
|             my $checkoption = `tar --xattrs-include 2>&1`; | ||||
|             if ($checkoption =~ /unrecognized/) { | ||||
|                 $excludestr = "cat $xcat_packimg_tmpfile| tar --selinux --no-recursion --use-compress-program=$compress -T - -cf  ../rootimg.$suffix"; | ||||
|             } else { | ||||
|                 $excludestr = "cat $xcat_packimg_tmpfile| tar --selinux --xattrs-include='*' --no-recursion --use-compress-program=$compress -T - -cf  ../rootimg.$suffix"; | ||||
|             } | ||||
|         } | ||||
|         $oldmask = umask 0077; | ||||
|     } elsif ($method =~ /squashfs/) { | ||||
|   | ||||
| @@ -107,8 +107,14 @@ elif [ -r /rootimg.tar.gz ] || [ -r /rootimg.tar.xz ]; then | ||||
|   echo -n "Extracting root filesystem:" | ||||
|   if [ -r /rootimg.tar.gz ]; then | ||||
|     tar --selinux --xattrs-include='*' -zxf /rootimg.tar.gz | ||||
|     if [ $? -ne 0 ]; then | ||||
|         tar --selinux -zxf /rootimg.tar.gz | ||||
|     fi | ||||
|   elif [ -r /rootimg.tar.xz ]; then | ||||
|     tar --selinux --xattrs-include='*' -Jxf /rootimg.tar.xz | ||||
|     if [ $? -ne 0 ]; then | ||||
|         tar --selinux -Jxf /rootimg.tar.xz | ||||
|     fi | ||||
|   fi | ||||
|   $NEWROOT/etc/init.d/localdisk | ||||
|   echo Done | ||||
|   | ||||
| @@ -111,8 +111,14 @@ elif [ -r /rootimg.tar.gz ] || [ -r /rootimg.tar.xz ]; then | ||||
|   echo -n "Extracting root filesystem:" | ||||
|   if [ -r /rootimg.tar.gz ]; then | ||||
|     tar --selinux --xattrs-include='*' -zxf /rootimg.tar.gz | ||||
|     if [ $? -ne 0 ]; then | ||||
|         tar --selinux -zxf /rootimg.tar.gz | ||||
|     fi | ||||
|   elif [ -r /rootimg.tar.xz ]; then | ||||
|     tar --selinux --xattrs-include='*' -Jxf /rootimg.tar.xz | ||||
|     if [ $? -ne 0 ]; then | ||||
|         tar --selinux -Jxf /rootimg.tar.xz | ||||
|     fi | ||||
|   fi | ||||
|   $NEWROOT/etc/init.d/localdisk | ||||
|   [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Done...." | ||||
|   | ||||
| @@ -1641,8 +1641,14 @@ EOMS | ||||
|     print $inifile "    echo -n \"Extracting root filesystem:\"\n"; | ||||
|     print $inifile "    if [ -r /rootimg.tar.gz ]; then\n"; | ||||
|     print $inifile "        tar --selinux --xattrs-include='*' -zxf /rootimg.tar.gz\n"; | ||||
|     print $inifile "        if [ \$? -ne 0 ]; then\n"; | ||||
|     print $inifile "            tar --selinux -zxf /rootimg.tar.gz\n"; | ||||
|     print $inifile "        fi\n"; | ||||
|     print $inifile "    elif [ -r /rootimg.tar.xz ]; then\n"; | ||||
|     print $inifile "        tar --selinux --xattrs-include='*' -Jxf /rootimg.tar.xz\n"; | ||||
|     print $inifile "        if [ \$? -ne 0 ]; then\n"; | ||||
|     print $inifile "            tar --selinux -Jxf /rootimg.tar.xz\n"; | ||||
|     print $inifile "        fi\n"; | ||||
|     print $inifile "    fi\n"; | ||||
|     print $inifile "    echo Done\n"; | ||||
|     print $inifile "else\n"; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user