2
0

230-openwrt_lzma_options.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. --- a/scripts/Makefile.lib
  2. +++ b/scripts/Makefile.lib
  3. @@ -325,7 +325,7 @@ cmd_bzip2 = (cat $(filter-out FORCE,$^)
  4. quiet_cmd_lzma = LZMA $@
  5. cmd_lzma = (cat $(filter-out FORCE,$^) | \
  6. - lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
  7. + lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
  8. (rm -f $@ ; false)
  9. quiet_cmd_lzo = LZO $@
  10. --- a/scripts/gen_initramfs_list.sh
  11. +++ b/scripts/gen_initramfs_list.sh
  12. @@ -226,7 +226,7 @@ cpio_list=
  13. output="/dev/stdout"
  14. output_file=""
  15. is_cpio_compressed=
  16. -compr="gzip -n -9 -f"
  17. +compr="gzip -n -9 -f -"
  18. arg="$1"
  19. case "$arg" in
  20. @@ -242,13 +242,13 @@ case "$arg" in
  21. output=${cpio_list}
  22. echo "$output_file" | grep -q "\.gz$" \
  23. && [ -x "`which gzip 2> /dev/null`" ] \
  24. - && compr="gzip -n -9 -f"
  25. + && compr="gzip -n -9 -f -"
  26. echo "$output_file" | grep -q "\.bz2$" \
  27. && [ -x "`which bzip2 2> /dev/null`" ] \
  28. - && compr="bzip2 -9 -f"
  29. + && compr="bzip2 -9 -f -"
  30. echo "$output_file" | grep -q "\.lzma$" \
  31. && [ -x "`which lzma 2> /dev/null`" ] \
  32. - && compr="lzma -9 -f"
  33. + && compr="lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so"
  34. echo "$output_file" | grep -q "\.xz$" \
  35. && [ -x "`which xz 2> /dev/null`" ] \
  36. && compr="xz --check=crc32 --lzma2=dict=1MiB"
  37. @@ -315,7 +315,7 @@ if [ ! -z ${output_file} ]; then
  38. if [ "${is_cpio_compressed}" = "compressed" ]; then
  39. cat ${cpio_tfile} > ${output_file}
  40. else
  41. - (cat ${cpio_tfile} | ${compr} - > ${output_file}) \
  42. + (cat ${cpio_tfile} | ${compr} > ${output_file}) \
  43. || (rm -f ${output_file} ; false)
  44. fi
  45. [ -z ${cpio_file} ] && rm ${cpio_tfile}
  46. --- a/lib/decompress.c
  47. +++ b/lib/decompress.c
  48. @@ -48,6 +48,7 @@ static const struct compress_format comp
  49. { {037, 0236}, "gzip", gunzip },
  50. { {0x42, 0x5a}, "bzip2", bunzip2 },
  51. { {0x5d, 0x00}, "lzma", unlzma },
  52. + { {0x6d, 0x00}, "lzma-openwrt", unlzma },
  53. { {0xfd, 0x37}, "xz", unxz },
  54. { {0x89, 0x4c}, "lzo", unlzo },
  55. { {0x02, 0x21}, "lz4", unlz4 },