wok view linux/stuff/003-squashfs-x86-support-xz-compressed-kernel.patch @ rev 12057

cleaning up receipts that have unnecessary cp operations
author Samuel Trassare <samuel_trassare@yahoo.com>
date Wed Mar 07 21:27:37 2012 -0800 (2012-03-07)
parents
children
line source
1 From: Lasse Collin <lasse.collin@tukaani.org>
2 Date: Thu, 2 Dec 2010 19:14:57 +0000 (+0200)
3 Subject: x86: Support XZ-compressed kernel
4 X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fpkl%2Fsquashfs-xz.git;a=commitdiff_plain;h=d4ad78414e5312126127b1f88cdaf8584af3eef1
6 x86: Support XZ-compressed kernel
8 This integrates the XZ decompression code to the x86
9 pre-boot code.
11 mkpiggy.c is updated to reserve about 32 KiB more buffer safety
12 margin for kernel decompression. It is done unconditionally for
13 all decompressors to keep the code simpler.
15 The XZ decompressor needs around 30 KiB of heap, so the heap size
16 is increased to 32 KiB on both x86-32 and x86-64.
18 Documentation/x86/boot.txt is updated to list the XZ magic number.
20 With the x86 BCJ filter in XZ, XZ-compressed x86 kernel tends to be
21 a few percent smaller than the equivalent LZMA-compressed kernel.
23 Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
24 ---
26 diff --git a/Documentation/x86/boot.txt b/Documentation/x86/boot.txt
27 index 30b43e1..3988cde 100644
28 --- a/Documentation/x86/boot.txt
29 +++ b/Documentation/x86/boot.txt
30 @@ -621,9 +621,9 @@ Protocol: 2.08+
31 The payload may be compressed. The format of both the compressed and
32 uncompressed data should be determined using the standard magic
33 numbers. The currently supported compression formats are gzip
34 - (magic numbers 1F 8B or 1F 9E), bzip2 (magic number 42 5A) and LZMA
35 - (magic number 5D 00). The uncompressed payload is currently always ELF
36 - (magic number 7F 45 4C 46).
37 + (magic numbers 1F 8B or 1F 9E), bzip2 (magic number 42 5A), LZMA
38 + (magic number 5D 00), and XZ (magic number FD 37). The uncompressed
39 + payload is currently always ELF (magic number 7F 45 4C 46).
41 Field name: payload_length
42 Type: read
43 diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
44 index cea0cd9..f3db0d7 100644
45 --- a/arch/x86/Kconfig
46 +++ b/arch/x86/Kconfig
47 @@ -51,6 +51,7 @@ config X86
48 select HAVE_KERNEL_GZIP
49 select HAVE_KERNEL_BZIP2
50 select HAVE_KERNEL_LZMA
51 + select HAVE_KERNEL_XZ
52 select HAVE_KERNEL_LZO
53 select HAVE_HW_BREAKPOINT
54 select HAVE_MIXED_BREAKPOINTS_REGS
55 diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
56 index 0c22955..09664ef 100644
57 --- a/arch/x86/boot/compressed/Makefile
58 +++ b/arch/x86/boot/compressed/Makefile
59 @@ -4,7 +4,7 @@
60 # create a compressed vmlinux image from the original vmlinux
61 #
63 -targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.lzo head_$(BITS).o misc.o string.o cmdline.o early_serial_console.o piggy.o
64 +targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo head_$(BITS).o misc.o string.o cmdline.o early_serial_console.o piggy.o
66 KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
67 KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
68 @@ -49,12 +49,15 @@ $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
69 $(call if_changed,bzip2)
70 $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
71 $(call if_changed,lzma)
72 +$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE
73 + $(call if_changed,xzkern)
74 $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
75 $(call if_changed,lzo)
77 suffix-$(CONFIG_KERNEL_GZIP) := gz
78 suffix-$(CONFIG_KERNEL_BZIP2) := bz2
79 suffix-$(CONFIG_KERNEL_LZMA) := lzma
80 +suffix-$(CONFIG_KERNEL_XZ) := xz
81 suffix-$(CONFIG_KERNEL_LZO) := lzo
83 quiet_cmd_mkpiggy = MKPIGGY $@
84 diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
85 index 8f7bef8..6d4cab7 100644
86 --- a/arch/x86/boot/compressed/misc.c
87 +++ b/arch/x86/boot/compressed/misc.c
88 @@ -139,6 +139,10 @@ static int lines, cols;
89 #include "../../../../lib/decompress_unlzma.c"
90 #endif
92 +#ifdef CONFIG_KERNEL_XZ
93 +#include "../../../../lib/decompress_unxz.c"
94 +#endif
95 +
96 #ifdef CONFIG_KERNEL_LZO
97 #include "../../../../lib/decompress_unlzo.c"
98 #endif
99 diff --git a/arch/x86/boot/compressed/mkpiggy.c b/arch/x86/boot/compressed/mkpiggy.c
100 index 5c22812..646aa78 100644
101 --- a/arch/x86/boot/compressed/mkpiggy.c
102 +++ b/arch/x86/boot/compressed/mkpiggy.c
103 @@ -74,7 +74,7 @@ int main(int argc, char *argv[])
105 offs = (olen > ilen) ? olen - ilen : 0;
106 offs += olen >> 12; /* Add 8 bytes for each 32K block */
107 - offs += 32*1024 + 18; /* Add 32K + 18 bytes slack */
108 + offs += 64*1024 + 128; /* Add 64K + 128 bytes slack */
109 offs = (offs+4095) & ~4095; /* Round to a 4K boundary */
111 printf(".section \".rodata..compressed\",\"a\",@progbits\n");
112 diff --git a/arch/x86/include/asm/boot.h b/arch/x86/include/asm/boot.h
113 index 3b62ab5..5e1a2ee 100644
114 --- a/arch/x86/include/asm/boot.h
115 +++ b/arch/x86/include/asm/boot.h
116 @@ -32,11 +32,7 @@
117 #define BOOT_HEAP_SIZE 0x400000
118 #else /* !CONFIG_KERNEL_BZIP2 */
120 -#ifdef CONFIG_X86_64
121 -#define BOOT_HEAP_SIZE 0x7000
122 -#else
123 -#define BOOT_HEAP_SIZE 0x4000
124 -#endif
125 +#define BOOT_HEAP_SIZE 0x8000
127 #endif /* !CONFIG_KERNEL_BZIP2 */