1 --- a/scripts/Makefile.lib
2 +++ b/scripts/Makefile.lib
3 @@ -254,7 +254,7 @@ cmd_bzip2 = (cat $(filter-out FORCE,$^)
5 quiet_cmd_lzma = LZMA $@
6 cmd_lzma = (cat $(filter-out FORCE,$^) | \
7 - lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
8 + lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
11 quiet_cmd_lzo = LZO $@
12 --- a/scripts/gen_initramfs_list.sh
13 +++ b/scripts/gen_initramfs_list.sh
14 @@ -226,7 +226,7 @@ cpio_list=
23 @@ -240,9 +240,9 @@ case "$arg" in
25 cpio_list="$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)"
27 - echo "$output_file" | grep -q "\.gz$" && compr="gzip -9 -f"
28 - echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f"
29 - echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f"
30 + echo "$output_file" | grep -q "\.gz$" && compr="gzip -9 -f -"
31 + echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f -"
32 + echo "$output_file" | grep -q "\.lzma$" && compr="lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so"
33 echo "$output_file" | grep -q "\.xz$" && \
34 compr="xz --check=crc32 --lzma2=dict=1MiB"
35 echo "$output_file" | grep -q "\.lzo$" && compr="lzop -9 -f"
36 @@ -296,7 +296,7 @@ if [ ! -z ${output_file} ]; then
37 if [ "${is_cpio_compressed}" = "compressed" ]; then
38 cat ${cpio_tfile} > ${output_file}
40 - (cat ${cpio_tfile} | ${compr} - > ${output_file}) \
41 + (cat ${cpio_tfile} | ${compr} > ${output_file}) \
42 || (rm -f ${output_file} ; false)
44 [ -z ${cpio_file} ] && rm ${cpio_tfile}
45 --- a/lib/decompress.c
46 +++ b/lib/decompress.c
47 @@ -40,6 +40,7 @@ static const struct compress_format {
48 { {037, 0236}, "gzip", gunzip },
49 { {0x42, 0x5a}, "bzip2", bunzip2 },
50 { {0x5d, 0x00}, "lzma", unlzma },
51 + { {0x6d, 0x00}, "lzma-openwrt", unlzma },
52 { {0xfd, 0x37}, "xz", unxz },
53 { {0x89, 0x4c}, "lzo", unlzo },
54 { {0, 0}, NULL, NULL }