linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: support XZ compressed kernels
@ 2011-07-07 10:19 Imre Kaloz
  2011-07-07 19:14 ` Nicolas Pitre
  2011-07-08 20:38 ` Russell King - ARM Linux
  0 siblings, 2 replies; 7+ messages in thread
From: Imre Kaloz @ 2011-07-07 10:19 UTC (permalink / raw)
  To: linux-arm-kernel

Wire up support for the XZ decompressor

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
---
 arch/arm/Kconfig                        |    1 +
 arch/arm/boot/compressed/Makefile       |   11 +++++++++--
 arch/arm/boot/compressed/decompress.c   |    4 ++++
 arch/arm/boot/compressed/piggy.xzkern.S |    6 ++++++
 lib/xz/xz_dec_stream.c                  |    1 +
 5 files changed, 21 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/boot/compressed/piggy.xzkern.S

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index c2e5f3d..489fe16 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -20,6 +20,7 @@ config ARM
 	select HAVE_KERNEL_GZIP
 	select HAVE_KERNEL_LZO
 	select HAVE_KERNEL_LZMA
+	select HAVE_KERNEL_XZ
 	select HAVE_IRQ_WORK
 	select HAVE_PERF_EVENTS
 	select PERF_USE_VMALLOC
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 23aad07..e5db34e 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -82,13 +82,14 @@ SEDFLAGS	= s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
 suffix_$(CONFIG_KERNEL_GZIP) = gzip
 suffix_$(CONFIG_KERNEL_LZO)  = lzo
 suffix_$(CONFIG_KERNEL_LZMA) = lzma
+suffix_$(CONFIG_KERNEL_XZ)   = xzkern
 
 targets       := vmlinux vmlinux.lds \
 		 piggy.$(suffix_y) piggy.$(suffix_y).o \
 		 font.o font.c head.o misc.o $(OBJS)
 
 # Make sure files are removed during clean
-extra-y       += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S
+extra-y       += piggy.gzip piggy.lzo piggy.lzma piggy.xzkern lib1funcs.S ashldi3.S
 
 ifeq ($(CONFIG_FUNCTION_TRACER),y)
 ORIG_CFLAGS := $(KBUILD_CFLAGS)
@@ -133,8 +134,14 @@ bad_syms=$$($(CROSS_COMPILE)nm $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \
   ( echo "following symbols must have non local/private scope:" >&2; \
     echo "$$bad_syms" >&2; rm -f $@; false )
 
+# For __aeabi_llsl
+ashldi3 = $(obj)/ashldi3.o
+
+$(obj)/ashldi3.S: $(srctree)/arch/$(SRCARCH)/lib/ashldi3.S FORCE
+	$(call cmd,shipped)
+
 $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \
-	 	$(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE
+	 	$(addprefix $(obj)/, $(OBJS)) $(lib1funcs) $(ashldi3) FORCE
 	$(call if_changed,ld)
 	@$(check_for_bad_syms)
 
diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
index 07be5a2..0ecd8b4 100644
--- a/arch/arm/boot/compressed/decompress.c
+++ b/arch/arm/boot/compressed/decompress.c
@@ -44,6 +44,10 @@ extern void error(char *);
 #include "../../../../lib/decompress_unlzma.c"
 #endif
 
+#ifdef CONFIG_KERNEL_XZ
+#include "../../../../lib/decompress_unxz.c"
+#endif
+
 int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
 {
 	return decompress(input, len, NULL, NULL, output, NULL, error);
diff --git a/arch/arm/boot/compressed/piggy.xzkern.S b/arch/arm/boot/compressed/piggy.xzkern.S
new file mode 100644
index 0000000..5703f30
--- /dev/null
+++ b/arch/arm/boot/compressed/piggy.xzkern.S
@@ -0,0 +1,6 @@
+	.section .piggydata,#alloc
+	.globl	input_data
+input_data:
+	.incbin	"arch/arm/boot/compressed/piggy.xzkern"
+	.globl	input_data_end
+input_data_end:
diff --git a/lib/xz/xz_dec_stream.c b/lib/xz/xz_dec_stream.c
index ac809b1..9a60cc2 100644
--- a/lib/xz/xz_dec_stream.c
+++ b/lib/xz/xz_dec_stream.c
@@ -9,6 +9,7 @@
 
 #include "xz_private.h"
 #include "xz_stream.h"
+#include <linux/kernel.h>
 
 /* Hash used to validate the Index field */
 struct xz_dec_hash {
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] ARM: support XZ compressed kernels
  2011-07-07 10:19 [PATCH] ARM: support XZ compressed kernels Imre Kaloz
@ 2011-07-07 19:14 ` Nicolas Pitre
  2011-07-08 18:50   ` Imre Kaloz
  2011-07-08 20:38 ` Russell King - ARM Linux
  1 sibling, 1 reply; 7+ messages in thread
From: Nicolas Pitre @ 2011-07-07 19:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 7 Jul 2011, Imre Kaloz wrote:

> Wire up support for the XZ decompressor
> 
> Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
> ---
>  arch/arm/Kconfig                        |    1 +
>  arch/arm/boot/compressed/Makefile       |   11 +++++++++--
>  arch/arm/boot/compressed/decompress.c   |    4 ++++
>  arch/arm/boot/compressed/piggy.xzkern.S |    6 ++++++
>  lib/xz/xz_dec_stream.c                  |    1 +
>  5 files changed, 21 insertions(+), 2 deletions(-)

Please don't forget to update arch/arm/boot/compressed/.gitignore


Nicolas

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: support XZ compressed kernels
  2011-07-07 19:14 ` Nicolas Pitre
@ 2011-07-08 18:50   ` Imre Kaloz
  0 siblings, 0 replies; 7+ messages in thread
From: Imre Kaloz @ 2011-07-08 18:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 07 Jul 2011 21:14:58 +0200, Nicolas Pitre <nico@fluxnic.net> wrote:

> On Thu, 7 Jul 2011, Imre Kaloz wrote:
>
>> Wire up support for the XZ decompressor
>>
>> Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
>> ---
>>  arch/arm/Kconfig                        |    1 +
>>  arch/arm/boot/compressed/Makefile       |   11 +++++++++--
>>  arch/arm/boot/compressed/decompress.c   |    4 ++++
>>  arch/arm/boot/compressed/piggy.xzkern.S |    6 ++++++
>>  lib/xz/xz_dec_stream.c                  |    1 +
>>  5 files changed, 21 insertions(+), 2 deletions(-)
>
> Please don't forget to update arch/arm/boot/compressed/.gitignore

Thanks, will do and resend if no other replies come in.


Imre

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: support XZ compressed kernels
  2011-07-07 10:19 [PATCH] ARM: support XZ compressed kernels Imre Kaloz
  2011-07-07 19:14 ` Nicolas Pitre
@ 2011-07-08 20:38 ` Russell King - ARM Linux
  2011-07-08 20:54   ` Imre Kaloz
  1 sibling, 1 reply; 7+ messages in thread
From: Russell King - ARM Linux @ 2011-07-08 20:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 07, 2011 at 12:19:59PM +0200, Imre Kaloz wrote:
>  # Make sure files are removed during clean
> -extra-y       += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S
> +extra-y       += piggy.gzip piggy.lzo piggy.lzma piggy.xzkern lib1funcs.S ashldi3.S

Is there a reason the suffix is xzkern rather than just xz ?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: support XZ compressed kernels
  2011-07-08 20:38 ` Russell King - ARM Linux
@ 2011-07-08 20:54   ` Imre Kaloz
  2011-07-08 21:04     ` Russell King - ARM Linux
  0 siblings, 1 reply; 7+ messages in thread
From: Imre Kaloz @ 2011-07-08 20:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 08 Jul 2011 22:38:32 +0200, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:

> On Thu, Jul 07, 2011 at 12:19:59PM +0200, Imre Kaloz wrote:
>>  # Make sure files are removed during clean
>> -extra-y       += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S
>> +extra-y       += piggy.gzip piggy.lzo piggy.lzma piggy.xzkern lib1funcs.S ashldi3.S
>
> Is there a reason the suffix is xzkern rather than just xz ?

We do "$(call if_changed,$(suffix_y))" and scripts/Makefile.lib uses cmd_xzkern. I think keeping the changes minimal worth more then having the proper suffix for a temporary file.


Imre

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: support XZ compressed kernels
  2011-07-08 20:54   ` Imre Kaloz
@ 2011-07-08 21:04     ` Russell King - ARM Linux
  2011-07-08 21:21       ` Imre Kaloz
  0 siblings, 1 reply; 7+ messages in thread
From: Russell King - ARM Linux @ 2011-07-08 21:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 08, 2011 at 10:54:29PM +0200, Imre Kaloz wrote:
> On Fri, 08 Jul 2011 22:38:32 +0200, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
>
>> On Thu, Jul 07, 2011 at 12:19:59PM +0200, Imre Kaloz wrote:
>>>  # Make sure files are removed during clean
>>> -extra-y       += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S
>>> +extra-y       += piggy.gzip piggy.lzo piggy.lzma piggy.xzkern lib1funcs.S ashldi3.S
>>
>> Is there a reason the suffix is xzkern rather than just xz ?
>
> We do "$(call if_changed,$(suffix_y))" and scripts/Makefile.lib
> uses cmd_xzkern. I think keeping the changes minimal worth more
> then having the proper suffix for a temporary file.

Hmm, that's unfortunate.  It seems that it may be a non-standard format
so I guess that's reasonable.  No further comments then.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] ARM: support XZ compressed kernels
  2011-07-08 21:04     ` Russell King - ARM Linux
@ 2011-07-08 21:21       ` Imre Kaloz
  0 siblings, 0 replies; 7+ messages in thread
From: Imre Kaloz @ 2011-07-08 21:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 08 Jul 2011 23:04:07 +0200, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:

> On Fri, Jul 08, 2011 at 10:54:29PM +0200, Imre Kaloz wrote:
>> On Fri, 08 Jul 2011 22:38:32 +0200, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
>>
>>> On Thu, Jul 07, 2011 at 12:19:59PM +0200, Imre Kaloz wrote:
>>>>  # Make sure files are removed during clean
>>>> -extra-y       += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S
>>>> +extra-y       += piggy.gzip piggy.lzo piggy.lzma piggy.xzkern lib1funcs.S ashldi3.S
>>>
>>> Is there a reason the suffix is xzkern rather than just xz ?
>>
>> We do "$(call if_changed,$(suffix_y))" and scripts/Makefile.lib
>> uses cmd_xzkern. I think keeping the changes minimal worth more
>> then having the proper suffix for a temporary file.
>
> Hmm, that's unfortunate.  It seems that it may be a non-standard format
> so I guess that's reasonable.  No further comments then.
>

Indeed. After the .gitignore modification, should I resend it here or it can go into the patch system?


Imre

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-07-08 21:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-07 10:19 [PATCH] ARM: support XZ compressed kernels Imre Kaloz
2011-07-07 19:14 ` Nicolas Pitre
2011-07-08 18:50   ` Imre Kaloz
2011-07-08 20:38 ` Russell King - ARM Linux
2011-07-08 20:54   ` Imre Kaloz
2011-07-08 21:04     ` Russell King - ARM Linux
2011-07-08 21:21       ` Imre Kaloz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).