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 CD9C3139083 for ; Tue, 31 Oct 2017 18:59:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EDCABE0EDC; Tue, 31 Oct 2017 18:59:22 +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 C6895E0EDC for ; Tue, 31 Oct 2017 18:59:22 +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 B19503416D3 for ; Tue, 31 Oct 2017 18:59:21 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 53BA082E for ; Tue, 31 Oct 2017 18:59:20 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: <1509475588.caa98450d35c8884eaf502547db5b13932fb163a.robbat2@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: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: caa98450d35c8884eaf502547db5b13932fb163a X-VCS-Branch: master Date: Tue, 31 Oct 2017 18:59:20 +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-Archives-Salt: 872fba62-74f9-41df-8fa8-f2d41fadaf5d X-Archives-Hash: 540e7bc9ad5a4b3a711926832f3dcad5 commit: caa98450d35c8884eaf502547db5b13932fb163a Author: Robin H. Johnson gentoo org> AuthorDate: Tue Oct 31 18:46:28 2017 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Tue Oct 31 18:46:28 2017 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=caa98450 gen_configkernel: validate depmod/MODULE_COMPRESS If there is a mismatch between compression support in depmod and the kernel module settings, a bad initramfs would have been generated prior to this commit. Validate and die early instead of building that bad initramfs, so you don't get boot failures. Impacts before: - modules.dep and related files can be empty. - module dependency verification for initramfs assembly can miss dependent modules. Signed-off-by: Robin H. Johnson gentoo.org> gen_configkernel.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gen_configkernel.sh b/gen_configkernel.sh index 476a883..26e4610 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -125,6 +125,21 @@ config_kernel() { if isTrue "$cfg_CONFIG_MODULES" ; then # yes, we support modules, set 'm' for new stuff. newcfg_setting='m' + # Compare the kernel module compression vs the depmod module compression support + # WARNING: if the buildhost has +XZ but the target machine has -XZ, you will get failures! + cfg_CONFIG_MODULE_COMPRESS_GZIP=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_MODULE_COMPRESS_GZIP") + cfg_CONFIG_MODULE_COMPRESS_XZ=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "CONFIG_MODULE_COMPRESS_XZ") + if isTrue "${cfg_CONFIG_MODULE_COMPRESS_GZIP}"; then + depmod_GZIP=$(/sbin/depmod -V | tr ' ' '\n' | awk '/ZLIB/{print $1; exit}') + if [[ "${depmod_GZIP}" != "+ZLIB" ]]; then + gen_die 'depmod does not support ZLIB/GZIP, cannot build with CONFIG_MODULE_COMPRESS_GZIP' + fi + elif isTrue "${cfg_CONFIG_MODULE_COMPRESS_XZ}" ; then + depmod_XZ=$(/sbin/depmod -V | tr ' ' '\n' | awk '/XZ/{print $1; exit}') + if [[ "${depmod_XZ}" != "+XZ" ]]; then + gen_die 'depmod does not support XZ, cannot build with CONFIG_MODULE_COMPRESS_XZ' + fi + fi else # no, we support modules, set 'y' for new stuff. newcfg_setting='y'