Skip to content

Commit c7b16ef

Browse files
committed
sh: Add support for LZO-compressed kernels.
Plugs in LZO along with the others. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent 644755e commit c7b16ef

5 files changed

Lines changed: 26 additions & 8 deletions

File tree

‎arch/sh/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ config SUPERH
2222
select HAVE_KERNEL_GZIP
2323
select HAVE_KERNEL_BZIP2
2424
select HAVE_KERNEL_LZMA
25+
select HAVE_KERNEL_LZO
2526
select HAVE_SYSCALL_TRACEPOINTS
2627
select RTC_LIB
2728
select GENERIC_ATOMIC64

‎arch/sh/Makefile‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ endif
203203
libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y)
204204
libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y)
205205

206-
BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.srec uImage.bin \
207-
zImage vmlinux.srec romImage
206+
BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.lzo \
207+
uImage.srec uImage.bin zImage vmlinux.srec romImage
208208
PHONY += $(BOOT_TARGETS)
209209

210210
all: $(KBUILD_IMAGE)
@@ -231,4 +231,5 @@ define archhelp
231231
@echo '* uImage.gz - Kernel-only image for U-Boot (gzip)'
232232
@echo ' uImage.bz2 - Kernel-only image for U-Boot (bzip2)'
233233
@echo ' uImage.lzma - Kernel-only image for U-Boot (lzma)'
234+
@echo ' uImage.lzo - Kernel-only image for U-Boot (lzo)'
234235
endef

‎arch/sh/boot/Makefile‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@ CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000
2121
CONFIG_ENTRY_OFFSET ?= 0x00001000
2222

2323
suffix-y := bin
24-
suffix-$(CONFIG_KERNEL_GZIP) := gz
25-
suffix-$(CONFIG_KERNEL_BZIP2) := bz2
26-
suffix-$(CONFIG_KERNEL_LZMA) := lzma
27-
28-
targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz uImage.bz2 uImage.lzma uImage.bin
29-
extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma
24+
suffix-$(CONFIG_KERNEL_GZIP) := gz
25+
suffix-$(CONFIG_KERNEL_BZIP2) := bz2
26+
suffix-$(CONFIG_KERNEL_LZMA) := lzma
27+
suffix-$(CONFIG_KERNEL_LZO) := lzo
28+
29+
targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \
30+
uImage.bz2 uImage.lzma uImage.lzo uImage.bin
31+
extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
32+
vmlinux.bin.lzo
3033
subdir- := compressed romimage
3134

3235
$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
@@ -80,6 +83,9 @@ $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
8083
$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
8184
$(call if_changed,lzma)
8285

86+
$(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE
87+
$(call if_changed,lzo)
88+
8389
$(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2
8490
$(call if_changed,uimage,bzip2)
8591

@@ -89,6 +95,9 @@ $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz
8995
$(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma
9096
$(call if_changed,uimage,lzma)
9197

98+
$(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo
99+
$(call if_changed,uimage,lzo)
100+
92101
$(obj)/uImage.bin: $(obj)/vmlinux.bin
93102
$(call if_changed,uimage,none)
94103

‎arch/sh/boot/compressed/Makefile‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
targets := vmlinux vmlinux.bin vmlinux.bin.gz \
88
vmlinux.bin.bz2 vmlinux.bin.lzma \
9+
vmlinux.bin.lzo \
910
head_$(BITS).o misc.o piggy.o
1011

1112
OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o
@@ -47,6 +48,8 @@ $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
4748
$(call if_changed,bzip2)
4849
$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
4950
$(call if_changed,lzma)
51+
$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
52+
$(call if_changed,lzo)
5053

5154
OBJCOPYFLAGS += -R .empty_zero_page
5255

‎arch/sh/boot/compressed/misc.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ static unsigned long free_mem_end_ptr;
6262
#include "../../../../lib/decompress_unlzma.c"
6363
#endif
6464

65+
#ifdef CONFIG_KERNEL_LZO
66+
#include "../../../../lib/decompress_unlzo.c"
67+
#endif
68+
6569
#ifdef CONFIG_SH_STANDARD_BIOS
6670
size_t strlen(const char *s)
6771
{

0 commit comments

Comments
 (0)