Skip to contentSkip to conversation

ARM: Add support for LZMA-compressed kernel images

PATCH Superseded Albin Tonnerre 8 participants 13 messages Nov 20, 2009 – May 7, 2010 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: Add support for LZMA-compressed kernel images

This patch allows using a kernel image compressed with LZMA on ARM, using the support for multiple decompressors introduced in the LZO support patch.
Extracting the image is fairly slow, but it might be useful on machines with a very limited amount of storage.

---
 arch/arm/Kconfig                      |    1 +
 arch/arm/boot/compressed/Makefile     |    1 +
 arch/arm/boot/compressed/misc.c       |    4 ++++
 arch/arm/boot/compressed/piggy.lzma.S |    6 ++++++
 4 files changed, 12 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/compressed/piggy.lzma.S
arch/arm/Kconfig +1 -0
index 350921d..34163da 100644
@@ -20,6 +20,7 @@ config ARM
 	select HAVE_GENERIC_DMA_COHERENT
 	select HAVE_KERNEL_GZIP
 	select HAVE_KERNEL_LZO
+	select HAVE_KERNEL_LZMA
 	help
 	  The ARM series is a line of low-power-consumption RISC chip designs
 	  licensed by ARM Ltd and targeted at embedded applications and
arch/arm/boot/compressed/Makefile +1 -0
index 2d4d88b..3906432 100644
@@ -65,6 +65,7 @@ SEDFLAGS	= s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
 
 suffix_$(CONFIG_KERNEL_GZIP) = gzip
 suffix_$(CONFIG_KERNEL_LZO)  = lzo
+suffix_$(CONFIG_KERNEL_LZMA)  = lzma
 
 targets       := vmlinux vmlinux.lds \
 		 piggy.$(suffix_y) piggy.$(suffix_y).o \
arch/arm/boot/compressed/misc.c +4 -0
index 7e0fe4d..4e35a10 100644
@@ -237,6 +237,10 @@ static unsigned long free_mem_end_ptr;
 #include "../../../../lib/decompress_inflate.c"
 #endif
 
+#ifdef CONFIG_KERNEL_LZMA
+#include "../../../../lib/decompress_unlzma.c"
+#endif
+
 #ifdef CONFIG_KERNEL_LZO
 #include "../../../../lib/decompress_unlzo.c"
 #endif
arch/arm/boot/compressed/piggy.lzma.S new file +6 -0
new file mode 100644
index 0000000..d7e69cf
@@ -0,0 +1,6 @@
+	.section .piggydata,#alloc
+	.globl	input_data
+input_data:
+	.incbin	"arch/arm/boot/compressed/piggy.lzma"
+	.globl	input_data_end
+input_data_end:
Signature · 1 line
1.6.3.3
#1 lore raw
Quoted 5 lines · Albin Tonnerre

This patch allows using a kernel image compressed with LZMA on ARM, using the support for multiple decompressors introduced in the LZO support patch.
Extracting the image is fairly slow, but it might be useful on machines with a very limited amount of storage.

I didn't see a response to my previous message about the LZO patch set. Do you want me to queue up the patch set for the next merge window?

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
#2 lore raw
Quoted 9 lines · Russell King
Quoted 5 lines · Albin Tonnerre

This patch allows using a kernel image compressed with LZMA on ARM, using the support for multiple decompressors introduced in the LZO support patch.
Extracting the image is fairly slow, but it might be useful on machines with a very limited amount of storage.

I didn't see a response to my previous message about the LZO patch set. Do you want me to queue up the patch set for the next merge window?

Oh, sorry, I must have missed it. I would indeed appreciate this, thank you very much.

Regards,

Signature · 4 lines
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
#3 lore raw
Quoted 8 lines · Albin Tonnerre
Quoted 7 lines · Russell King
Quoted 5 lines · Albin Tonnerre

This patch allows using a kernel image compressed with LZMA on ARM, using the support for multiple decompressors introduced in the LZO support patch.
Extracting the image is fairly slow, but it might be useful on machines with a very limited amount of storage.

Quoted 5 lines
Quoted 2 lines

I didn't see a response to my previous message about the LZO patch set. Do you want me to queue up the patch set for the next merge window?

Oh, sorry, I must have missed it. I would indeed appreciate this, thank you very much.

Okay, the next question which needs to be asked of the wider audience is:

Since some of the patch set is not specific to ARM, does anyone have any objection to me pushing all four patches for the next merge window?

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
#4 lore raw
Quoted 12 lines · Russell King
Quoted 11 lines · Albin Tonnerre
Quoted 9 lines · Russell King
Quoted 5 lines · Albin Tonnerre

This patch allows using a kernel image compressed with LZMA on ARM, using the support for multiple decompressors introduced in the LZO support patch.
Extracting the image is fairly slow, but it might be useful on machines with a very limited amount of storage.

I didn't see a response to my previous message about the LZO patch set. Do you want me to queue up the patch set for the next merge window?

Quoted 7 lines
Quoted 2 lines

Oh, sorry, I must have missed it. I would indeed appreciate this, thank you very much.

Okay, the next question which needs to be asked of the wider audience is:

Since some of the patch set is not specific to ARM, does anyone have any objection to me pushing all four patches for the next merge window?

As there are no objections, are you still willing to push this series for this merge window?

Regards,

Signature · 4 lines
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
#5 lore raw

PATCH v2 1/1 ARM: Add support for LZMA-compressed kernel images

In reply to Albin Tonnerre

This patch allows using a kernel image compressed with LZMA on ARM. Extracting the image is fairly slow, but it might be useful on machines with a very limited amount of storage, as the size benefit is quite significant:
Gzip: Data Size: 1586352 Bytes = 1549.17 kB = 1.51 MB
LZMA: Data Size: 2135916 Bytes = 2085.86 kB = 2.04 MB

---
v2: Updated to apply on top of 2.6.34-rc1

 arch/arm/Kconfig                      |    1 +
 arch/arm/boot/compressed/Makefile     |    1 +
 arch/arm/boot/compressed/decompress.c |    4 ++++
 arch/arm/boot/compressed/piggy.lzma.S |    6 ++++++
 4 files changed, 12 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/compressed/piggy.lzma.S
arch/arm/Kconfig +1 -0
index 3b18128..3ebc7c3 100644
@@ -21,6 +21,7 @@ config ARM
 	select HAVE_GENERIC_DMA_COHERENT
 	select HAVE_KERNEL_GZIP
 	select HAVE_KERNEL_LZO
+	select HAVE_KERNEL_LZMA
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
 	help
arch/arm/boot/compressed/Makefile +1 -0
index 97c89e7..53faa90 100644
@@ -65,6 +65,7 @@ SEDFLAGS	= s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
 
 suffix_$(CONFIG_KERNEL_GZIP) = gzip
 suffix_$(CONFIG_KERNEL_LZO)  = lzo
+suffix_$(CONFIG_KERNEL_LZMA) = lzma
 
 targets       := vmlinux vmlinux.lds \
 		 piggy.$(suffix_y) piggy.$(suffix_y).o \
arch/arm/boot/compressed/decompress.c +4 -0
index 0da382f..d554df6 100644
@@ -39,6 +39,10 @@ extern void error(char *);
 #include "../../../../lib/decompress_unlzo.c"
 #endif
 
+#ifdef CONFIG_KERNEL_LZMA
+#include "../../../../lib/decompress_unlzma.c"
+#endif
+
 void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
 {
 	decompress(input, len, NULL, NULL, output, NULL, error);
arch/arm/boot/compressed/piggy.lzma.S new file +6 -0
new file mode 100644
index 0000000..d7e69cf
@@ -0,0 +1,6 @@
+	.section .piggydata,#alloc
+	.globl	input_data
+input_data:
+	.incbin	"arch/arm/boot/compressed/piggy.lzma"
+	.globl	input_data_end
+input_data_end:
Signature · 1 line
1.7.0
#6 lore raw

PATCH v2 1/1 ARM: Add support for LZMA-compressed kernel images

Quoted 6 lines · Albin Tonnerre

This patch allows using a kernel image compressed with LZMA on ARM. Extracting the image is fairly slow, but it might be useful on machines with a very limited amount of storage, as the size benefit is quite significant:
Gzip: Data Size: 1586352 Bytes = 1549.17 kB = 1.51 MB
LZMA: Data Size: 2135916 Bytes = 2085.86 kB = 2.04 MB

Meh. That should of course be:
LZMA ... 1.51MB
Gzip ... 2.04MB

Signature · 4 lines
Albin Tonnerre, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
#7 lore raw

PATCH v2 1/1 ARM: Add support for LZMA-compressed kernel images

In reply to Albin Tonnerre
Quoted 9 lines · Albin Tonnerre

This patch allows using a kernel image compressed with LZMA on ARM. Extracting the image is fairly slow, but it might be useful on machines with a very limited amount of storage, as the size benefit is quite significant:
Gzip: Data Size: 1586352 Bytes = 1549.17 kB = 1.51 MB
LZMA: Data Size: 2135916 Bytes = 2085.86 kB = 2.04 MB

You can add

I think you should submit this patch to Russell's patch system.

Quoted 61 lines

---
v2: Updated to apply on top of 2.6.34-rc1

  arch/arm/Kconfig                      |    1 +
  arch/arm/boot/compressed/Makefile     |    1 +
  arch/arm/boot/compressed/decompress.c |    4 ++++
  arch/arm/boot/compressed/piggy.lzma.S |    6 ++++++
  4 files changed, 12 insertions(+), 0 deletions(-)

create mode 100644 arch/arm/boot/compressed/piggy.lzma.S

arch/arm/Kconfig +1 -0
index 3b18128..3ebc7c3 100644
@@ -21,6 +21,7 @@ config ARM
  	select HAVE_GENERIC_DMA_COHERENT
  	select HAVE_KERNEL_GZIP
  	select HAVE_KERNEL_LZO
+	select HAVE_KERNEL_LZMA
  	select HAVE_PERF_EVENTS
  	select PERF_USE_VMALLOC
  	help
arch/arm/boot/compressed/Makefile +1 -0
index 97c89e7..53faa90 100644
@@ -65,6 +65,7 @@ SEDFLAGS	= s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
 
  suffix_$(CONFIG_KERNEL_GZIP) = gzip
  suffix_$(CONFIG_KERNEL_LZO)  = lzo
+suffix_$(CONFIG_KERNEL_LZMA) = lzma
 
  targets       := vmlinux vmlinux.lds \
  		 piggy.$(suffix_y) piggy.$(suffix_y).o \
arch/arm/boot/compressed/decompress.c +4 -0
index 0da382f..d554df6 100644
@@ -39,6 +39,10 @@ extern void error(char *);
  #include "../../../../lib/decompress_unlzo.c"
  #endif
 
+#ifdef CONFIG_KERNEL_LZMA
+#include "../../../../lib/decompress_unlzma.c"
+#endif
+
  void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
  {
  	decompress(input, len, NULL, NULL, output, NULL, error);
arch/arm/boot/compressed/piggy.lzma.S new file +6 -0
new file mode 100644
index 0000000..d7e69cf
@@ -0,0 +1,6 @@
+	.section .piggydata,#alloc
+	.globl	input_data
+input_data:
+	.incbin	"arch/arm/boot/compressed/piggy.lzma"
+	.globl	input_data_end
+input_data_end:
#8 lore raw

PATCH v2 1/1 ARM: Add support for LZMA-compressed kernel images

Quoted 81 lines · Paulius Zaleckas
Quoted 10 lines · Albin Tonnerre

This patch allows using a kernel image compressed with LZMA on ARM. Extracting the image is fairly slow, but it might be useful on machines with a very limited amount of storage, as the size benefit is quite significant:
Gzip: Data Size: ? ?1586352 Bytes = 1549.17 kB = 1.51 MB
LZMA: Data Size: ? ?2135916 Bytes = 2085.86 kB = 2.04 MB

You can add

I think you should submit this patch to Russell's patch system.

Quoted 64 lines

---
v2: Updated to apply on top of 2.6.34-rc1

?arch/arm/Kconfig ? ? ? ? ? ? ? ? ? ? ?| ? ?1 +
?arch/arm/boot/compressed/Makefile ? ? | ? ?1 +
?arch/arm/boot/compressed/decompress.c | ? ?4 ++++
?arch/arm/boot/compressed/piggy.lzma.S | ? ?6 ++++++

?4 files changed, 12 insertions(+), 0 deletions(-) ?create mode 100644 arch/arm/boot/compressed/piggy.lzma.S

arch/arm/Kconfig +0 -0
index 3b18128..3ebc7c3 100644
@@ -21,6 +21,7 @@ config ARM

? ? ? ?select HAVE_GENERIC_DMA_COHERENT
? ? ? ?select HAVE_KERNEL_GZIP
? ? ? ?select HAVE_KERNEL_LZO
+ ? ? ? select HAVE_KERNEL_LZMA
? ? ? ?select HAVE_PERF_EVENTS
? ? ? ?select PERF_USE_VMALLOC
? ? ? ?help

arch/arm/boot/compressed/Makefile +0 -0
index 97c89e7..53faa90 100644
@@ -65,6 +65,7 @@ SEDFLAGS ? ? ?=

s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/

?suffix_$(CONFIG_KERNEL_GZIP) = gzip
?suffix_$(CONFIG_KERNEL_LZO) ?= lzo
+suffix_$(CONFIG_KERNEL_LZMA) = lzma

?targets ? ? ? := vmlinux vmlinux.lds \
? ? ? ? ? ? ? ? piggy.$(suffix_y) piggy.$(suffix_y).o \

arch/arm/boot/compressed/decompress.c +0 -0
index 0da382f..d554df6 100644
@@ -39,6 +39,10 @@ extern void error(char *);

?#include "../../../../lib/decompress_unlzo.c"
?#endif

arch/arm/boot/compressed/decompress.c +4 -0
+#ifdef CONFIG_KERNEL_LZMA
+#include "../../../../lib/decompress_unlzma.c"
+#endif
+

?void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
?{
? ? ? ?decompress(input, len, NULL, NULL, output, NULL, error);

arch/arm/boot/compressed/piggy.lzma.S new file +4 -0
new file mode 100644
index 0000000..d7e69cf
@@ -0,0 +1,6 @@
+ ? ? ? .section .piggydata,#alloc
+ ? ? ? .globl ?input_data
+input_data:
+ ? ? ? .incbin "arch/arm/boot/compressed/piggy.lzma"
Quoted 9 lines

arch/arm/boot/compressed/piggy.lzma.S line 6

Quoted 2 lines
arch/arm/boot/compressed/piggy.lzma.S new file +2 -0
+ ? ? ? .globl ?input_data_end
+input_data_end:

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Any reason to further delay the LZMA adoption?
It will not be the fastest decompressor, but gives the smallest kernel size. Tested on various Zaurus models (pxa255, pxa270, armv4).

Regards

Andrea Adami

P.S. Fixes to .gitignore would need to be added for lzma.

#9 lore raw

PATCH v2 1/1 ARM: Add support for LZMA-compressed kernel images

Quoted 3 lines · Andrea Adami

Any reason to further delay the LZMA adoption?
It will not be the fastest decompressor, but gives the smallest kernel size. Tested on various Zaurus models (pxa255, pxa270, armv4).

It's in the devel branch of Russell's tree already, so it should find its way to mainline :)

Regards,
Albin

#10 lore raw

PATCH v2 1/1 ARM: Add support for LZMA-compressed kernel images

Quoted 8 lines · Albin Tonnerre
Quoted 3 lines · Andrea Adami

Any reason to further delay the LZMA adoption?
It will not be the fastest decompressor, but gives the smallest kernel size. Tested on various Zaurus models (pxa255, pxa270, armv4).

It's in the devel branch of Russell's tree already, so it should find its way to mainline :)

Tested on my zaurus, worked just out of the box. Thanks.

#11 lore raw

PATCH v2 1/1 ARM: Add support for LZMA-compressed kernel images

Quoted 11 lines · Eric Miao
Quoted 8 lines · Albin Tonnerre
Quoted 3 lines · Andrea Adami

Any reason to further delay the LZMA adoption?
It will not be the fastest decompressor, but gives the smallest kernel size. Tested on various Zaurus models (pxa255, pxa270, armv4).

It's in the devel branch of Russell's tree already, so it should find its way to mainline :)

Tested on my zaurus, worked just out of the box. Thanks.

And tested on a couple of OMAP3 boards too. Works great. Thanks!

#12 lore raw

PATCH v2 1/1 ARM: Add support for LZMA-compressed kernel images

In reply to Andrea Adami
Quoted 1 line · Andrea Adami

Any reason to further delay the LZMA adoption?

Only due process; it'll be merged when the next merge window opens.