wok view linux/stuff/002-squashfs-decompressors-add-boot-time-xz-support.patch @ rev 11945
pcmanfm: update bdeps (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Mar 01 09:20:32 2012 +0100 (2012-03-01) |
parents | |
children |
line source
1 From: Lasse Collin <lasse.collin@tukaani.org>
2 Date: Thu, 2 Dec 2010 19:14:37 +0000 (+0200)
3 Subject: Decompressors: Add boot-time XZ support
4 X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fpkl%2Fsquashfs-xz.git;a=commitdiff_plain;h=c64bc9a229b46db75d7761601dd8ca25385a7780
6 Decompressors: Add boot-time XZ support
8 This implements the API defined in <linux/decompress/generic.h>
9 which is used for kernel, initramfs, and initrd decompression.
10 This patch together with the first patch is enough for
11 XZ-compressed initramfs and initrd; XZ-compressed kernel will
12 need arch-specific changes.
14 In contrast to other initramfs compression methods, support for
15 XZ-compressed initramfs is not enabled by default in usr/Kconfig.
16 This is primarily due to the Kconfig options of the xz_dec
17 module. It can be good to require that xz_dec is enabled
18 separately so the user can select only the BCJ filters he needs
19 when EMBEDDED=y.
21 The buffering requirements described in decompress_unxz.c are
22 stricter than with gzip, so the relevant changes should be done
23 to the arch-specific code when adding support for XZ-compressed
24 kernel. Similarly, the heap size in arch-specific pre-boot code
25 may need to be increased (30 KiB is enough).
27 The XZ decompressor needs memmove(), memeq() (memcmp() == 0),
28 and memzero() (memset(ptr, 0, size)), which aren't available in
29 all arch-specific pre-boot environments. I'm including simple
30 versions in decompress_unxz.c, but a cleaner solution would
31 naturally be nicer.
33 Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
34 ---
36 diff --git a/include/linux/decompress/unxz.h b/include/linux/decompress/unxz.h
37 new file mode 100644
38 index 0000000..41728fc
39 --- /dev/null
40 +++ b/include/linux/decompress/unxz.h
41 @@ -0,0 +1,19 @@
42 +/*
43 + * Wrapper for decompressing XZ-compressed kernel, initramfs, and initrd
44 + *
45 + * Author: Lasse Collin <lasse.collin@tukaani.org>
46 + *
47 + * This file has been put into the public domain.
48 + * You can do whatever you want with this file.
49 + */
50 +
51 +#ifndef DECOMPRESS_UNXZ_H
52 +#define DECOMPRESS_UNXZ_H
53 +
54 +int unxz(unsigned char *in, int in_size,
55 + int (*fill)(void *dest, unsigned int size),
56 + int (*flush)(void *src, unsigned int size),
57 + unsigned char *out, int *in_used,
58 + void (*error)(char *x));
59 +
60 +#endif
61 diff --git a/init/Kconfig b/init/Kconfig
62 index 2de5b1c..d9fbb0f 100644
63 --- a/init/Kconfig
64 +++ b/init/Kconfig
65 @@ -123,13 +123,16 @@ config HAVE_KERNEL_BZIP2
66 config HAVE_KERNEL_LZMA
67 bool
69 +config HAVE_KERNEL_XZ
70 + bool
71 +
72 config HAVE_KERNEL_LZO
73 bool
75 choice
76 prompt "Kernel compression mode"
77 default KERNEL_GZIP
78 - depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_LZO
79 + depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO
80 help
81 The linux kernel is a kind of self-extracting executable.
82 Several compression algorithms are available, which differ
83 @@ -174,6 +177,21 @@ config KERNEL_LZMA
84 two. Compression is slowest. The kernel size is about 33%
85 smaller with LZMA in comparison to gzip.
87 +config KERNEL_XZ
88 + bool "XZ"
89 + depends on HAVE_KERNEL_XZ
90 + help
91 + XZ uses the LZMA2 algorithm and instruction set specific
92 + BCJ filters which can improve compression ratio of executable
93 + code. The size of the kernel is about 30% smaller with XZ in
94 + comparison to gzip. On architectures for which there is a BCJ
95 + filter (i386, x86_64, ARM, IA-64, PowerPC, and SPARC), XZ
96 + will create a few percent smaller kernel than plain LZMA.
97 +
98 + The speed is about the same as with LZMA: The decompression
99 + speed of XZ is better than that of bzip2 but worse than gzip
100 + and LZO. Compression is slow.
101 +
102 config KERNEL_LZO
103 bool "LZO"
104 depends on HAVE_KERNEL_LZO
105 diff --git a/lib/Kconfig b/lib/Kconfig
106 index 6090314..45960e1 100644
107 --- a/lib/Kconfig
108 +++ b/lib/Kconfig
109 @@ -122,6 +122,9 @@ config DECOMPRESS_BZIP2
110 config DECOMPRESS_LZMA
111 tristate
113 +config DECOMPRESS_XZ
114 + tristate
115 +
116 config DECOMPRESS_LZO
117 select LZO_DECOMPRESS
118 tristate
119 diff --git a/lib/Makefile b/lib/Makefile
120 index f2f98dd..06e3d8a 100644
121 --- a/lib/Makefile
122 +++ b/lib/Makefile
123 @@ -75,6 +75,7 @@ obj-$(CONFIG_RAID6_PQ) += raid6/
124 lib-$(CONFIG_DECOMPRESS_GZIP) += decompress_inflate.o
125 lib-$(CONFIG_DECOMPRESS_BZIP2) += decompress_bunzip2.o
126 lib-$(CONFIG_DECOMPRESS_LZMA) += decompress_unlzma.o
127 +lib-$(CONFIG_DECOMPRESS_XZ) += decompress_unxz.o
128 lib-$(CONFIG_DECOMPRESS_LZO) += decompress_unlzo.o
130 obj-$(CONFIG_TEXTSEARCH) += textsearch.o
131 diff --git a/lib/decompress.c b/lib/decompress.c
132 index a760681..3d766b7 100644
133 --- a/lib/decompress.c
134 +++ b/lib/decompress.c
135 @@ -8,6 +8,7 @@
137 #include <linux/decompress/bunzip2.h>
138 #include <linux/decompress/unlzma.h>
139 +#include <linux/decompress/unxz.h>
140 #include <linux/decompress/inflate.h>
141 #include <linux/decompress/unlzo.h>
143 @@ -23,6 +24,9 @@
144 #ifndef CONFIG_DECOMPRESS_LZMA
145 # define unlzma NULL
146 #endif
147 +#ifndef CONFIG_DECOMPRESS_XZ
148 +# define unxz NULL
149 +#endif
150 #ifndef CONFIG_DECOMPRESS_LZO
151 # define unlzo NULL
152 #endif
153 @@ -36,6 +40,7 @@ static const struct compress_format {
154 { {037, 0236}, "gzip", gunzip },
155 { {0x42, 0x5a}, "bzip2", bunzip2 },
156 { {0x5d, 0x00}, "lzma", unlzma },
157 + { {0xfd, 0x37}, "xz", unxz },
158 { {0x89, 0x4c}, "lzo", unlzo },
159 { {0, 0}, NULL, NULL }
160 };
161 diff --git a/lib/decompress_unxz.c b/lib/decompress_unxz.c
162 new file mode 100644
163 index 0000000..cecd23d
164 --- /dev/null
165 +++ b/lib/decompress_unxz.c
166 @@ -0,0 +1,397 @@
167 +/*
168 + * Wrapper for decompressing XZ-compressed kernel, initramfs, and initrd
169 + *
170 + * Author: Lasse Collin <lasse.collin@tukaani.org>
171 + *
172 + * This file has been put into the public domain.
173 + * You can do whatever you want with this file.
174 + */
175 +
176 +/*
177 + * Important notes about in-place decompression
178 + *
179 + * At least on x86, the kernel is decompressed in place: the compressed data
180 + * is placed to the end of the output buffer, and the decompressor overwrites
181 + * most of the compressed data. There must be enough safety margin to
182 + * guarantee that the write position is always behind the read position.
183 + *
184 + * The safety margin for XZ with LZMA2 or BCJ+LZMA2 is calculated below.
185 + * Note that the margin with XZ is bigger than with Deflate (gzip)!
186 + *
187 + * The worst case for in-place decompression is that the beginning of
188 + * the file is compressed extremely well, and the rest of the file is
189 + * uncompressible. Thus, we must look for worst-case expansion when the
190 + * compressor is encoding uncompressible data.
191 + *
192 + * The structure of the .xz file in case of a compresed kernel is as follows.
193 + * Sizes (as bytes) of the fields are in parenthesis.
194 + *
195 + * Stream Header (12)
196 + * Block Header:
197 + * Block Header (8-12)
198 + * Compressed Data (N)
199 + * Block Padding (0-3)
200 + * CRC32 (4)
201 + * Index (8-20)
202 + * Stream Footer (12)
203 + *
204 + * Normally there is exactly one Block, but let's assume that there are
205 + * 2-4 Blocks just in case. Because Stream Header and also Block Header
206 + * of the first Block don't make the decompressor produce any uncompressed
207 + * data, we can ignore them from our calculations. Block Headers of possible
208 + * additional Blocks have to be taken into account still. With these
209 + * assumptions, it is safe to assume that the total header overhead is
210 + * less than 128 bytes.
211 + *
212 + * Compressed Data contains LZMA2 or BCJ+LZMA2 encoded data. Since BCJ
213 + * doesn't change the size of the data, it is enough to calculate the
214 + * safety margin for LZMA2.
215 + *
216 + * LZMA2 stores the data in chunks. Each chunk has a header whose size is
217 + * a maximum of 6 bytes, but to get round 2^n numbers, let's assume that
218 + * the maximum chunk header size is 8 bytes. After the chunk header, there
219 + * may be up to 64 KiB of actual payload in the chunk. Often the payload is
220 + * quite a bit smaller though; to be safe, let's assume that an average
221 + * chunk has only 32 KiB of payload.
222 + *
223 + * The maximum uncompressed size of the payload is 2 MiB. The minimum
224 + * uncompressed size of the payload is in practice never less than the
225 + * payload size itself. The LZMA2 format would allow uncompressed size
226 + * to be less than the payload size, but no sane compressor creates such
227 + * files. LZMA2 supports storing uncompressible data in uncompressed form,
228 + * so there's never a need to create payloads whose uncompressed size is
229 + * smaller than the compressed size.
230 + *
231 + * The assumption, that the uncompressed size of the payload is never
232 + * smaller than the payload itself, is valid only when talking about
233 + * the payload as a whole. It is possible that the payload has parts where
234 + * the decompressor consumes more input than it produces output. Calculating
235 + * the worst case for this would be tricky. Instead of trying to do that,
236 + * let's simply make sure that the decompressor never overwrites any bytes
237 + * of the payload which it is currently reading.
238 + *
239 + * Now we have enough information to calculate the safety margin. We need
240 + * - 128 bytes for the .xz file format headers;
241 + * - 8 bytes per every 32 KiB of uncompressed size (one LZMA2 chunk header
242 + * per chunk, each chunk having average payload size of 32 KiB); and
243 + * - 64 KiB (biggest possible LZMA2 chunk payload size) to make sure that
244 + * the decompressor never overwrites anything from the LZMA2 chunk
245 + * payload it is currently reading.
246 + *
247 + * We get the following formula:
248 + *
249 + * safety_margin = 128 + uncompressed_size * 8 / 32768 + 65536
250 + * = 128 + (uncompressed_size >> 12) + 65536
251 + *
252 + * For comparision, according to arch/x86/boot/compressed/misc.c, the
253 + * equivalent formula for Deflate is this:
254 + *
255 + * safety_margin = 18 + (uncompressed_size >> 12) + 32768
256 + *
257 + * Thus, when updating Deflate-only in-place kernel decompressor to
258 + * support XZ, the fixed overhead has to be increased from 18+32768 bytes
259 + * to 128+65536 bytes.
260 + */
261 +
262 +/*
263 + * STATIC is defined to "static" if we are being built for kernel
264 + * decompression (pre-boot code). <linux/decompress/mm.h> will define
265 + * STATIC to empty if it wasn't already defined. Since we will need to
266 + * know later if we are being used for kernel decompression, we define
267 + * XZ_PREBOOT here.
268 + */
269 +#ifdef STATIC
270 +# define XZ_PREBOOT
271 +#endif
272 +#ifdef __KERNEL__
273 +# include <linux/decompress/mm.h>
274 +#endif
275 +#define XZ_EXTERN STATIC
276 +
277 +#ifndef XZ_PREBOOT
278 +# include <linux/slab.h>
279 +# include <linux/xz.h>
280 +#else
281 +/*
282 + * Use the internal CRC32 code instead of kernel's CRC32 module, which
283 + * is not available in early phase of booting.
284 + */
285 +#define XZ_INTERNAL_CRC32 1
286 +
287 +/*
288 + * For boot time use, we enable only the BCJ filter of the current
289 + * architecture or none if no BCJ filter is available for the architecture.
290 + */
291 +#ifdef CONFIG_X86
292 +# define XZ_DEC_X86
293 +#endif
294 +#ifdef CONFIG_PPC
295 +# define XZ_DEC_POWERPC
296 +#endif
297 +#ifdef CONFIG_ARM
298 +# define XZ_DEC_ARM
299 +#endif
300 +#ifdef CONFIG_IA64
301 +# define XZ_DEC_IA64
302 +#endif
303 +#ifdef CONFIG_SPARC
304 +# define XZ_DEC_SPARC
305 +#endif
306 +
307 +/*
308 + * This will get the basic headers so that memeq() and others
309 + * can be defined.
310 + */
311 +#include "xz/xz_private.h"
312 +
313 +/*
314 + * Replace the normal allocation functions with the versions from
315 + * <linux/decompress/mm.h>. vfree() needs to support vfree(NULL)
316 + * when XZ_DYNALLOC is used, but the pre-boot free() doesn't support it.
317 + * Workaround it here because the other decompressors don't need it.
318 + */
319 +#undef kmalloc
320 +#undef kfree
321 +#undef vmalloc
322 +#undef vfree
323 +#define kmalloc(size, flags) malloc(size)
324 +#define kfree(ptr) free(ptr)
325 +#define vmalloc(size) malloc(size)
326 +#define vfree(ptr) do { if (ptr != NULL) free(ptr); } while (0)
327 +
328 +/*
329 + * FIXME: Not all basic memory functions are provided in architecture-specific
330 + * files (yet). We define our own versions here for now, but this should be
331 + * only a temporary solution.
332 + *
333 + * memeq and memzero are not used much and any remotely sane implementation
334 + * is fast enough. memcpy/memmove speed matters in multi-call mode, but
335 + * the kernel image is decompressed in single-call mode, in which only
336 + * memcpy speed can matter and only if there is a lot of uncompressible data
337 + * (LZMA2 stores uncompressible chunks in uncompressed form). Thus, the
338 + * functions below should just be kept small; it's probably not worth
339 + * optimizing for speed.
340 + */
341 +
342 +#ifndef memeq
343 +static bool memeq(const void *a, const void *b, size_t size)
344 +{
345 + const uint8_t *x = a;
346 + const uint8_t *y = b;
347 + size_t i;
348 +
349 + for (i = 0; i < size; ++i)
350 + if (x[i] != y[i])
351 + return false;
352 +
353 + return true;
354 +}
355 +#endif
356 +
357 +#ifndef memzero
358 +static void memzero(void *buf, size_t size)
359 +{
360 + uint8_t *b = buf;
361 + uint8_t *e = b + size;
362 +
363 + while (b != e)
364 + *b++ = '\0';
365 +}
366 +#endif
367 +
368 +#ifndef memmove
369 +/* Not static to avoid a conflict with the prototype in the Linux headers. */
370 +void *memmove(void *dest, const void *src, size_t size)
371 +{
372 + uint8_t *d = dest;
373 + const uint8_t *s = src;
374 + size_t i;
375 +
376 + if (d < s) {
377 + for (i = 0; i < size; ++i)
378 + d[i] = s[i];
379 + } else if (d > s) {
380 + i = size;
381 + while (i-- > 0)
382 + d[i] = s[i];
383 + }
384 +
385 + return dest;
386 +}
387 +#endif
388 +
389 +/*
390 + * Since we need memmove anyway, would use it as memcpy too.
391 + * Commented out for now to avoid breaking things.
392 + */
393 +/*
394 +#ifndef memcpy
395 +# define memcpy memmove
396 +#endif
397 +*/
398 +
399 +#include "xz/xz_crc32.c"
400 +#include "xz/xz_dec_stream.c"
401 +#include "xz/xz_dec_lzma2.c"
402 +#include "xz/xz_dec_bcj.c"
403 +
404 +#endif /* XZ_PREBOOT */
405 +
406 +/* Size of the input and output buffers in multi-call mode */
407 +#define XZ_IOBUF_SIZE 4096
408 +
409 +/*
410 + * This function implements the API defined in <linux/decompress/generic.h>.
411 + *
412 + * This wrapper will automatically choose single-call or multi-call mode
413 + * of the native XZ decoder API. The single-call mode can be used only when
414 + * both input and output buffers are available as a single chunk, i.e. when
415 + * fill() and flush() won't be used.
416 + */
417 +STATIC int INIT unxz(unsigned char *in, int in_size,
418 + int (*fill)(void *dest, unsigned int size),
419 + int (*flush)(void *src, unsigned int size),
420 + unsigned char *out, int *in_used,
421 + void (*error)(char *x))
422 +{
423 + struct xz_buf b;
424 + struct xz_dec *s;
425 + enum xz_ret ret;
426 + bool must_free_in = false;
427 +
428 +#if XZ_INTERNAL_CRC32
429 + xz_crc32_init();
430 +#endif
431 +
432 + if (in_used != NULL)
433 + *in_used = 0;
434 +
435 + if (fill == NULL && flush == NULL)
436 + s = xz_dec_init(XZ_SINGLE, 0);
437 + else
438 + s = xz_dec_init(XZ_DYNALLOC, (uint32_t)-1);
439 +
440 + if (s == NULL)
441 + goto error_alloc_state;
442 +
443 + if (flush == NULL) {
444 + b.out = out;
445 + b.out_size = (size_t)-1;
446 + } else {
447 + b.out_size = XZ_IOBUF_SIZE;
448 + b.out = malloc(XZ_IOBUF_SIZE);
449 + if (b.out == NULL)
450 + goto error_alloc_out;
451 + }
452 +
453 + if (in == NULL) {
454 + must_free_in = true;
455 + in = malloc(XZ_IOBUF_SIZE);
456 + if (in == NULL)
457 + goto error_alloc_in;
458 + }
459 +
460 + b.in = in;
461 + b.in_pos = 0;
462 + b.in_size = in_size;
463 + b.out_pos = 0;
464 +
465 + if (fill == NULL && flush == NULL) {
466 + ret = xz_dec_run(s, &b);
467 + } else {
468 + do {
469 + if (b.in_pos == b.in_size && fill != NULL) {
470 + if (in_used != NULL)
471 + *in_used += b.in_pos;
472 +
473 + b.in_pos = 0;
474 +
475 + in_size = fill(in, XZ_IOBUF_SIZE);
476 + if (in_size < 0) {
477 + /*
478 + * This isn't an optimal error code
479 + * but it probably isn't worth making
480 + * a new one either.
481 + */
482 + ret = XZ_BUF_ERROR;
483 + break;
484 + }
485 +
486 + b.in_size = in_size;
487 + }
488 +
489 + ret = xz_dec_run(s, &b);
490 +
491 + if (flush != NULL && (b.out_pos == b.out_size
492 + || (ret != XZ_OK && b.out_pos > 0))) {
493 + /*
494 + * Setting ret here may hide an error
495 + * returned by xz_dec_run(), but probably
496 + * it's not too bad.
497 + */
498 + if (flush(b.out, b.out_pos) != (int)b.out_pos)
499 + ret = XZ_BUF_ERROR;
500 +
501 + b.out_pos = 0;
502 + }
503 + } while (ret == XZ_OK);
504 +
505 + if (must_free_in)
506 + free(in);
507 +
508 + if (flush != NULL)
509 + free(b.out);
510 + }
511 +
512 + if (in_used != NULL)
513 + *in_used += b.in_pos;
514 +
515 + xz_dec_end(s);
516 +
517 + switch (ret) {
518 + case XZ_STREAM_END:
519 + return 0;
520 +
521 + case XZ_MEM_ERROR:
522 + /* This can occur only in multi-call mode. */
523 + error("XZ decompressor ran out of memory");
524 + break;
525 +
526 + case XZ_FORMAT_ERROR:
527 + error("Input is not in the XZ format (wrong magic bytes)");
528 + break;
529 +
530 + case XZ_OPTIONS_ERROR:
531 + error("Input was encoded with settings that are not "
532 + "supported by this XZ decoder");
533 + break;
534 +
535 + case XZ_DATA_ERROR:
536 + case XZ_BUF_ERROR:
537 + error("XZ-compressed data is corrupt");
538 + break;
539 +
540 + default:
541 + error("Bug in the XZ decompressor");
542 + break;
543 + }
544 +
545 + return -1;
546 +
547 +error_alloc_in:
548 + if (flush != NULL)
549 + free(b.out);
550 +
551 +error_alloc_out:
552 + xz_dec_end(s);
553 +
554 +error_alloc_state:
555 + error("XZ decompressor ran out of memory");
556 + return -1;
557 +}
558 +
559 +/*
560 + * This macro is used by architecture-specific files to decompress
561 + * the kernel image.
562 + */
563 +#define decompress unxz
564 diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
565 index 5958fff..55caecd 100644
566 --- a/scripts/gen_initramfs_list.sh
567 +++ b/scripts/gen_initramfs_list.sh
568 @@ -243,6 +243,8 @@ case "$arg" in
569 echo "$output_file" | grep -q "\.gz$" && compr="gzip -9 -f"
570 echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f"
571 echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f"
572 + echo "$output_file" | grep -q "\.xz$" && \
573 + compr="xz --check=crc32 --lzma2=dict=1MiB"
574 echo "$output_file" | grep -q "\.lzo$" && compr="lzop -9 -f"
575 echo "$output_file" | grep -q "\.cpio$" && compr="cat"
576 shift
577 diff --git a/usr/Kconfig b/usr/Kconfig
578 index e2721f5..9f51a29 100644
579 --- a/usr/Kconfig
580 +++ b/usr/Kconfig
581 @@ -72,6 +72,18 @@ config RD_LZMA
582 Support loading of a LZMA encoded initial ramdisk or cpio buffer
583 If unsure, say N.
585 +config RD_XZ
586 + bool "Support initial ramdisks compressed using XZ"
587 + depends on BLK_DEV_INITRD && XZ_DEC=y
588 + select DECOMPRESS_XZ
589 + help
590 + Support loading of a XZ encoded initial ramdisk or cpio buffer.
591 +
592 + If this option is inactive, say Y to "XZ decompression support"
593 + under "Library routines" first.
594 +
595 + If unsure, say N.
596 +
597 config RD_LZO
598 bool "Support initial ramdisks compressed using LZO" if EMBEDDED
599 default !EMBEDDED
600 @@ -139,6 +151,15 @@ config INITRAMFS_COMPRESSION_LZMA
601 three. Compression is slowest. The initramfs size is about 33%
602 smaller with LZMA in comparison to gzip.
604 +config INITRAMFS_COMPRESSION_XZ
605 + bool "XZ"
606 + depends on RD_XZ
607 + help
608 + XZ uses the LZMA2 algorithm. The initramfs size is about 30%
609 + smaller with XZ in comparison to gzip. Decompression speed
610 + is better than that of bzip2 but worse than gzip and LZO.
611 + Compression is slow.
612 +
613 config INITRAMFS_COMPRESSION_LZO
614 bool "LZO"
615 depends on RD_LZO
616 diff --git a/usr/Makefile b/usr/Makefile
617 index 6b4b6da..5845a13 100644
618 --- a/usr/Makefile
619 +++ b/usr/Makefile
620 @@ -15,6 +15,9 @@ suffix_$(CONFIG_INITRAMFS_COMPRESSION_BZIP2) = .bz2
621 # Lzma
622 suffix_$(CONFIG_INITRAMFS_COMPRESSION_LZMA) = .lzma
624 +# XZ
625 +suffix_$(CONFIG_INITRAMFS_COMPRESSION_XZ) = .xz
626 +
627 # Lzo
628 suffix_$(CONFIG_INITRAMFS_COMPRESSION_LZO) = .lzo
630 @@ -48,7 +51,7 @@ endif
631 quiet_cmd_initfs = GEN $@
632 cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input)
634 -targets := initramfs_data.cpio.gz initramfs_data.cpio.bz2 initramfs_data.cpio.lzma initramfs_data.cpio.lzo initramfs_data.cpio
635 +targets := initramfs_data.cpio.gz initramfs_data.cpio.bz2 initramfs_data.cpio.lzma initramfs_data.cpio.xz initramfs_data.cpio.lzo initramfs_data.cpio
636 # do not try to update files included in initramfs
637 $(deps_initramfs): ;