diff options
author | bert schulze <spambemyguest@googlemail.com> | 2010-02-28 20:15:47 +0100 |
---|---|---|
committer | maximilian attems <maks@debian.org> | 2010-04-04 05:50:34 +0200 |
commit | 38c90c536d96982ada4017d00da3878f87e7300e (patch) | |
tree | 64ba158fd3827229f8dc4ce24a033395d6e7f1c2 /mkinitramfs | |
parent | 9d6567169ea95ffad8a3c9a95218851821d147b8 (diff) | |
download | initramfs-tools-38c90c536d96982ada4017d00da3878f87e7300e.tar.gz initramfs-tools-38c90c536d96982ada4017d00da3878f87e7300e.zip |
initramfs-tools: support different compression tools in mkinitramfs
this version uses /etc/initramfs-tools/initramfs.conf to determine
the compression method, checks kernel and userspace support with
fallback to gzip. Since LZO didnt work for me at all with 2.6.33
I left that out for now.
(closes: #533903)
[ minor changes in mkinitramfs code ]
Signed-off-by: maximilian attems <maks@debian.org>
Diffstat (limited to 'mkinitramfs')
-rwxr-xr-x | mkinitramfs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/mkinitramfs b/mkinitramfs index 877dfb4..33ef99b 100755 --- a/mkinitramfs +++ b/mkinitramfs @@ -123,6 +123,20 @@ case "${version}" in ;; esac +# Check userspace and kernel support for compressed initramfs images +compress=${COMPRESS} +if command -v ${compress} >/dev/null 2>&1; then + compress=gzip + [ "${verbose}" = y ] && \ + echo "No ${COMPRESS} in ${PATH}, using gzip" +fi + +if ! `grep -q -i config_rd_${COMPRESS}=y /boot/config-${version}` ; then + compress=gzip + [ "${verbose}" = y ] && \ + echo "linux-2.6 misses ${COMPRESS} support, using gzip" +fi + if [ -d "${outfile}" ]; then echo "${outfile} is a directory" exit 1 @@ -273,7 +287,7 @@ eval ` find . 4>&-; echo "ec1=$?;" >&4 } | { cpio --quiet --dereference -o -H newc 4>&-; echo "ec2=$?;" >&4 - } | gzip >"${outfile}" + } | ${compress} >"${outfile}" echo "ec3=$?;" >&4 ` if [ "$ec1" -ne 0 ]; then exit "$ec1"; fi |