2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-18 20:30:56 +00:00

Merge pull request #699 from jjohnson42/txz

Provide 'txc' mode for packimage
This commit is contained in:
Xiaopeng Wang
2016-03-08 16:53:11 +08:00
5 changed files with 40 additions and 2 deletions

View File

@ -388,6 +388,18 @@ sub process_request {
$excludestr = "cat $xcat_packimg_tmpfile|cpio -H newc -o | $compress -c - > ../rootimg.gz";
}
$oldmask = umask 0077;
} elsif ($method =~ /txc/) {
if ( ! $exlistloc ) {
$excludestr = "find . -xdev | tar --selinux --xattr-include='*' -T - -Jcvf ../rootimg.txz";
}else {
chdir("$rootimg_dir");
system("$excludestr >> $xcat_packimg_tmpfile");
if ($includestr) {
system("$includestr >> $xcat_packimg_tmpfile");
}
$excludestr = "cat $xcat_packimg_tmpfile| tar --selinux --xattr-include='*' -T -Jcvf ../rootimg.txz";
}
$oldmask = umask 0077;
} elsif ($method =~ /squashfs/) {
$temppath = mkdtemp("/tmp/packimage.$$.XXXXXXXX");
chmod 0755,$temppath;

View File

@ -1,6 +1,6 @@
#!/bin/sh
echo $drivers
dracut_install wget cpio gzip dash modprobe touch echo cut wc
dracut_install wget tar xz 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

View File

@ -1,6 +1,6 @@
#!/bin/sh
echo $drivers
dracut_install wget cpio gzip dash modprobe wc touch echo cut
dracut_install wget tar xz cpio gzip dash modprobe wc touch echo cut
dracut_install -o ctorrent
dracut_install grep ifconfig hostname awk egrep grep dirname expr
dracut_install parted mke2fs bc mkswap swapon chmod

View File

@ -77,6 +77,19 @@ elif [ -r /rootimg.gz ]; then
fi
$NEWROOT/etc/init.d/localdisk
echo Done
elif [ -r /rootimg.txz ]; then
echo Setting up RAM-root tmpfs.
if [ -z $rootlimit ];then
mount -t tmpfs -o mode=755 rootfs $NEWROOT
else
mount -t tmpfs -o mode=755,size=$rootlimit rootfs $NEWROOT
fi
cd $NEWROOT
echo -n "Extracting root filesystem:"
tar -Jxvf /rootimg.txz
$NEWROOT/etc/init.d/localdisk
echo Done
elif [ -r /rootimg-statelite.gz ]; then
echo Setting up RAM-root tmpfs for statelite mode.

View File

@ -89,6 +89,19 @@ elif [ -r /rootimg.gz ]; then
$NEWROOT/etc/init.d/localdisk
[ "$xcatdebugmode" = "1" ] && logger -t xcat -p debug "Done...."
echo Done
elif [ -r /rootimg.txz ]; then
echo Setting up RAM-root tmpfs.
if [ -z $rootlimit ];then
mount -t tmpfs -o mode=755 rootfs $NEWROOT
else
mount -t tmpfs -o mode=755,size=$rootlimit rootfs $NEWROOT
fi
cd $NEWROOT
echo -n "Extracting root filesystem:"
tar -Jxvf /rootimg.txz
$NEWROOT/etc/init.d/localdisk
echo Done
elif [ -r /rootimg-statelite.gz ]; then
echo Setting up RAM-root tmpfs for statelite mode.