diff --git a/docs/source/guides/admin-guides/references/man1/packimage.1.rst b/docs/source/guides/admin-guides/references/man1/packimage.1.rst index 13510d4b1..d0520af54 100644 --- a/docs/source/guides/admin-guides/references/man1/packimage.1.rst +++ b/docs/source/guides/admin-guides/references/man1/packimage.1.rst @@ -62,7 +62,7 @@ OPTIONS \ **-a**\ Architecture (ppc64,x86_64,etc) -\ **-m**\ Method (cpio,txc,squashfs, default is cpio) +\ **-m**\ Archive Method (cpio,tar,squashfs, default is cpio) ************ diff --git a/xCAT-client/pods/man1/packimage.1.pod b/xCAT-client/pods/man1/packimage.1.pod index c2f8bdc5c..0fa78542c 100644 --- a/xCAT-client/pods/man1/packimage.1.pod +++ b/xCAT-client/pods/man1/packimage.1.pod @@ -36,7 +36,7 @@ B<-p> Profile (compute,service) B<-a> Architecture (ppc64,x86_64,etc) -B<-m> Method (cpio,txc,squashfs, default is cpio) +B<-m> Archive Method (cpio,tar,squashfs, default is cpio) =head1 RETURN VALUE diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index a9d00021e..bf8c45f7f 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -464,7 +464,7 @@ sub mknetboot $platform = xCAT_plugin::anaconda::getplatform($osver); my $suffix = 'gz'; $suffix = 'sfs' if (-r "$rootimgdir/rootimg.sfs"); - $suffix = 'txz' if (-r "$rootimgdir/rootimg.txz"); + $suffix = 'tgz' if (-r "$rootimgdir/rootimg.tgz"); # statelite images are not packed. if ($statelite) { @@ -513,7 +513,7 @@ sub mknetboot copy("$rootimgdir/initrd.gz", "$rootimgdir/initrd-stateless.gz"); } } - unless (-r "$rootimgdir/rootimg.gz" or -r "$rootimgdir/rootimg.txz" or -r "$rootimgdir/rootimg.sfs") { + unless (-r "$rootimgdir/rootimg.gz" or -r "$rootimgdir/rootimg.tgz" or -r "$rootimgdir/rootimg.sfs") { $callback->({ error => ["No packed image for platform $osver, architecture $arch, and profile $profile found at $rootimgdir/rootimg.gz or $rootimgdir/rootimg.sfs on $myname, please run packimage (e.g. packimage -o $osver -p $profile -a $arch"], errorcode => [1] }); diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index 0908de774..5d57bea30 100644 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -1172,7 +1172,7 @@ sub mknetboot $platform = xCAT_plugin::debian::getplatform($osver); my $suffix = 'gz'; $suffix = 'sfs' if (-r "$rootimgdir/rootimg.sfs"); - $suffix = 'txz' if (-r "$rootimgdir/rootimg.txz"); + $suffix = 'tgz' if (-r "$rootimgdir/rootimg.tgz"); # statelite images are not packed. if ($statelite) { @@ -1222,7 +1222,7 @@ sub mknetboot copy("$rootimgdir/initrd.gz", "$rootimgdir/initrd-stateless.gz"); } } - unless (-r "$rootimgdir/rootimg.gz" or -r "$rootimgdir/rootimg.txz" or -r "$rootimgdir/rootimg.sfs") { + unless (-r "$rootimgdir/rootimg.gz" or -r "$rootimgdir/rootimg.tgz" or -r "$rootimgdir/rootimg.sfs") { $callback->({ error => ["No packed image for platform $osver, architecture $arch, and profile $profile, please run packimage (e.g. packimage -o $osver -p $profile -a $arch"], errorcode => [1] }); diff --git a/xCAT-server/lib/xcat/plugins/packimage.pm b/xCAT-server/lib/xcat/plugins/packimage.pm index 3ed8d5f35..296ede256 100755 --- a/xCAT-server/lib/xcat/plugins/packimage.pm +++ b/xCAT-server/lib/xcat/plugins/packimage.pm @@ -429,7 +429,7 @@ sub process_request { $compress = "pigz"; } if (!$exlistloc) { - $excludestr = "find . -xdev |cpio -H newc -o | $compress -c - > ../rootimg.gz"; + $excludestr = "find . -xdev -print0 | cpio -H newc -o -0 | $compress -c - > ../rootimg.gz"; } else { chdir("$rootimg_dir"); system("$excludestr >> $xcat_packimg_tmpfile"); @@ -439,22 +439,29 @@ sub process_request { $excludestr = "cat $xcat_packimg_tmpfile|cpio -H newc -o | $compress -c - > ../rootimg.gz"; } $oldmask = umask 0077; - } elsif ($method =~ /txc/) { - my $isxz = system("bash -c 'type -p xz' >/dev/null 2>&1"); - unless ($isxz == 0) { - $callback->({ error => ["Command xz does not exist, please make sure it works."] }); - return 1; + } elsif ($method =~ /tar/) { + my $compress = "gzip"; + + #use "pigz" as the compress tool instead of gzip if "pigz" exist + my $ispigz = system("bash -c 'type -p pigz' >/dev/null 2>&1"); + if ($ispigz == 0) { + $compress = "pigz"; + } else { + my $isgzip = system("bash -c 'type -p gzip' >/dev/null 2>&1"); + unless ($isgzip == 0) { + $callback->({ error => ["Command gzip does not exist, please make sure it works."] }); + return 1; + } } - $callback->({ info => ["It will take several minutes to complete. So please wait for several minutes, then the other operations could be done. Otherwise, the other operation will fail."] }); if (!$exlistloc) { - $excludestr = "find . -xdev | tar --selinux --xattrs-include='*' -T - -Jcvf ../rootimg.txz"; + $excludestr = "find . -xdev -print0 | tar --selinux --xattrs-include='*' --null -T - -c | $compress -c - > ../rootimg.tgz"; } 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='*' -T - -Jcvf ../rootimg.txz"; + $excludestr = "cat $xcat_packimg_tmpfile| tar --selinux --xattrs-include='*' -T - -c | $compress -c - > ../rootimg.tgz"; } $oldmask = umask 0077; } elsif ($method =~ /squashfs/) { @@ -470,7 +477,8 @@ sub process_request { $callback->({ error => ["Invalid method '$method' requested"], errorcode => [1] }); } chdir("$rootimg_dir"); - `$excludestr`; + my $outputmsg = `$excludestr`; + $callback->({ info => ["$outputmsg"] }); if ($method =~ /cpio/) { chmod 0644, "$destdir/rootimg.gz"; if ($dotorrent) { @@ -482,8 +490,8 @@ sub process_request { chdir($currdir); } umask $oldmask; - } elsif ($method =~ /txc/) { - chmod 0644, "$destdir/rootimg.txz"; + } elsif ($method =~ /tar/) { + chmod 0644, "$destdir/rootimg.tgz"; umask $oldmask; } elsif ($method =~ /squashfs/) { my $flags; diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 3b26ccdb9..a833353ea 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -329,7 +329,7 @@ sub mknetboot my $suffix = 'gz'; $suffix = 'sfs' if (-r "$rootimgdir/rootimg.sfs"); - $suffix = 'txz' if (-r "$rootimgdir/rootimg.txz"); + $suffix = 'tgz' if (-r "$rootimgdir/rootimg.tgz"); if ($statelite) { unless (-r "$rootimgdir/kernel") { @@ -381,7 +381,7 @@ sub mknetboot } } - unless (-r "$rootimgdir/rootimg.gz" or -r "$rootimgdir/rootimg.txz" or -r "$rootimgdir/rootimg.sfs") { + unless (-r "$rootimgdir/rootimg.gz" or -r "$rootimgdir/rootimg.tgz" or -r "$rootimgdir/rootimg.sfs") { $callback->({ error => [qq{No packed image for platform $osver, architecture $arch, and profile $profile, please run packimage before nodeset}], errorcode => [1] diff --git a/xCAT-server/share/xcat/netboot/rh/compute.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.pkglist index 30d4e4feb..2824c79fc 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.pkglist @@ -12,3 +12,5 @@ ntp sysklogd rpm rsync +tar +gzip diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.pkglist index 555ec63cc..e2389d3de 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.pkglist @@ -13,3 +13,5 @@ rpm rsync rsyslog e2fsprogs +gzip +tar diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist index 6ad7101c8..fbaf36a2a 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.pkglist @@ -24,4 +24,5 @@ lsvpd irqbalance procps parted -xz +gzip +tar diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist index cf0538893..ae873e99f 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.pkglist @@ -20,4 +20,5 @@ rsync rsyslog e2fsprogs parted -xz +gzip +tar diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.pkglist index 7f576221b..bb9af2ce9 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.pkglist @@ -24,4 +24,5 @@ irqbalance procps-ng parted net-tools -xz +gzip +tar diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.pkglist index 409531cdf..3c54123a8 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.pkglist @@ -19,4 +19,5 @@ rsyslog e2fsprogs parted net-tools -xz +gzip +tar diff --git a/xCAT-server/share/xcat/netboot/rh/dracut/install.netboot b/xCAT-server/share/xcat/netboot/rh/dracut/install.netboot index 706a14d12..f14ffa1c0 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut/install.netboot +++ b/xCAT-server/share/xcat/netboot/rh/dracut/install.netboot @@ -1,6 +1,6 @@ #!/bin/sh echo $drivers -dracut_install wget tar xz cpio gzip dash modprobe touch echo cut wc xz +dracut_install wget tar cpio gzip dash modprobe touch echo cut wc dracut_install -o ctorrent dracut_install grep ifconfig hostname awk egrep grep dirname expr dracut_install mount.nfs diff --git a/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot index 71e63af69..688d7f772 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut/xcatroot @@ -87,7 +87,7 @@ elif [ -r /rootimg.gz ]; then $NEWROOT/etc/init.d/localdisk [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Done...." echo Done -elif [ -r /rootimg.txz ]; then +elif [ -r /rootimg.tgz ]; then echo Setting up RAM-root tmpfs. if [ -z $rootlimit ];then mount -t tmpfs -o mode=755 rootfs $NEWROOT @@ -97,7 +97,7 @@ elif [ -r /rootimg.txz ]; then cd $NEWROOT echo -n "Extracting root filesystem:" - tar -Jxvf /rootimg.txz + tar --selinux --xattrs-include='*' -zxvf /rootimg.tgz $NEWROOT/etc/init.d/localdisk echo Done elif [ -r /rootimg-statelite.gz ]; then diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot b/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot index 9bae9d704..e1227868b 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/install.netboot @@ -1,6 +1,6 @@ #!/bin/sh echo $drivers -dracut_install wget cpio gzip modprobe touch echo cut wc xz +dracut_install wget tar cpio gzip modprobe touch echo cut wc dracut_install grep ifconfig hostname awk egrep grep dirname expr dracut_install mount.nfs dracut_install parted mke2fs bc mkswap swapon chmod diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot index 2344938dc..328068a32 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot @@ -89,8 +89,8 @@ elif [ -r /rootimg.gz ]; then $NEWROOT/etc/init.d/localdisk [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Done...." echo Done -elif [ -r /rootimg.txz ]; then - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "rootimg.txz downloaded,setting up RAM-root tmpfs...." +elif [ -r /rootimg.tgz ]; then + [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "rootimg.tgz downloaded,setting up RAM-root tmpfs...." echo Setting up RAM-root tmpfs. if [ -z $rootlimit ];then mount -t tmpfs -o mode=755 rootfs $NEWROOT @@ -101,7 +101,7 @@ elif [ -r /rootimg.txz ]; then cd $NEWROOT [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Extracting root filesystem:" echo -n "Extracting root filesystem:" - tar -Jxvf /rootimg.txz + tar --selinux --xattrs-include='*' -zxvf /rootimg.tgz $NEWROOT/etc/init.d/localdisk [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Done...." echo Done diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 0c42cb1f5..9174f59a4 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -1612,7 +1612,7 @@ EOMS print $inifile " zcat /rootimg.gz |cpio -idum\n"; print $inifile " fi\n"; print $inifile " echo Done\n"; - print $inifile "elif [ -r /rootimg.txz ]; then\n"; + print $inifile "elif [ -r /rootimg.tgz ]; then\n"; print $inifile " echo Setting up RAM-root tmpfs.\n"; if ($rootlimit) { @@ -1622,7 +1622,7 @@ EOMS } print $inifile " cd \$NEWROOT\n"; print $inifile " echo -n \"Extracting root filesystem:\"\n"; - print $inifile " tar -Jxvf /rootimg.txz\n"; + print $inifile " tar --selinux --xattrs-include='*' -zxvf /rootimg.tgz\n"; print $inifile " echo Done\n"; print $inifile "else\n"; print $inifile " echo -n Failed to download image, panicing in 5...\n"; @@ -1699,7 +1699,7 @@ EOMS } # add rsync for statelite - foreach ("bin/cpio", "sbin/nash", "sbin/busybox.anaconda", "sbin/rmmod", "bin/bash", "usr/sbin/chroot", "sbin/mount.nfs", "usr/bin/rsync", "usr/bin/wc", "usr/bin/xz") { + foreach ("bin/cpio", "sbin/nash", "sbin/busybox.anaconda", "sbin/rmmod", "bin/bash", "usr/sbin/chroot", "sbin/mount.nfs", "usr/bin/rsync", "usr/bin/wc", "usr/bin/gzip", "usr/bin/tar") { getlibs($_); push @filestoadd, $_; } diff --git a/xCAT-server/share/xcat/netboot/sles/compute.pkglist b/xCAT-server/share/xcat/netboot/sles/compute.pkglist index 05bfaa5b3..cc5a5fd87 100644 --- a/xCAT-server/share/xcat/netboot/sles/compute.pkglist +++ b/xCAT-server/share/xcat/netboot/sles/compute.pkglist @@ -11,3 +11,5 @@ wget rsync timezone ntp +tar +gzip diff --git a/xCAT-server/share/xcat/netboot/sles/compute.sles11.pkglist b/xCAT-server/share/xcat/netboot/sles/compute.sles11.pkglist index a09fe48d1..e284622f1 100644 --- a/xCAT-server/share/xcat/netboot/sles/compute.sles11.pkglist +++ b/xCAT-server/share/xcat/netboot/sles/compute.sles11.pkglist @@ -17,3 +17,5 @@ rsync timezone bc ntp +gzip +tar diff --git a/xCAT-server/share/xcat/netboot/sles/compute.sles11.ppc64.pkglist b/xCAT-server/share/xcat/netboot/sles/compute.sles11.ppc64.pkglist index a1fbff957..26e735587 100644 --- a/xCAT-server/share/xcat/netboot/sles/compute.sles11.ppc64.pkglist +++ b/xCAT-server/share/xcat/netboot/sles/compute.sles11.ppc64.pkglist @@ -19,3 +19,5 @@ lsvpd irqbalance procps ntp +gzip +tar diff --git a/xCAT-server/share/xcat/netboot/sles/compute.sles12.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/sles/compute.sles12.ppc64le.pkglist index d0b4c3a0e..1eebf1414 100644 --- a/xCAT-server/share/xcat/netboot/sles/compute.sles12.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/sles/compute.sles12.ppc64le.pkglist @@ -41,4 +41,3 @@ udev kernel-default kernel-firmware adaptec-firmware -xz diff --git a/xCAT-server/share/xcat/netboot/sles/compute.sles12.x86_64.pkglist b/xCAT-server/share/xcat/netboot/sles/compute.sles12.x86_64.pkglist index d0b4c3a0e..1eebf1414 100644 --- a/xCAT-server/share/xcat/netboot/sles/compute.sles12.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/sles/compute.sles12.x86_64.pkglist @@ -41,4 +41,3 @@ udev kernel-default kernel-firmware adaptec-firmware -xz diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/install.netboot b/xCAT-server/share/xcat/netboot/sles/dracut_033/install.netboot index 9bae9d704..e1227868b 100755 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/install.netboot +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/install.netboot @@ -1,6 +1,6 @@ #!/bin/sh echo $drivers -dracut_install wget cpio gzip modprobe touch echo cut wc xz +dracut_install wget tar cpio gzip modprobe touch echo cut wc dracut_install grep ifconfig hostname awk egrep grep dirname expr dracut_install mount.nfs dracut_install parted mke2fs bc mkswap swapon chmod diff --git a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot index c9775a412..91b6a3aa4 100755 --- a/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot +++ b/xCAT-server/share/xcat/netboot/sles/dracut_033/xcatroot @@ -87,8 +87,8 @@ elif [ -r /rootimg.gz ]; then $NEWROOT/etc/init.d/localdisk [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Done...." echo Done -elif [ -r /rootimg.txz ]; then - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "rootimg.txz downloaded,setting up RAM-root tmpfs...." +elif [ -r /rootimg.tgz ]; then + [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "rootimg.tgz downloaded,setting up RAM-root tmpfs...." echo Setting up RAM-root tmpfs. if [ -z $rootlimit ];then mount -t tmpfs -o mode=755 rootfs $NEWROOT @@ -99,7 +99,7 @@ elif [ -r /rootimg.txz ]; then cd $NEWROOT [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Extracting root filesystem:" echo -n "Extracting root filesystem:" - tar -Jxvf /rootimg.txz + tar --selinux --xattrs-include='*' -zxvf /rootimg.tgz $NEWROOT/etc/init.d/localdisk [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Done...." echo Done diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index ebc09e3de..5b894e37a 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -1639,7 +1639,7 @@ EOMS print $inifile " zcat /rootimg.gz |cpio -idum\n"; print $inifile " fi\n"; print $inifile " echo Done\n"; - print $inifile "elif [ -r /rootimg.txz ]; then\n"; + print $inifile "elif [ -r /rootimg.tgz ]; then\n"; print $inifile " echo Setting up RAM-root tmpfs.\n"; if ($rootlimit) { @@ -1649,7 +1649,7 @@ EOMS } print $inifile " cd \$NEWROOT\n"; print $inifile " echo -n \"Extracting root filesystem:\"\n"; - print $inifile " tar -Jxvf /rootimg.txz\n"; + print $inifile " tar --selinux --xattrs-include='*' -zxvf /rootimg.tgz\n"; print $inifile " echo Done\n"; print $inifile "else\n"; print $inifile " echo -n Failed to download image, panicing in 5...\n"; @@ -1758,7 +1758,7 @@ EOMS } } if ($mode eq "statelite") { - foreach ("sbin/ifconfig", "usr/bin/clear", "usr/bin/touch", "bin/hostname", "usr/bin/egrep", "bin/ln", "bin/ls", "usr/bin/dirname", "usr/bin/expr", "usr/bin/chroot", "usr/bin/grep", "bin/cpio", "bin/sleep", "bin/mount", "bin/umount", "sbin/dhcpcd", "bin/bash", "sbin/insmod", "bin/mkdir", "bin/mknod", "sbin/ip", "bin/cat", "usr/bin/awk", "usr/bin/wget", "bin/cp", "usr/bin/cpio", "usr/bin/zcat", "usr/bin/gzip", "lib/mkinitrd/bin/run-init", "usr/bin/uniq", "usr/bin/sed", "usr/bin/wc", "bin/sed", "sbin/udevd", "usr/bin/readlink", "usr/sbin/parted", "sbin/mke2fs", "sbin/mkswap", "sbin/swapon", "bin/chmod", "usr/bin/bc", "usr/bin/xz") { + foreach ("sbin/ifconfig", "usr/bin/clear", "usr/bin/touch", "bin/hostname", "usr/bin/egrep", "bin/ln", "bin/ls", "usr/bin/dirname", "usr/bin/expr", "usr/bin/chroot", "usr/bin/grep", "bin/cpio", "bin/sleep", "bin/mount", "bin/umount", "sbin/dhcpcd", "bin/bash", "sbin/insmod", "bin/mkdir", "bin/mknod", "sbin/ip", "bin/cat", "usr/bin/awk", "usr/bin/wget", "bin/cp", "usr/bin/cpio", "usr/bin/zcat", "usr/bin/gzip", "lib/mkinitrd/bin/run-init", "usr/bin/uniq", "usr/bin/sed", "usr/bin/wc", "bin/sed", "sbin/udevd", "usr/bin/readlink", "usr/sbin/parted", "sbin/mke2fs", "sbin/mkswap", "sbin/swapon", "bin/chmod", "usr/bin/bc", "usr/bin/gzip", "usr/bin/tar") { getlibs($_); push @filestoadd, $_; } @@ -1770,7 +1770,7 @@ EOMS } } else { - foreach ("sbin/ifconfig", "usr/bin/clear", "usr/bin/touch", "usr/bin/grep", "usr/bin/egrep", "bin/cpio", "bin/sleep", "bin/mount", "sbin/dhcpcd", "bin/bash", "sbin/insmod", "bin/mkdir", "bin/mknod", "sbin/ip", "bin/cat", "usr/bin/awk", "usr/bin/wget", "bin/cp", "usr/bin/cpio", "usr/bin/zcat", "usr/bin/gzip", "lib/mkinitrd/bin/run-init", "usr/bin/uniq", "usr/bin/sed", "sbin/udevd", "usr/bin/readlink", "usr/bin/expr", "usr/sbin/parted", "sbin/mke2fs", "sbin/mkswap", "sbin/swapon", "bin/chmod", "usr/bin/bc", "usr/bin/xz") { + foreach ("sbin/ifconfig", "usr/bin/clear", "usr/bin/touch", "usr/bin/grep", "usr/bin/egrep", "bin/cpio", "bin/sleep", "bin/mount", "sbin/dhcpcd", "bin/bash", "sbin/insmod", "bin/mkdir", "bin/mknod", "sbin/ip", "bin/cat", "usr/bin/awk", "usr/bin/wget", "bin/cp", "usr/bin/cpio", "usr/bin/zcat", "usr/bin/gzip", "lib/mkinitrd/bin/run-init", "usr/bin/uniq", "usr/bin/sed", "sbin/udevd", "usr/bin/readlink", "usr/bin/expr", "usr/sbin/parted", "sbin/mke2fs", "sbin/mkswap", "sbin/swapon", "bin/chmod", "usr/bin/bc", "usr/bin/gzip", "usr/bin/tar") { getlibs($_); push @filestoadd, $_; } @@ -2422,3 +2422,4 @@ sub usage { print " genimage -i eth0 -n tg3,bnx2 -o sles11 -p compute --permission 777\n"; return 0; } + diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.pkglist index 617097381..c3839a534 100644 --- a/xCAT-server/share/xcat/netboot/ubuntu/compute.pkglist +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.pkglist @@ -12,3 +12,5 @@ rsyslog rsync busybox-static gawk +tar +gzip diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.4.ppc64el.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.4.ppc64el.pkglist index 971deec45..730382c86 100644 --- a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.4.ppc64el.pkglist +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.4.ppc64el.pkglist @@ -13,4 +13,5 @@ rsync busybox-static gawk dnsutils -xz-utils +tar +gzip diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.4.x86_64.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.4.x86_64.pkglist index 971deec45..730382c86 100644 --- a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.4.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.4.x86_64.pkglist @@ -13,4 +13,5 @@ rsync busybox-static gawk dnsutils -xz-utils +tar +gzip diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.pkglist index c23ba181a..b1357ac5f 100644 --- a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.pkglist +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.pkglist @@ -12,3 +12,5 @@ rsyslog rsync busybox-static gawk +tar +gzip diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.pkglist index ebad2c260..d3e1da021 100644 --- a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.pkglist +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.pkglist @@ -12,3 +12,5 @@ rsyslog rsync busybox-static gawk +tar +gzip diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.ppc64el.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.ppc64el.pkglist index 07e8c4b1b..8276befc2 100644 --- a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.ppc64el.pkglist +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.ppc64el.pkglist @@ -14,4 +14,5 @@ rsync busybox-static gawk dnsutils -xz-utils +tar +gzip diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.x86_64.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.x86_64.pkglist index 07e8c4b1b..8276befc2 100644 --- a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.x86_64.pkglist @@ -14,4 +14,5 @@ rsync busybox-static gawk dnsutils -xz-utils +tar +gzip diff --git a/xCAT-server/share/xcat/netboot/ubuntu/dracut/install.netboot b/xCAT-server/share/xcat/netboot/ubuntu/dracut/install.netboot index a16bd719e..10f1c7320 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/dracut/install.netboot +++ b/xCAT-server/share/xcat/netboot/ubuntu/dracut/install.netboot @@ -1,6 +1,6 @@ #!/bin/sh echo $drivers -dracut_install wget cpio gzip dash modprobe touch echo cut wc xz +dracut_install wget tar cpio gzip dash modprobe touch echo cut wc dracut_install grep ifconfig hostname awk egrep grep dirname expr dracut_install mount.nfs inst "$moddir/xcatroot" "/sbin/xcatroot" diff --git a/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot b/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot index 6d9a3cbd0..073ec1e4b 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot +++ b/xCAT-server/share/xcat/netboot/ubuntu/dracut/xcatroot @@ -50,12 +50,12 @@ elif [ -r /rootimg.gz ]; then gzip -cd /rootimg.gz |cpio -idum fi echo Done -elif [ -r /rootimg.txz ]; then +elif [ -r /rootimg.tgz ]; then echo Setting up RAM-root tmpfs. mount -t tmpfs -o mode=755 rootfs $NEWROOT cd $NEWROOT echo -n "Extracting root filesystem:" - tar -Jxvf /rootimg.txz + tar --selinux --xattrs-include='*' -zxvf /rootimg.tgz echo Done elif [ -r /rootimg-statelite.gz ]; then echo Setting up RAM-root tmpfs for statelite mode. diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 2921543ba..870c13b73 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -1459,8 +1459,8 @@ EOMS print $inifile " fi\n"; print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"Done...\"\n"; print $inifile " echo Done\n"; - print $inifile "elif [ -r /rootimg.txz ]; then\n"; - print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"rootimg.txz downloaded,setting up RAM-root tmpfs...\"\n"; + print $inifile "elif [ -r /rootimg.tgz ]; then\n"; + print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"rootimg.tgz downloaded,setting up RAM-root tmpfs...\"\n"; print $inifile " echo Setting up RAM-root tmpfs.\n"; if ($rootlimit) { @@ -1471,7 +1471,7 @@ EOMS print $inifile " cd \$NEWROOT\n"; print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"Extracting root filesystem:\"\n"; print $inifile " echo -n \"Extracting root filesystem:\"\n"; - print $inifile " tar -Jxvf /rootimg.txz\n"; + print $inifile " tar --selinux --xattrs-include='*' -zxvf /rootimg.tgz\n"; print $inifile " ([ \"\$xcatdebugmode\" = \"1\" ] || [ \"\$xcatdebugmode\" = \"2\" ]) && logger -t xcat -p debug \"Done...\"\n"; print $inifile " echo Done\n"; print $inifile "else\n"; @@ -1612,7 +1612,7 @@ EOMS } # add rsync for statelite - foreach ("usr/bin/dig", "bin/busybox", "bin/bash", "sbin/mount.nfs", "usr/bin/rsync", "sbin/insmod", "sbin/udevd", "sbin/udevadm", "sbin/modprobe", "sbin/blkid", "sbin/depmod", "usr/bin/wget", "usr/bin/xz") { + foreach ("usr/bin/dig", "bin/busybox", "bin/bash", "sbin/mount.nfs", "usr/bin/rsync", "sbin/insmod", "sbin/udevd", "sbin/udevadm", "sbin/modprobe", "sbin/blkid", "sbin/depmod", "usr/bin/wget", "usr/bin/gzip", "usr/bin/tar") { getlibs($_); push @filestoadd, $_; }