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 T...
Showing
- include/linux/decompress/unxz.h 19 additions, 0 deletionsinclude/linux/decompress/unxz.h
- init/Kconfig 19 additions, 1 deletioninit/Kconfig
- lib/Kconfig 4 additions, 0 deletionslib/Kconfig
- lib/Makefile 1 addition, 0 deletionslib/Makefile
- lib/decompress.c 5 additions, 0 deletionslib/decompress.c
- lib/decompress_unxz.c 397 additions, 0 deletionslib/decompress_unxz.c
- scripts/gen_initramfs_list.sh 2 additions, 0 deletionsscripts/gen_initramfs_list.sh
- usr/Kconfig 18 additions, 0 deletionsusr/Kconfig
- usr/Makefile 4 additions, 1 deletionusr/Makefile
Please register or sign in to comment