diff options
author | P J P <ppandit@redhat.com> | 2013-11-12 18:10:22 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:26 -0500 |
commit | 9ba4bcb645898d562498ea66a0df958ef0e7a68c (patch) | |
tree | 20befe80438adaec351eff0eb1f225d0b3df0963 /scripts | |
parent | ba24762bd53faaf39cc8b991175636954b7ef4be (diff) |
initramfs: read CONFIG_RD_ variables for initramfs compression
When expert configuration option(CONFIG_EXPERT) is enabled, menuconfig
offers a choice of compression algorithm to compress initial ramfs image;
This choice is stored into CONFIG_RD_* variables. But usr/Makefile uses
earlier INITRAMFS_COMPRESSION_* macros to build initial ramfs file. Since
none of them is defined, resulting 'initramfs_data.cpio' file remains
un-compressed.
This patch updates the Makefile to use CONFIG_RD_* variables and adds
support for LZ4 compression algorithm. Also updates the
'gen_initramfs_list.sh' script to check whether a selected compression
command is accessible or not. And fall-back to default gzip(1)
compression when it is not.
Signed-off-by: P J P <prasad@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/gen_initramfs_list.sh | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh index b482f162a18a..ef474098d9f1 100644 --- a/scripts/gen_initramfs_list.sh +++ b/scripts/gen_initramfs_list.sh | |||
@@ -240,12 +240,24 @@ case "$arg" in | |||
240 | output_file="$1" | 240 | output_file="$1" |
241 | cpio_list="$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)" | 241 | cpio_list="$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)" |
242 | output=${cpio_list} | 242 | output=${cpio_list} |
243 | echo "$output_file" | grep -q "\.gz$" && compr="gzip -n -9 -f" | 243 | echo "$output_file" | grep -q "\.gz$" \ |
244 | echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f" | 244 | && [ -x "`which gzip 2> /dev/null`" ] \ |
245 | echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f" | 245 | && compr="gzip -n -9 -f" |
246 | echo "$output_file" | grep -q "\.xz$" && \ | 246 | echo "$output_file" | grep -q "\.bz2$" \ |
247 | compr="xz --check=crc32 --lzma2=dict=1MiB" | 247 | && [ -x "`which bzip2 2> /dev/null`" ] \ |
248 | echo "$output_file" | grep -q "\.lzo$" && compr="lzop -9 -f" | 248 | && compr="bzip2 -9 -f" |
249 | echo "$output_file" | grep -q "\.lzma$" \ | ||
250 | && [ -x "`which lzma 2> /dev/null`" ] \ | ||
251 | && compr="lzma -9 -f" | ||
252 | echo "$output_file" | grep -q "\.xz$" \ | ||
253 | && [ -x "`which xz 2> /dev/null`" ] \ | ||
254 | && compr="xz --check=crc32 --lzma2=dict=1MiB" | ||
255 | echo "$output_file" | grep -q "\.lzo$" \ | ||
256 | && [ -x "`which lzop 2> /dev/null`" ] \ | ||
257 | && compr="lzop -9 -f" | ||
258 | echo "$output_file" | grep -q "\.lz4$" \ | ||
259 | && [ -x "`which lz4 2> /dev/null`" ] \ | ||
260 | && compr="lz4 -9 -f" | ||
249 | echo "$output_file" | grep -q "\.cpio$" && compr="cat" | 261 | echo "$output_file" | grep -q "\.cpio$" && compr="cat" |
250 | shift | 262 | shift |
251 | ;; | 263 | ;; |