1 This patch allows using a kernel image compressed with LZMA on ARM.
2 Extracting the image is fairly slow, but it might be useful on machines
3 with a very limited amount of storage, as the size benefit is quite
5 Gzip: Data Size: 1586352 Bytes = 1549.17 kB = 1.51 MB
6 LZMA: Data Size: 2135916 Bytes = 2085.86 kB = 2.04 MB
8 Signed-off-by: Albin Tonnerre <albin.tonnerre <at> free-electrons.com>
9 Tested-by: Martin Michlmayr <tbm <at> cyrius.com>
11 v2: Updated to apply on top of 2.6.34-rc1
13 arch/arm/Kconfig | 1 +
14 arch/arm/boot/compressed/Makefile | 1 +
15 arch/arm/boot/compressed/decompress.c | 4 ++++
16 arch/arm/boot/compressed/piggy.lzma.S | 6 ++++++
17 4 files changed, 12 insertions(+), 0 deletions(-)
18 create mode 100644 arch/arm/boot/compressed/piggy.lzma.S
20 --- a/arch/arm/Kconfig
21 +++ b/arch/arm/Kconfig
22 @@ -21,6 +21,7 @@ config ARM
23 select HAVE_GENERIC_DMA_COHERENT
24 select HAVE_KERNEL_GZIP
25 select HAVE_KERNEL_LZO
26 + select HAVE_KERNEL_LZMA
27 select HAVE_PERF_EVENTS
28 select PERF_USE_VMALLOC
30 --- a/arch/arm/boot/compressed/Makefile
31 +++ b/arch/arm/boot/compressed/Makefile
32 @@ -65,6 +65,7 @@ SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/
34 suffix_$(CONFIG_KERNEL_GZIP) = gzip
35 suffix_$(CONFIG_KERNEL_LZO) = lzo
36 +suffix_$(CONFIG_KERNEL_LZMA) = lzma
38 targets := vmlinux vmlinux.lds \
39 piggy.$(suffix_y) piggy.$(suffix_y).o \
40 --- a/arch/arm/boot/compressed/decompress.c
41 +++ b/arch/arm/boot/compressed/decompress.c
42 @@ -40,6 +40,10 @@ extern void error(char *);
43 #include "../../../../lib/decompress_unlzo.c"
46 +#ifdef CONFIG_KERNEL_LZMA
47 +#include "../../../../lib/decompress_unlzma.c"
50 void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
52 decompress(input, len, NULL, NULL, output, NULL, error);
54 +++ b/arch/arm/boot/compressed/piggy.lzma.S
56 + .section .piggydata,#alloc
59 + .incbin "arch/arm/boot/compressed/piggy.lzma"
60 + .globl input_data_end