Lines 36-41
Link Here
|
36 |
comma-separated list of the resolutions for which the images |
36 |
comma-separated list of the resolutions for which the images |
37 |
are to be copied |
37 |
are to be copied |
38 |
-v, --verbose verbose output |
38 |
-v, --verbose verbose output |
|
|
39 |
--bzip2 use 'bzip2' compressor (gzip default) |
40 |
--lzma use 'lzma' compressor (gzip default) |
41 |
--xz use 'xz' compressor (gzip default) |
42 |
--lzo use 'lzop' compressor (gzip default) |
39 |
--no8bpp ignore 8bpp images (can save a lot of space) |
43 |
--no8bpp ignore 8bpp images (can save a lot of space) |
40 |
EOTB |
44 |
EOTB |
41 |
|
45 |
|
Lines 69-77
Link Here
|
69 |
verbose=0 |
73 |
verbose=0 |
70 |
index=0 |
74 |
index=0 |
71 |
no8bpp=0 |
75 |
no8bpp=0 |
|
|
76 |
compressor="gzip" |
72 |
|
77 |
|
73 |
args="$@" |
78 |
args="$@" |
74 |
temp=`getopt -l no8bpp,all,generate:,append:,copy:,overlay:,help,verbose,res: a:g:c:r:o:hv "$@"` |
79 |
temp=`getopt -l bzip2,lzma,xz,lzo,no8bpp,all,generate:,append:,copy:,overlay:,help,verbose,res: a:g:c:r:o:hv "$@"` |
75 |
|
80 |
|
76 |
if [ $? != 0 ]; then |
81 |
if [ $? != 0 ]; then |
77 |
usage; exit 2 |
82 |
usage; exit 2 |
Lines 89-94
Link Here
|
89 |
-v|--verbose) verbose=$(($verbose + 1)); shift;; |
94 |
-v|--verbose) verbose=$(($verbose + 1)); shift;; |
90 |
-o|--overlay) overlay="$2"; shift; shift;; |
95 |
-o|--overlay) overlay="$2"; shift; shift;; |
91 |
--no8bpp) no8bpp=1; shift;; |
96 |
--no8bpp) no8bpp=1; shift;; |
|
|
97 |
--bzip2) compressor="bzip2"; shift;; |
98 |
--lzma) compressor="lzma"; shift;; |
99 |
--xz) compressor="xz"; shift;; |
100 |
--lzo) compressor="lzop"; shift;; |
92 |
--) shift; break;; |
101 |
--) shift; break;; |
93 |
--all) |
102 |
--all) |
94 |
shift; |
103 |
shift; |
Lines 144-150
Link Here
|
144 |
if [ "$mode" == "a" ]; then |
153 |
if [ "$mode" == "a" ]; then |
145 |
printv "o Unpacking $img.." |
154 |
printv "o Unpacking $img.." |
146 |
cp "$img" "${imgdir}" |
155 |
cp "$img" "${imgdir}" |
147 |
(cd "${imgdir}"; (gunzip -c "$(basename $img)" 2>/dev/null || cat "$(basename $img)") | cpio -idm --no-absolute-filenames --quiet -H newc) |
156 |
(cd "${imgdir}"; ("${compressor}" -dc "$(basename $img)" 2>/dev/null || cat "$(basename $img)") | cpio -idm --no-absolute-filenames --quiet -H newc) |
148 |
rm -f "${imgdir}/$(basename $img)" |
157 |
rm -f "${imgdir}/$(basename $img)" |
149 |
fi |
158 |
fi |
150 |
|
159 |
|
Lines 234-241
Link Here
|
234 |
|
243 |
|
235 |
printv "o Creating initramfs image.." |
244 |
printv "o Creating initramfs image.." |
236 |
if [ "$mode" == "g" ] || [ "$mode" == "a" ]; then |
245 |
if [ "$mode" == "g" ] || [ "$mode" == "a" ]; then |
237 |
(cd "${imgdir}" ; find . | cpio --quiet -o -H newc | gzip -9 >../img.cpio.gz) |
246 |
(cd "${imgdir}" ; find . | cpio --quiet -o -H newc | "${compressor}" -9 >../img.temp) |
238 |
mv "${workdir}/img.cpio.gz" "${img}" |
247 |
mv "${workdir}/img.temp" "${img}" |
239 |
fi |
248 |
fi |
240 |
|
249 |
|
241 |
exit 0 |
250 |
exit 0 |