mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
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>
This commit is contained in:
committed by
Linus Torvalds
parent
24fa0402a9
commit
3ebe12439b
18
usr/Kconfig
18
usr/Kconfig
@@ -72,6 +72,15 @@ config RD_LZMA
|
||||
Support loading of a LZMA encoded initial ramdisk or cpio buffer
|
||||
If unsure, say N.
|
||||
|
||||
config RD_XZ
|
||||
bool "Support initial ramdisks compressed using XZ" if EMBEDDED
|
||||
default !EMBEDDED
|
||||
depends on BLK_DEV_INITRD
|
||||
select DECOMPRESS_XZ
|
||||
help
|
||||
Support loading of a XZ encoded initial ramdisk or cpio buffer.
|
||||
If unsure, say N.
|
||||
|
||||
config RD_LZO
|
||||
bool "Support initial ramdisks compressed using LZO" if EMBEDDED
|
||||
default !EMBEDDED
|
||||
@@ -139,6 +148,15 @@ config INITRAMFS_COMPRESSION_LZMA
|
||||
three. Compression is slowest. The initramfs size is about 33%
|
||||
smaller with LZMA in comparison to gzip.
|
||||
|
||||
config INITRAMFS_COMPRESSION_XZ
|
||||
bool "XZ"
|
||||
depends on RD_XZ
|
||||
help
|
||||
XZ uses the LZMA2 algorithm. The initramfs size is about 30%
|
||||
smaller with XZ in comparison to gzip. Decompression speed
|
||||
is better than that of bzip2 but worse than gzip and LZO.
|
||||
Compression is slow.
|
||||
|
||||
config INITRAMFS_COMPRESSION_LZO
|
||||
bool "LZO"
|
||||
depends on RD_LZO
|
||||
|
@@ -15,6 +15,9 @@ suffix_$(CONFIG_INITRAMFS_COMPRESSION_BZIP2) = .bz2
|
||||
# Lzma
|
||||
suffix_$(CONFIG_INITRAMFS_COMPRESSION_LZMA) = .lzma
|
||||
|
||||
# XZ
|
||||
suffix_$(CONFIG_INITRAMFS_COMPRESSION_XZ) = .xz
|
||||
|
||||
# Lzo
|
||||
suffix_$(CONFIG_INITRAMFS_COMPRESSION_LZO) = .lzo
|
||||
|
||||
@@ -50,7 +53,7 @@ endif
|
||||
quiet_cmd_initfs = GEN $@
|
||||
cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input)
|
||||
|
||||
targets := initramfs_data.cpio.gz initramfs_data.cpio.bz2 initramfs_data.cpio.lzma initramfs_data.cpio.lzo initramfs_data.cpio
|
||||
targets := initramfs_data.cpio.gz initramfs_data.cpio.bz2 initramfs_data.cpio.lzma initramfs_data.cpio.xz initramfs_data.cpio.lzo initramfs_data.cpio
|
||||
# do not try to update files included in initramfs
|
||||
$(deps_initramfs): ;
|
||||
|
||||
|
Reference in New Issue
Block a user