After introducing the zboot image, kexec file load should be able to decompress the Image.gz. (Do in the later patch) Unlike efi_zboot_entry() which knows the decompression method at the built time, kexec may loads compressed kernels with variant compression methods, hence it is helpful to include as many decompression method as possible. Here provide an opportunity to let users select at their will. Besides this, introduce an extra config option 'HAVE_KEXEC_DECOMPRESS' to distinguish the reference to decompression routine between kexec and boot. (used in later patch to keep the routine out of .init.text section) Signed-off-by: Pingfan Liu <kernelfans@xxxxxxxxx> Cc: Will Deacon <will@xxxxxxxxxx> Cc: Nick Terrell <terrelln@xxxxxx> Cc: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Cc: Eric Biggers <ebiggers@xxxxxxxxxx> Cc: "Jason A. Donenfeld" <Jason@xxxxxxxxx> Cc: Yury Norov <yury.norov@xxxxxxxxx> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Ard Biesheuvel <ardb@xxxxxxxxxx> Cc: kexec@xxxxxxxxxxxxxxxxxxx To: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx --- arch/arm64/Kconfig | 59 ++++++++++++++++++++++++++++++++++++++++++++++ lib/Kconfig | 3 +++ 2 files changed, 62 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index c5ccca26a408..58a65bdaeffa 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1419,6 +1419,65 @@ config KEXEC_FILE for kernel and initramfs as opposed to list of segments as accepted by previous system call. +menu "Decompress method for kexec file load" + +config KEXEC_DECOMPRESS_GZIP + bool "gzip" + depends on KEXEC_FILE + select DECOMPRESS_GZIP + select HAVE_KEXEC_DECOMPRESS + help + Enable to load the zboot image compressed by gzip + +config KEXEC_DECOMPRESS_BZIP2 + bool "bzip2" + depends on KEXEC_FILE + select DECOMPRESS_BZIP2 + select HAVE_KEXEC_DECOMPRESS + help + Enable to load the zboot image compressed by bzip2 + +config KEXEC_DECOMPRESS_LZMA + bool "lzma" + depends on KEXEC_FILE + select DECOMPRESS_LZMA + select HAVE_KEXEC_DECOMPRESS + help + Enable to load the zboot image compressed by lzma + +config KEXEC_DECOMPRESS_XZ + bool "xz" + depends on KEXEC_FILE + select DECOMPRESS_XZ + select HAVE_KEXEC_DECOMPRESS + help + Enable to load the zboot image compressed by xz + +config KEXEC_DECOMPRESS_LZO + bool "lzo" + depends on KEXEC_FILE + select DECOMPRESS_LZO + select HAVE_KEXEC_DECOMPRESS + help + Enable to load the zboot image compressed by lzo + +config KEXEC_DECOMPRESS_LZ4 + bool "lz4" + depends on KEXEC_FILE + select DECOMPRESS_LZ4 + select HAVE_KEXEC_DECOMPRESS + help + Enable to load the zboot image compressed by lz4 + +config KEXEC_DECOMPRESS_ZSTD + bool "zstd" + depends on KEXEC_FILE + select DECOMPRESS_ZSTD + select HAVE_KEXEC_DECOMPRESS + help + Enable to load the zboot image compressed by zstd +endmenu + config KEXEC_SIG bool "Verify kernel signature during kexec_file_load() syscall" depends on KEXEC_FILE diff --git a/lib/Kconfig b/lib/Kconfig index ce2abffb9ed8..18ab33511ee1 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -304,6 +304,9 @@ config RANDOM32_SELFTEST # # compression support is select'ed if needed # +config HAVE_KEXEC_DECOMPRESS + bool + config 842_COMPRESS select CRC32 tristate -- 2.31.1 _______________________________________________ kexec mailing list kexec@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/kexec