mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00: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
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <linux/decompress/bunzip2.h>
|
||||
#include <linux/decompress/unlzma.h>
|
||||
#include <linux/decompress/unxz.h>
|
||||
#include <linux/decompress/inflate.h>
|
||||
#include <linux/decompress/unlzo.h>
|
||||
|
||||
@@ -23,6 +24,9 @@
|
||||
#ifndef CONFIG_DECOMPRESS_LZMA
|
||||
# define unlzma NULL
|
||||
#endif
|
||||
#ifndef CONFIG_DECOMPRESS_XZ
|
||||
# define unxz NULL
|
||||
#endif
|
||||
#ifndef CONFIG_DECOMPRESS_LZO
|
||||
# define unlzo NULL
|
||||
#endif
|
||||
@@ -36,6 +40,7 @@ static const struct compress_format {
|
||||
{ {037, 0236}, "gzip", gunzip },
|
||||
{ {0x42, 0x5a}, "bzip2", bunzip2 },
|
||||
{ {0x5d, 0x00}, "lzma", unlzma },
|
||||
{ {0xfd, 0x37}, "xz", unxz },
|
||||
{ {0x89, 0x4c}, "lzo", unlzo },
|
||||
{ {0, 0}, NULL, NULL }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user