]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
initramfs-read-config_rd_-variables-for-initramfs-compression-fix
authorP J P <ppandit@redhat.com>
Tue, 5 Nov 2013 05:57:04 +0000 (16:57 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 5 Nov 2013 05:57:04 +0000 (16:57 +1100)
I've patched 'gen_initramfs_list.sh' script to check if a selected
compression command is accessible or not; And fall-back to the default
gzip(1) format when it is not.  usr/Makefile also defaults to '.gz' format
when all are enabled.

Signed-off-by: P J P <prasad@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/gen_initramfs_list.sh
usr/Makefile

index 57619737568090b435d771ce951378113a969d90..2889a837c40a831837cad17d3b1e1a5b6bc4b412 100644 (file)
@@ -240,13 +240,18 @@ case "$arg" in
                output_file="$1"
                cpio_list="$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)"
                output=${cpio_list}
-               echo "$output_file" | grep -q "\.gz$" && compr="gzip -n -9 -f"
-               echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f"
-               echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f"
-               echo "$output_file" | grep -q "\.xz$" && \
-                               compr="xz --check=crc32 --lzma2=dict=1MiB"
-               echo "$output_file" | grep -q "\.lzo$" && compr="lzop -9 -f"
-               echo "$output_file" | grep -q "\.lz4$" && compr="lz4 -9 -f"
+               echo "$output_file" | grep -q "\.gz$" && [ -x "/bin/gzip" ] \
+                && compr="gzip -n -9 -f"
+               echo "$output_file" | grep -q "\.bz2$" && [ -x "/bin/bzip2" ] \
+                && compr="bzip2 -9 -f"
+               echo "$output_file" | grep -q "\.lzma$" && [ -x "/bin/lzma" ] \
+                && compr="lzma -9 -f"
+               echo "$output_file" | grep -q "\.xz$" && [ -x "/bin/xz" ] \
+                && compr="xz --check=crc32 --lzma2=dict=1MiB"
+               echo "$output_file" | grep -q "\.lzo$" && [ -x "/bin/lzop" ] \
+                && compr="lzop -9 -f"
+               echo "$output_file" | grep -q "\.lz4$" && [ -x "/bin/lz4" ] \
+                && compr="lz4 -9 -f"
                echo "$output_file" | grep -q "\.cpio$" && compr="cat"
                shift
                ;;
index 06ad94829b6ce604bed33c4b87a565edcaa4f969..e767f019accfa6a90374a270056739d09e93b920 100644 (file)
@@ -6,9 +6,6 @@ klibcdirs:;
 PHONY += klibcdirs
 
 
-# Gzip
-suffix_$(CONFIG_RD_GZIP)   = .gz
-
 # Bzip2
 suffix_$(CONFIG_RD_BZIP2)  = .bz2
 
@@ -24,6 +21,9 @@ suffix_$(CONFIG_RD_LZO)    = .lzo
 # Lz4
 suffix_$(CONFIG_RD_LZ4)    = .lz4
 
+# Gzip
+suffix_$(CONFIG_RD_GZIP)   = .gz
+
 AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/initramfs_data.cpio$(suffix_y)"
 
 # Generate builtin.o based on initramfs_data.o