aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2011-01-12 20:01:23 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 11:03:25 -0500
commit3ebe12439ba7fc62e1d6ecb569b7287771716ca1 (patch)
tree65945a63ad1474489d80c8ca1fb1c1c8091fb7a2 /init
parent24fa0402a9b6a537e87e38341e78b7da86486846 (diff)
decompressors: add boot-time XZ support
This implements the API defined in <linux/decompress/generic.h> which is used for kernel, initramfs, and initrd decompression. This patch together with the first patch is enough for XZ-compressed initramfs and initrd; XZ-compressed kernel will need arch-specific changes. The buffering requirements described in decompress_unxz.c are stricter than with gzip, so the relevant changes should be done to the arch-specific code when adding support for XZ-compressed kernel. Similarly, the heap size in arch-specific pre-boot code may need to be increased (30 KiB is enough). The XZ decompressor needs memmove(), memeq() (memcmp() == 0), and memzero() (memset(ptr, 0, size)), which aren't available in all arch-specific pre-boot environments. I'm including simple versions in decompress_unxz.c, but a cleaner solution would naturally be nicer. Signed-off-by: Lasse Collin <lasse.collin@tukaani.org> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Alain Knaff <alain@knaff.lu> Cc: Albin Tonnerre <albin.tonnerre@free-electrons.com> Cc: Phillip Lougher <phillip@lougher.demon.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig20
1 files changed, 19 insertions, 1 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 8dfd094e6875..ea176e8edbdd 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -130,13 +130,16 @@ config HAVE_KERNEL_BZIP2
130config HAVE_KERNEL_LZMA 130config HAVE_KERNEL_LZMA
131 bool 131 bool
132 132
133config HAVE_KERNEL_XZ
134 bool
135
133config HAVE_KERNEL_LZO 136config HAVE_KERNEL_LZO
134 bool 137 bool
135 138
136choice 139choice
137 prompt "Kernel compression mode" 140 prompt "Kernel compression mode"
138 default KERNEL_GZIP 141 default KERNEL_GZIP
139 depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_LZO 142 depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO
140 help 143 help
141 The linux kernel is a kind of self-extracting executable. 144 The linux kernel is a kind of self-extracting executable.
142 Several compression algorithms are available, which differ 145 Several compression algorithms are available, which differ
@@ -181,6 +184,21 @@ config KERNEL_LZMA
181 two. Compression is slowest. The kernel size is about 33% 184 two. Compression is slowest. The kernel size is about 33%
182 smaller with LZMA in comparison to gzip. 185 smaller with LZMA in comparison to gzip.
183 186
187config KERNEL_XZ
188 bool "XZ"
189 depends on HAVE_KERNEL_XZ
190 help
191 XZ uses the LZMA2 algorithm and instruction set specific
192 BCJ filters which can improve compression ratio of executable
193 code. The size of the kernel is about 30% smaller with XZ in
194 comparison to gzip. On architectures for which there is a BCJ
195 filter (i386, x86_64, ARM, IA-64, PowerPC, and SPARC), XZ
196 will create a few percent smaller kernel than plain LZMA.
197
198 The speed is about the same as with LZMA: The decompression
199 speed of XZ is better than that of bzip2 but worse than gzip
200 and LZO. Compression is slow.
201
184config KERNEL_LZO 202config KERNEL_LZO
185 bool "LZO" 203 bool "LZO"
186 depends on HAVE_KERNEL_LZO 204 depends on HAVE_KERNEL_LZO