Skip to content

Commit

Permalink
ARM: support XZ compressed kernels
Browse files Browse the repository at this point in the history
Wire up support for the XZ decompressor

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
Signed-off-by: Andika Edo <dhiika.px@gmail.com>
  • Loading branch information
faux123 authored and phiexz committed Apr 20, 2012
1 parent 2d144eb commit b1123e0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ config ARM
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_LZO
select HAVE_KERNEL_LZMA
select HAVE_KERNEL_XZ
select HAVE_PERF_EVENTS
select PERF_USE_VMALLOC
help
Expand Down
11 changes: 9 additions & 2 deletions arch/arm/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,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)
Expand Down Expand Up @@ -110,8 +111,14 @@ lib1funcs = $(obj)/lib1funcs.o
$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
$(call cmd,shipped)

# 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)
@:

Expand Down
4 changes: 4 additions & 0 deletions arch/arm/boot/compressed/decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ extern void error(char *);
#include "../../../../lib/decompress_unlzma.c"
#endif

#ifdef CONFIG_KERNEL_XZ
#include "../../../../lib/decompress_unxz.c"
#endif

void do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x))
{
decompress(input, len, NULL, NULL, output, NULL, error);
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/boot/compressed/piggy.xzkern.S
Original file line number Diff line number Diff line change
@@ -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:
1 change: 1 addition & 0 deletions lib/xz/xz_dec_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b1123e0

Please sign in to comment.