diff options
author | Waldemar Brodkorb <mail@waldemar-brodkorb.de> | 2012-06-02 21:10:03 +0200 |
---|---|---|
committer | Waldemar Brodkorb <mail@waldemar-brodkorb.de> | 2012-06-02 21:10:03 +0200 |
commit | 84a9217d0abc6b985f45bf8a1df99f7ccae233cf (patch) | |
tree | 22c24b7bf57bc405d8bd7f5c5d368813f24a1187 | |
parent | c59b0aa3dd7146a737ed26ce517a7a65beec38e3 (diff) |
make XZ working for old kernel
-rw-r--r-- | package/busybox/Config.in.manual | 1 | ||||
-rw-r--r-- | target/linux/patches/2.6.39.4/brcm.patch | 90 |
2 files changed, 78 insertions, 13 deletions
diff --git a/package/busybox/Config.in.manual b/package/busybox/Config.in.manual index 467262595..a26169686 100644 --- a/package/busybox/Config.in.manual +++ b/package/busybox/Config.in.manual @@ -9,6 +9,7 @@ config ADK_PACKAGE_BUSYBOX select ADK_COMPILE_BUSYBOX default y if !ADK_TOOLCHAIN_ONLY select ADK_PACKAGE_LIBTIRPC + select ADK_PACKAGE_LIBPTHREAD help Core utilities for embedded Linux systems diff --git a/target/linux/patches/2.6.39.4/brcm.patch b/target/linux/patches/2.6.39.4/brcm.patch index 87f30da1d..548d26068 100644 --- a/target/linux/patches/2.6.39.4/brcm.patch +++ b/target/linux/patches/2.6.39.4/brcm.patch @@ -1,6 +1,6 @@ diff -Nur linux-2.6.39.4.orig/arch/mips/Kconfig linux-2.6.39.4/arch/mips/Kconfig --- linux-2.6.39.4.orig/arch/mips/Kconfig 2011-08-03 21:43:28.000000000 +0200 -+++ linux-2.6.39.4/arch/mips/Kconfig 2012-01-17 20:37:12.000000000 +0100 ++++ linux-2.6.39.4/arch/mips/Kconfig 2012-06-02 20:35:49.000000000 +0200 @@ -103,6 +103,12 @@ select GENERIC_GPIO select SYS_HAS_EARLY_PRINTK @@ -16,7 +16,7 @@ diff -Nur linux-2.6.39.4.orig/arch/mips/Kconfig linux-2.6.39.4/arch/mips/Kconfig diff -Nur linux-2.6.39.4.orig/arch/mips/Makefile linux-2.6.39.4/arch/mips/Makefile --- linux-2.6.39.4.orig/arch/mips/Makefile 2011-08-03 21:43:28.000000000 +0200 -+++ linux-2.6.39.4/arch/mips/Makefile 2012-01-17 20:35:09.000000000 +0100 ++++ linux-2.6.39.4/arch/mips/Makefile 2012-06-02 20:35:49.000000000 +0200 @@ -76,6 +76,7 @@ all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32) all-$(CONFIG_BOOT_ELF64) := $(vmlinux-64) @@ -44,7 +44,7 @@ diff -Nur linux-2.6.39.4.orig/arch/mips/Makefile linux-2.6.39.4/arch/mips/Makefi endef diff -Nur linux-2.6.39.4.orig/arch/mips/bcm47xx/Makefile linux-2.6.39.4/arch/mips/bcm47xx/Makefile --- linux-2.6.39.4.orig/arch/mips/bcm47xx/Makefile 2011-08-03 21:43:28.000000000 +0200 -+++ linux-2.6.39.4/arch/mips/bcm47xx/Makefile 2012-01-17 20:35:09.000000000 +0100 ++++ linux-2.6.39.4/arch/mips/bcm47xx/Makefile 2012-06-02 20:35:49.000000000 +0200 @@ -3,4 +3,4 @@ # under Linux. # @@ -53,7 +53,7 @@ diff -Nur linux-2.6.39.4.orig/arch/mips/bcm47xx/Makefile linux-2.6.39.4/arch/mip +obj-y := gpio.o irq.o nvram.o prom.o serial.o setup.o time.o platform.o diff -Nur linux-2.6.39.4.orig/arch/mips/bcm47xx/platform.c linux-2.6.39.4/arch/mips/bcm47xx/platform.c --- linux-2.6.39.4.orig/arch/mips/bcm47xx/platform.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.39.4/arch/mips/bcm47xx/platform.c 2012-01-17 20:35:09.000000000 +0100 ++++ linux-2.6.39.4/arch/mips/bcm47xx/platform.c 2012-06-02 20:35:49.000000000 +0200 @@ -0,0 +1,146 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public @@ -203,8 +203,16 @@ diff -Nur linux-2.6.39.4.orig/arch/mips/bcm47xx/platform.c linux-2.6.39.4/arch/m +device_initcall(bcm47xx_register_devices); diff -Nur linux-2.6.39.4.orig/arch/mips/boot/compressed/Makefile linux-2.6.39.4/arch/mips/boot/compressed/Makefile --- linux-2.6.39.4.orig/arch/mips/boot/compressed/Makefile 2011-08-03 21:43:28.000000000 +0200 -+++ linux-2.6.39.4/arch/mips/boot/compressed/Makefile 2012-01-17 20:35:09.000000000 +0100 -@@ -58,8 +58,13 @@ ++++ linux-2.6.39.4/arch/mips/boot/compressed/Makefile 2012-06-02 20:37:43.000000000 +0200 +@@ -44,6 +44,7 @@ + tool_$(CONFIG_KERNEL_BZIP2) = bzip2 + tool_$(CONFIG_KERNEL_LZMA) = lzma + tool_$(CONFIG_KERNEL_LZO) = lzo ++tool_$(CONFIG_KERNEL_XZ) = xzkern + + targets += vmlinux.bin.z + $(obj)/vmlinux.bin.z: $(obj)/vmlinux.bin FORCE +@@ -58,8 +59,13 @@ # Calculate the load address of the compressed kernel image hostprogs-y := calc_vmlinuz_load_addr @@ -218,7 +226,7 @@ diff -Nur linux-2.6.39.4.orig/arch/mips/boot/compressed/Makefile linux-2.6.39.4/ vmlinuzobjs-y += $(obj)/piggy.o -@@ -105,4 +110,12 @@ +@@ -105,4 +111,12 @@ vmlinuz.srec: vmlinuz $(call cmd,objcopy) @@ -232,9 +240,41 @@ diff -Nur linux-2.6.39.4.orig/arch/mips/boot/compressed/Makefile linux-2.6.39.4/ + $(LD) $(LDFLAGS) -T arch/mips/boot/compressed/selfreloc.lds arch/mips/boot/compressed/selfreloc.o -o $@ + +clean-files := $(objtree)/vmlinuz $(objtree)/vmlinuz.{32,ecoff,bin,srec,elf} $(objtree)/arch/mips/boot/compressed/selfreloc.{o,lds} +diff -Nur linux-2.6.39.4.orig/arch/mips/boot/compressed/decompress.c linux-2.6.39.4/arch/mips/boot/compressed/decompress.c +--- linux-2.6.39.4.orig/arch/mips/boot/compressed/decompress.c 2011-08-03 21:43:28.000000000 +0200 ++++ linux-2.6.39.4/arch/mips/boot/compressed/decompress.c 2012-06-02 20:39:09.000000000 +0200 +@@ -43,7 +43,7 @@ + /* activate the code for pre-boot environment */ + #define STATIC static + +-#ifdef CONFIG_KERNEL_GZIP ++#if defined(CONFIG_KERNEL_GZIP) || defined(CONFIG_KERNEL_XZ) + void *memcpy(void *dest, const void *src, size_t n) + { + int i; +@@ -54,6 +54,8 @@ + d[i] = s[i]; + return dest; + } ++#endif ++#ifdef CONFIG_KERNEL_GZIP + #include "../../../../lib/decompress_inflate.c" + #endif + +@@ -78,6 +80,10 @@ + #include "../../../../lib/decompress_unlzo.c" + #endif + ++#ifdef CONFIG_KERNEL_XZ ++#include "../../../../lib/decompress_unxz.c" ++#endif ++ + void decompress_kernel(unsigned long boot_heap_start) + { + unsigned long zimage_start, zimage_size; diff -Nur linux-2.6.39.4.orig/arch/mips/boot/compressed/selfreloc.S linux-2.6.39.4/arch/mips/boot/compressed/selfreloc.S --- linux-2.6.39.4.orig/arch/mips/boot/compressed/selfreloc.S 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.39.4/arch/mips/boot/compressed/selfreloc.S 2012-01-17 20:35:09.000000000 +0100 ++++ linux-2.6.39.4/arch/mips/boot/compressed/selfreloc.S 2012-06-02 20:35:49.000000000 +0200 @@ -0,0 +1,54 @@ +/*- + * written 2011 by Thorsten Glaser <tg@freewrt.org> based on @@ -292,7 +332,7 @@ diff -Nur linux-2.6.39.4.orig/arch/mips/boot/compressed/selfreloc.S linux-2.6.39 +imgend: diff -Nur linux-2.6.39.4.orig/arch/mips/boot/compressed/selfreloc.lds.S linux-2.6.39.4/arch/mips/boot/compressed/selfreloc.lds.S --- linux-2.6.39.4.orig/arch/mips/boot/compressed/selfreloc.lds.S 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.39.4/arch/mips/boot/compressed/selfreloc.lds.S 2012-01-17 20:35:09.000000000 +0100 ++++ linux-2.6.39.4/arch/mips/boot/compressed/selfreloc.lds.S 2012-06-02 20:35:49.000000000 +0200 @@ -0,0 +1,39 @@ +/*- + * written 2010 by Thorsten Glaser <tg@debian.org> based on @@ -335,7 +375,7 @@ diff -Nur linux-2.6.39.4.orig/arch/mips/boot/compressed/selfreloc.lds.S linux-2. +} diff -Nur linux-2.6.39.4.orig/arch/mips/boot/compressed/uart-16550.c linux-2.6.39.4/arch/mips/boot/compressed/uart-16550.c --- linux-2.6.39.4.orig/arch/mips/boot/compressed/uart-16550.c 2011-08-03 21:43:28.000000000 +0200 -+++ linux-2.6.39.4/arch/mips/boot/compressed/uart-16550.c 2012-01-17 20:35:09.000000000 +0100 ++++ linux-2.6.39.4/arch/mips/boot/compressed/uart-16550.c 2012-06-02 20:35:49.000000000 +0200 @@ -18,6 +18,11 @@ #define PORT(offset) (CKSEG1ADDR(AR7_REGS_UART0) + (4 * offset)) #endif @@ -350,7 +390,7 @@ diff -Nur linux-2.6.39.4.orig/arch/mips/boot/compressed/uart-16550.c linux-2.6.3 #endif diff -Nur linux-2.6.39.4.orig/drivers/ssb/driver_mipscore.c linux-2.6.39.4/drivers/ssb/driver_mipscore.c --- linux-2.6.39.4.orig/drivers/ssb/driver_mipscore.c 2011-08-03 21:43:28.000000000 +0200 -+++ linux-2.6.39.4/drivers/ssb/driver_mipscore.c 2012-01-17 20:35:09.000000000 +0100 ++++ linux-2.6.39.4/drivers/ssb/driver_mipscore.c 2012-06-02 20:35:49.000000000 +0200 @@ -190,10 +190,11 @@ { struct ssb_bus *bus = mcore->dev->bus; @@ -366,7 +406,7 @@ diff -Nur linux-2.6.39.4.orig/drivers/ssb/driver_mipscore.c linux-2.6.39.4/drive mcore->flash_buswidth = 1; diff -Nur linux-2.6.39.4.orig/init/Kconfig linux-2.6.39.4/init/Kconfig --- linux-2.6.39.4.orig/init/Kconfig 2011-08-03 21:43:28.000000000 +0200 -+++ linux-2.6.39.4/init/Kconfig 2012-01-17 20:35:09.000000000 +0100 ++++ linux-2.6.39.4/init/Kconfig 2012-06-02 20:36:11.000000000 +0200 @@ -156,6 +156,7 @@ config KERNEL_GZIP bool "Gzip" @@ -391,7 +431,15 @@ diff -Nur linux-2.6.39.4.orig/init/Kconfig linux-2.6.39.4/init/Kconfig help The most recent compression algorithm. Its ratio is best, decompression speed is between the other -@@ -197,6 +200,7 @@ +@@ -182,6 +185,7 @@ + config KERNEL_XZ + bool "XZ" + depends on HAVE_KERNEL_XZ ++ select DECOMPRESS_XZ + help + XZ uses the LZMA2 algorithm and instruction set specific + BCJ filters which can improve compression ratio of executable +@@ -197,6 +201,7 @@ config KERNEL_LZO bool "LZO" depends on HAVE_KERNEL_LZO @@ -399,3 +447,19 @@ diff -Nur linux-2.6.39.4.orig/init/Kconfig linux-2.6.39.4/init/Kconfig help Its compression ratio is the poorest among the 4. The kernel size is about 10% bigger than gzip; however its speed +diff -Nur linux-2.6.39.4.orig/lib/xz/xz_stream.h linux-2.6.39.4/lib/xz/xz_stream.h +--- linux-2.6.39.4.orig/lib/xz/xz_stream.h 2011-08-03 21:43:28.000000000 +0200 ++++ linux-2.6.39.4/lib/xz/xz_stream.h 2012-06-02 20:40:18.000000000 +0200 +@@ -40,7 +40,12 @@ + * compressed size of the file to less than 256 MiB and may also weaken + * error detection slightly. + */ ++ ++#ifdef __mips__ ++typedef uint32_t vli_type; ++#else + typedef uint64_t vli_type; ++#endif + + #define VLI_MAX ((vli_type)-1 / 2) + #define VLI_UNKNOWN ((vli_type)-1) |