add more lbzip2 support
authorRick Farina (Zero_Chaos) <zerochaos@gentoo.org>
Wed, 31 Oct 2012 18:15:01 +0000 (14:15 -0400)
committerRick Farina (Zero_Chaos) <zerochaos@gentoo.org>
Wed, 31 Oct 2012 18:17:07 +0000 (14:17 -0400)
Matt Turner on commit 166a23995f9ca2356cfb2722df37f13c54bffcfd added in
support for lbzip2 use in compression. This extends his patch as much as
possible for decompression as well.

modules/generic_stage_target.py
targets/support/functions.sh
targets/support/livecdfs-update.sh

index b5efe05ea2d44659d1d456d745298291669e65d4..450d0fab87f6443b42e32635e99ea3b78dce2b3c 100644 (file)
@@ -649,8 +649,12 @@ class generic_stage_target(generic_target):
                                        self.settings["source_path"]+"\nto "+\
                                        self.settings["chroot_path"]+\
                                                " (This may take some time) ...\n"
-                               unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\
-                                       self.settings["chroot_path"]
+                               if "bz2" == self.settings["chroot_path"][-3:]:
+                                       unpack_cmd="tar -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\
+                                               self.settings["chroot_path"]
+                               else:
+                                       unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\
+                                               self.settings["chroot_path"]
                                error_msg="Tarball extraction of "+\
                                        self.settings["source_path"]+" to "+\
                                        self.settings["chroot_path"]+" failed."
@@ -660,8 +664,12 @@ class generic_stage_target(generic_target):
                                self.settings["source_path"]+"\nto "+\
                                self.settings["chroot_path"]+\
                                " (This may take some time) ...\n"
-                       unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\
-                               self.settings["chroot_path"]
+                       if "bz2" == self.settings["chroot_path"][-3:]:
+                               unpack_cmd="tar -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\
+                                       self.settings["chroot_path"]
+                       else:
+                               unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\
+                                       self.settings["chroot_path"]
                        error_msg="Tarball extraction of "+self.settings["source_path"]+\
                                " to "+self.settings["chroot_path"]+" failed."
 
@@ -758,7 +766,10 @@ class generic_stage_target(generic_target):
                                read_from_clst(self.settings["snapshot_cache_path"]+\
                                "catalyst-hash")
                        destdir=self.settings["snapshot_cache_path"]
-                       unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+destdir
+                       if "bz2" == self.settings["chroot_path"][-3:]:
+                               unpack_cmd="tar -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+destdir
+                       else:
+                               unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+destdir
                        unpack_errmsg="Error unpacking snapshot"
                        cleanup_msg="Cleaning up invalid snapshot cache at \n\t"+\
                                self.settings["snapshot_cache_path"]+\
@@ -774,8 +785,12 @@ class generic_stage_target(generic_target):
                        cleanup_errmsg="Error removing existing snapshot directory."
                        cleanup_msg=\
                                "Cleaning up existing portage tree (This can take a long time)..."
-                       unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+\
-                               self.settings["chroot_path"]+"/usr"
+                       if "bz2" == self.settings["chroot_path"][-3:]:
+                               unpack_cmd="tar -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+\
+                                       self.settings["chroot_path"]+"/usr"
+                       else:
+                               unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+\
+                                       self.settings["chroot_path"]+"/usr"
                        unpack_errmsg="Error unpacking snapshot"
 
                        if self.settings.has_key("AUTORESUME") \
index d0737a652eb9cda16bad3bf553d1436f0dcb1d70..d362ece7405b58fb8ed723654c50ffb13e69c0ef 100644 (file)
@@ -46,7 +46,7 @@ extract_cdtar() {
        # boot-loader/filesystem skeleton for the ISO.
        cdtar=${clst_cdtar}
        [ -z "${cdtar}" ] && die "Required key cdtar not defined, exiting"
-       tar xjpf ${cdtar} -C $1 || die "Couldn't extract cdtar ${cdtar}"
+       tar -I lbzip2 -xpf ${cdtar} -C $1 || die "Couldn't extract cdtar ${cdtar}"
 }
 
 extract_kernels() {
@@ -71,7 +71,7 @@ extract_kernels() {
 
                [ ! -e "${kbinary}" ] && die "Can't find kernel tarball at ${kbinary}"
                mkdir -p ${1}/
-               tar xjf ${kbinary} -C ${1}/
+               tar -I lbzip2 -xf ${kbinary} -C ${1}/
 
                # change config name from "config-*" to "gentoo", for example
                #mv ${1}/config-* ${1}/${x}-config
@@ -115,7 +115,7 @@ extract_modules() {
        if [ -f "${kmodules}" ]
        then
                mkdir -p ${1}/
-               tar xjf ${kmodules} --strip-components 1 -C ${1}/lib lib
+               tar -I lbzip2 -xf ${kmodules} --strip-components 1 -C ${1}/lib lib
        else
                echo "Can't find kernel modules tarball at ${kmodules}.  Skipping...."
        fi
@@ -127,7 +127,7 @@ extract_kernel() {
        kbinary="${clst_chroot_path}/tmp/kerncache/${2}-kernel-initrd-${clst_version_stamp}.tar.bz2"
        [ ! -e "${kbinary}" ] && die "Can't find kernel tarball at ${kbinary}"
        mkdir -p ${1}/
-       tar xjf ${kbinary} -C ${1}/
+       tar -I lbzip2 -xf ${kbinary} -C ${1}/
        # change config name from "config-*" to "gentoo", for example
        #mv ${1}/config-* ${1}/${2}-config
        rm ${1}/config-*
index 2b41bf630bd3717899dc912882886c9556cc3c12..2712556be0761513e73bc007bd76756d274781eb 100644 (file)
@@ -227,7 +227,7 @@ fi
 if [ -n "$(ls /lib/firmware)" ]
 then
        cd /lib/firmware
-       /bin/tar cjpf /lib/firmware.tar.bz2 .
+       /bin/tar -I lbzip2 -cpf /lib/firmware.tar.bz2 .
        rm -rf /lib/firmware/*
 fi