--- old/splashutils-1.5.4.4/scripts/splash_geninitramfs.in 2013-01-19 11:29:55.000000000 +0100 +++ new/splashutils-1.5.4.4/scripts/splash_geninitramfs.in 2013-01-19 21:12:57.280804898 +0100 @@ -29,6 +29,7 @@ -c, --copy=DIR copy all necessary files into the specified directory; DIR should point to the root directory of an initramfs -o, --overlay=DIR include the contents of DIR in the initramfs image + -z, --compress=ZIP use compression method ZIP (either of gzip, bzip2, xz) -h, --help show this help message Options: @@ -62,6 +63,7 @@ themedir="//etc/splash" declare -a themes +compress=$(type -p gzip) mode="h" splash_hlp="//sbin/fbcondecor_helper" res="" @@ -71,7 +73,7 @@ no8bpp=0 args="$@" -temp=`getopt -l no8bpp,all,generate:,append:,copy:,overlay:,help,verbose,res: a:g:c:r:o:hv "$@"` +temp=`getopt -l no8bpp,all,generate:,append:,copy:,overlay:,help,verbose,res:,compress: a:g:c:r:o:z:hv "$@"` if [ $? != 0 ]; then usage; exit 2 @@ -81,15 +83,20 @@ for i ; do case "$i" in - -a|--append) mode='a'; img="$2"; shift; shift;; - -g|--generate) mode='g'; img="$2"; shift; shift;; - -c|--copy) mode='c'; destdir="$2"; shift; shift;; - -h|--help) usage; exit 2;; - -r|--res) res=${2/,/ }; shift; shift;; + -a|--append) mode='a'; img="$2"; shift 2;; + -g|--generate) mode='g'; img="$2"; shift 2;; + -c|--copy) mode='c'; destdir="$2"; shift 2;; + -h|--help) usage; exit 2;; + -r|--res) res=${2/,/ }; shift 2;; -v|--verbose) verbose=$(($verbose + 1)); shift;; - -o|--overlay) overlay="$2"; shift; shift;; - --no8bpp) no8bpp=1; shift;; - --) shift; break;; + -o|--overlay) overlay="$2"; shift 2;; + -z|--compress) case "$2" in + xz|bzip2|gzip) compress=$(type -p $2) || \ + (echo "Compression type $2 not available." && exit 6);; + *) echo "Unsupported compression type $2."; exit 7;; + esac; shift 2;; + --no8bpp) no8bpp=1; shift;; + --) shift; break;; --all) shift; for i in ${themedir}/* ; do @@ -144,7 +151,7 @@ if [ "$mode" == "a" ]; then printv "o Unpacking $img.." cp "$img" "${imgdir}" - (cd "${imgdir}"; (gunzip -c "$(basename $img)" 2>/dev/null || cat "$(basename $img)") | cpio -idm --no-absolute-filenames --quiet -H newc) + (cd "${imgdir}"; ($compress -dc "$(basename $img)" 2>/dev/null || cat "$(basename $img)") | cpio -idm --no-absolute-filenames --quiet -H newc) rm -f "${imgdir}/$(basename $img)" fi @@ -234,7 +241,7 @@ printv "o Creating initramfs image.." if [ "$mode" == "g" ] || [ "$mode" == "a" ]; then - (cd "${imgdir}" ; find . | cpio --quiet -o -H newc | gzip -9 >../img.cpio.gz) + (cd "${imgdir}" ; find . | cpio --quiet -o -H newc | $compress -9 >../img.cpio.gz) && \ mv "${workdir}/img.cpio.gz" "${img}" fi