diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2020-08-01 20:11:48 +0200 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2020-08-01 22:35:00 +0200 |
commit | 6b2ad24605d0bd6320cdd006e9ca78fdcbaa7a27 (patch) | |
tree | a4958307247ac7e6ce36f605197edc3d0634d7b1 /gen_configkernel.sh | |
parent | gen_initramfs.sh: create_initramfs(): Use correct kernel config (diff) | |
download | genkernel-6b2ad24605d0bd6320cdd006e9ca78fdcbaa7a27.tar.gz genkernel-6b2ad24605d0bd6320cdd006e9ca78fdcbaa7a27.tar.bz2 genkernel-6b2ad24605d0bd6320cdd006e9ca78fdcbaa7a27.zip |
gen_configkernel.sh: set_initramfs_compression_method(): Ensure that set compression method is supported by the kernel
When we didn't build kernel we have to be sure that kernel can actually
decompress chosen initramfs compression type.
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'gen_configkernel.sh')
-rwxr-xr-x | gen_configkernel.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 666f5252..b30d079f 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -119,7 +119,7 @@ set_initramfs_compression_method() { if [[ "${COMPRESS_INITRD_TYPE}" =~ ^(BEST|FASTEST)$ ]] then - print_info 5 "Determining '${COMPRESS_INITRD_TYPE}' compression method for initramfs ..." + print_info 5 "Determining '${COMPRESS_INITRD_TYPE}' compression method for initramfs using kernel config '${kernel_config}' ..." local ranked_methods if [[ "${COMPRESS_INITRD_TYPE}" == "BEST" ]] then @@ -162,6 +162,20 @@ set_initramfs_compression_method() { fi fi + if ! isTrue "${BUILD_KERNEL}" + then + local cfg_DECOMPRESS_SUPPORT=$(kconfig_get_opt "${kernel_config}" "CONFIG_RD_${COMPRESS_INITRD_TYPE}") + if [[ "${cfg_DECOMPRESS_SUPPORT}" != "y" ]] + then + gen_die "The kernel config '${kernel_config}' this initramfs will be build for cannot decompress set --compress-initrd-type '${COMPRESS_INITRD_TYPE}'!" + fi + + # If we are not building kernel, there is no point in + # changing kernel config file at all so exit function + # here. + return + fi + local KOPTION_PREFIX=CONFIG_RD_ [ ${KV_NUMERIC} -ge 4010 ] && KOPTION_PREFIX=CONFIG_INITRAMFS_COMPRESSION_ |