From: Rick Farina (Zero_Chaos) Date: Wed, 31 Oct 2012 18:15:01 +0000 (-0400) Subject: add more lbzip2 support X-Git-Tag: catalyst-2.0.12~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2d5aed3654dc65ff1aca80fcb6adc0cc223297c5;p=catalyst.git add more lbzip2 support 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. --- diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index b5efe05e..450d0fab 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -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") \ diff --git a/targets/support/functions.sh b/targets/support/functions.sh index d0737a65..d362ece7 100644 --- a/targets/support/functions.sh +++ b/targets/support/functions.sh @@ -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-* diff --git a/targets/support/livecdfs-update.sh b/targets/support/livecdfs-update.sh index 2b41bf63..2712556b 100644 --- a/targets/support/livecdfs-update.sh +++ b/targets/support/livecdfs-update.sh @@ -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