1 |
commit: 2d5aed3654dc65ff1aca80fcb6adc0cc223297c5 |
2 |
Author: Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Oct 31 18:15:01 2012 +0000 |
4 |
Commit: Richard Farina <zerochaos <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 31 18:17:07 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=2d5aed36 |
7 |
|
8 |
add more lbzip2 support |
9 |
|
10 |
Matt Turner on commit 166a23995f9ca2356cfb2722df37f13c54bffcfd added in |
11 |
support for lbzip2 use in compression. This extends his patch as much as |
12 |
possible for decompression as well. |
13 |
|
14 |
--- |
15 |
modules/generic_stage_target.py | 29 ++++++++++++++++++++++------- |
16 |
targets/support/functions.sh | 8 ++++---- |
17 |
targets/support/livecdfs-update.sh | 2 +- |
18 |
3 files changed, 27 insertions(+), 12 deletions(-) |
19 |
|
20 |
diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py |
21 |
index b5efe05..450d0fa 100644 |
22 |
--- a/modules/generic_stage_target.py |
23 |
+++ b/modules/generic_stage_target.py |
24 |
@@ -649,8 +649,12 @@ class generic_stage_target(generic_target): |
25 |
self.settings["source_path"]+"\nto "+\ |
26 |
self.settings["chroot_path"]+\ |
27 |
" (This may take some time) ...\n" |
28 |
- unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\ |
29 |
- self.settings["chroot_path"] |
30 |
+ if "bz2" == self.settings["chroot_path"][-3:]: |
31 |
+ unpack_cmd="tar -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ |
32 |
+ self.settings["chroot_path"] |
33 |
+ else: |
34 |
+ unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\ |
35 |
+ self.settings["chroot_path"] |
36 |
error_msg="Tarball extraction of "+\ |
37 |
self.settings["source_path"]+" to "+\ |
38 |
self.settings["chroot_path"]+" failed." |
39 |
@@ -660,8 +664,12 @@ class generic_stage_target(generic_target): |
40 |
self.settings["source_path"]+"\nto "+\ |
41 |
self.settings["chroot_path"]+\ |
42 |
" (This may take some time) ...\n" |
43 |
- unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\ |
44 |
- self.settings["chroot_path"] |
45 |
+ if "bz2" == self.settings["chroot_path"][-3:]: |
46 |
+ unpack_cmd="tar -I lbzip2 -xpf "+self.settings["source_path"]+" -C "+\ |
47 |
+ self.settings["chroot_path"] |
48 |
+ else: |
49 |
+ unpack_cmd="tar xpf "+self.settings["source_path"]+" -C "+\ |
50 |
+ self.settings["chroot_path"] |
51 |
error_msg="Tarball extraction of "+self.settings["source_path"]+\ |
52 |
" to "+self.settings["chroot_path"]+" failed." |
53 |
|
54 |
@@ -758,7 +766,10 @@ class generic_stage_target(generic_target): |
55 |
read_from_clst(self.settings["snapshot_cache_path"]+\ |
56 |
"catalyst-hash") |
57 |
destdir=self.settings["snapshot_cache_path"] |
58 |
- unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+destdir |
59 |
+ if "bz2" == self.settings["chroot_path"][-3:]: |
60 |
+ unpack_cmd="tar -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+destdir |
61 |
+ else: |
62 |
+ unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+destdir |
63 |
unpack_errmsg="Error unpacking snapshot" |
64 |
cleanup_msg="Cleaning up invalid snapshot cache at \n\t"+\ |
65 |
self.settings["snapshot_cache_path"]+\ |
66 |
@@ -774,8 +785,12 @@ class generic_stage_target(generic_target): |
67 |
cleanup_errmsg="Error removing existing snapshot directory." |
68 |
cleanup_msg=\ |
69 |
"Cleaning up existing portage tree (This can take a long time)..." |
70 |
- unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+\ |
71 |
- self.settings["chroot_path"]+"/usr" |
72 |
+ if "bz2" == self.settings["chroot_path"][-3:]: |
73 |
+ unpack_cmd="tar -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+\ |
74 |
+ self.settings["chroot_path"]+"/usr" |
75 |
+ else: |
76 |
+ unpack_cmd="tar xpf "+self.settings["snapshot_path"]+" -C "+\ |
77 |
+ self.settings["chroot_path"]+"/usr" |
78 |
unpack_errmsg="Error unpacking snapshot" |
79 |
|
80 |
if self.settings.has_key("AUTORESUME") \ |
81 |
|
82 |
diff --git a/targets/support/functions.sh b/targets/support/functions.sh |
83 |
index d0737a6..d362ece 100644 |
84 |
--- a/targets/support/functions.sh |
85 |
+++ b/targets/support/functions.sh |
86 |
@@ -46,7 +46,7 @@ extract_cdtar() { |
87 |
# boot-loader/filesystem skeleton for the ISO. |
88 |
cdtar=${clst_cdtar} |
89 |
[ -z "${cdtar}" ] && die "Required key cdtar not defined, exiting" |
90 |
- tar xjpf ${cdtar} -C $1 || die "Couldn't extract cdtar ${cdtar}" |
91 |
+ tar -I lbzip2 -xpf ${cdtar} -C $1 || die "Couldn't extract cdtar ${cdtar}" |
92 |
} |
93 |
|
94 |
extract_kernels() { |
95 |
@@ -71,7 +71,7 @@ extract_kernels() { |
96 |
|
97 |
[ ! -e "${kbinary}" ] && die "Can't find kernel tarball at ${kbinary}" |
98 |
mkdir -p ${1}/ |
99 |
- tar xjf ${kbinary} -C ${1}/ |
100 |
+ tar -I lbzip2 -xf ${kbinary} -C ${1}/ |
101 |
|
102 |
# change config name from "config-*" to "gentoo", for example |
103 |
#mv ${1}/config-* ${1}/${x}-config |
104 |
@@ -115,7 +115,7 @@ extract_modules() { |
105 |
if [ -f "${kmodules}" ] |
106 |
then |
107 |
mkdir -p ${1}/ |
108 |
- tar xjf ${kmodules} --strip-components 1 -C ${1}/lib lib |
109 |
+ tar -I lbzip2 -xf ${kmodules} --strip-components 1 -C ${1}/lib lib |
110 |
else |
111 |
echo "Can't find kernel modules tarball at ${kmodules}. Skipping...." |
112 |
fi |
113 |
@@ -127,7 +127,7 @@ extract_kernel() { |
114 |
kbinary="${clst_chroot_path}/tmp/kerncache/${2}-kernel-initrd-${clst_version_stamp}.tar.bz2" |
115 |
[ ! -e "${kbinary}" ] && die "Can't find kernel tarball at ${kbinary}" |
116 |
mkdir -p ${1}/ |
117 |
- tar xjf ${kbinary} -C ${1}/ |
118 |
+ tar -I lbzip2 -xf ${kbinary} -C ${1}/ |
119 |
# change config name from "config-*" to "gentoo", for example |
120 |
#mv ${1}/config-* ${1}/${2}-config |
121 |
rm ${1}/config-* |
122 |
|
123 |
diff --git a/targets/support/livecdfs-update.sh b/targets/support/livecdfs-update.sh |
124 |
index 2b41bf6..2712556 100644 |
125 |
--- a/targets/support/livecdfs-update.sh |
126 |
+++ b/targets/support/livecdfs-update.sh |
127 |
@@ -227,7 +227,7 @@ fi |
128 |
if [ -n "$(ls /lib/firmware)" ] |
129 |
then |
130 |
cd /lib/firmware |
131 |
- /bin/tar cjpf /lib/firmware.tar.bz2 . |
132 |
+ /bin/tar -I lbzip2 -cpf /lib/firmware.tar.bz2 . |
133 |
rm -rf /lib/firmware/* |
134 |
fi |