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 72261139345 for ; Tue, 6 Jul 2021 00:25:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2E45FE0ABD; Tue, 6 Jul 2021 00:25:19 +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 E4711E0AB4 for ; Tue, 6 Jul 2021 00:25:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 BB2FD33BDE4 for ; Tue, 6 Jul 2021 00:25:16 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3AB647C2 for ; Tue, 6 Jul 2021 00:25:15 +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: <1625528451.234ce291bece29b012edcb0482a3b170c86be631.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_moddeps.sh X-VCS-Directories: / X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 234ce291bece29b012edcb0482a3b170c86be631 X-VCS-Branch: master Date: Tue, 6 Jul 2021 00:25:15 +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: d7880ffa-5ad0-4f2b-a82d-5ed922f7980b X-Archives-Hash: d842ecc8ce40481ed3ea9f6da3fff9a4 commit: 234ce291bece29b012edcb0482a3b170c86be631 Author: Thomas Deutschmann gentoo org> AuthorDate: Mon Jul 5 22:04:41 2021 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Mon Jul 5 23:40:51 2021 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=234ce291 gen_moddeps.sh: modules_kext() refactored CONFIG_MODULE_COMPRESS is gone in >=5.13. Refactor to check for compression algorithm instead which is backward compatible. Link 1: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d4bbe942098b0c9b487d424a3c545c9ed56462d7 Signed-off-by: Thomas Deutschmann gentoo.org> gen_moddeps.sh | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/gen_moddeps.sh b/gen_moddeps.sh index 193338d..0842249 100755 --- a/gen_moddeps.sh +++ b/gen_moddeps.sh @@ -57,11 +57,29 @@ modules_dep_list() { modules_kext() { local KEXT='.ko' - if grep -sq '^CONFIG_MODULE_COMPRESS=y' "${KERNEL_OUTPUTDIR}"/.config - then - grep -sq '^CONFIG_MODULE_COMPRESS_XZ=y' "${KERNEL_OUTPUTDIR}"/.config && KEXT='.ko.xz' - grep -sq '^CONFIG_MODULE_COMPRESS_GZIP=y' "${KERNEL_OUTPUTDIR}"/.config && KEXT='.ko.gz' - fi + declare -A module_compression_algorithms=() + module_compression_algorithms[NONE]='.ko' + module_compression_algorithms[GZIP]='.ko.gz' + module_compression_algorithms[XZ]='.ko.xz' + + local module_compression_algorithm + for module_compression_algorithm in "${!module_compression_algorithms[@]}" + do + print_info 5 "Checking if module compression algorithm '${module_compression_algorithm}' is being used ..." + + local koption="CONFIG_MODULE_COMPRESS_${module_compression_algorithm}" + local value_koption=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "${koption}") + if [[ "${value_koption}" != "y" ]] + then + print_info 5 "Cannot use '${module_compression_algorithm}' algorithm for module compression, kernel option '${koption}' is not set!" + continue + fi + + print_info 5 "Will use '${module_compression_algorithm}' algorithm for kernel module compression!" + KEXT="${module_compression_algorithms[${module_compression_algorithm}]}" + break + done + unset module_compression_algorithms module_compression_algorithm koption value_koption echo ${KEXT} }