From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 67167138359 for ; Sat, 1 Aug 2020 21:41:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B3C40E0A97; Sat, 1 Aug 2020 21:41:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9B2FBE0A97 for ; Sat, 1 Aug 2020 21:41:57 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A2C4034F4C0 for ; Sat, 1 Aug 2020 21:41:52 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E330D301 for ; Sat, 1 Aug 2020 21:41:47 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1596314100.6b2ad24605d0bd6320cdd006e9ca78fdcbaa7a27.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_configkernel.sh X-VCS-Directories: / X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 6b2ad24605d0bd6320cdd006e9ca78fdcbaa7a27 X-VCS-Branch: master Date: Sat, 1 Aug 2020 21:41:47 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 41f3c841-9dc8-4f6e-b609-151f441a601b X-Archives-Hash: 45e4ec37ca04ec209675f797c8f18cf5 commit: 6b2ad24605d0bd6320cdd006e9ca78fdcbaa7a27 Author: Thomas Deutschmann gentoo org> AuthorDate: Sat Aug 1 18:11:48 2020 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Sat Aug 1 20:35:00 2020 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=6b2ad246 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 gentoo.org> gen_configkernel.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 666f525..b30d079 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_