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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B4086158232 for ; Fri, 6 Dec 2024 11:33:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D35A1E0951; Fri, 6 Dec 2024 11:33:08 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6680FE0951 for ; Fri, 6 Dec 2024 11:33:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5A70D340C3C for ; Fri, 6 Dec 2024 11:33:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B273E12D4 for ; Fri, 6 Dec 2024 11:33:05 +0000 (UTC) From: "Nowa Ammerlaan" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Nowa Ammerlaan" Message-ID: <1733484674.c3a527ae22dadc00ebee74a72aae5a295e26a5d5.nowa@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/dist-kernel-utils.eclass eclass/kernel-build.eclass X-VCS-Directories: eclass/ X-VCS-Committer: nowa X-VCS-Committer-Name: Nowa Ammerlaan X-VCS-Revision: c3a527ae22dadc00ebee74a72aae5a295e26a5d5 X-VCS-Branch: master Date: Fri, 6 Dec 2024 11:33:05 +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: 2d219a50-78d7-4074-8869-6c6332ebf652 X-Archives-Hash: 7fce8f5b2a931bb1e9b4a617dbacb5d3 commit: c3a527ae22dadc00ebee74a72aae5a295e26a5d5 Author: Nowa Ammerlaan gentoo org> AuthorDate: Fri Dec 6 09:46:26 2024 +0000 Commit: Nowa Ammerlaan gentoo org> CommitDate: Fri Dec 6 11:31:14 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3a527ae eclass/{dist-,}kernel{-utils,-build}.eclass: fix compression for >=6.12 Upstream commit [1] introduces several changes to the way module compression is configured. To summarize: - CONFIG_MODULE_COMPRESS_NONE is renamed to CONFIG_MODULE_COMPRESS and moved up, this (and CONFIG_MODULE_COMPRESS_) control support for module compression. - A new switch CONFIG_MODULE_COMPRESS_ALL is introduced to control whether the modules are actually compressed when running make modules_install. This change introduced several problems that are fixed here: - CONFIG_MODULE_COMPRESS is not implicitly enabled by setting CONFIG_MODULE_COMPRESS_XZ=y in the same way that CONFIG_MODULE_COMPRESS_NONE was previously implicitly disabled by enabling the xz compression. Fixed by explicitly enabling these options. - The dist-kernel_get_module_suffix() function did not recognize the renamed option which caused the 'compressor not known' error in some configurations. Fixed by adding another condition to the elif statement in this function. Furthermore, we now also set the switch CONFIG_MODULE_COMPRESS_ALL based on the state of the "modules-compress" USE flag. This technically makes the "suffix-y" override unnecessary for the >=6.12 kernels, but it does no harm so let's keep that as it is and not add a new version conditional here. [1] https://github.com/torvalds/linux/commit/c7ff693fa2094ba0a9d0a20feb4ab1658eff9c33 Signed-off-by: Nowa Ammerlaan gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/39609 Signed-off-by: Nowa Ammerlaan gentoo.org> eclass/dist-kernel-utils.eclass | 3 ++- eclass/kernel-build.eclass | 19 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/eclass/dist-kernel-utils.eclass b/eclass/dist-kernel-utils.eclass index 67ba459f0ebe..210c586c8c29 100644 --- a/eclass/dist-kernel-utils.eclass +++ b/eclass/dist-kernel-utils.eclass @@ -175,7 +175,8 @@ dist-kernel_get_module_suffix() { echo .ko elif [[ ! -r ${config} ]]; then die "Cannot find kernel config ${config}" - elif grep -q "CONFIG_MODULE_COMPRESS_NONE=y" "${config}"; then + elif grep -q "CONFIG_MODULE_COMPRESS_NONE=y" "${config}" || + grep -q "# CONFIG_MODULE_COMPRESS is not set" "${config}"; then echo .ko elif grep -q "CONFIG_MODULE_COMPRESS_GZIP=y" "${config}"; then echo .ko.gz diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass index 376cebf3b1be..831027216321 100644 --- a/eclass/kernel-build.eclass +++ b/eclass/kernel-build.eclass @@ -371,8 +371,7 @@ kernel-build_src_install() { local compress=() if [[ ${KERNEL_IUSE_GENERIC_UKI} ]] && ! use modules-compress; then compress+=( - # force installing uncompressed modules even if compression - # is enabled via config + # Workaround for <6.12, does not have CONFIG_MODULE_COMPRESS_ALL suffix-y= ) fi @@ -656,12 +655,22 @@ kernel-build_merge_configs() { # Only semi-related but let's use that to avoid changing stable ebuilds. if [[ ${KERNEL_IUSE_GENERIC_UKI} ]]; then - # NB: we enable this even with USE=-modules-compress, in order - # to support both uncompressed and compressed modules in prebuilt - # kernels + # NB: we enable support for compressed modules even with + # USE=-modules-compress, in order to support both uncompressed and + # compressed modules in prebuilt kernels. cat <<-EOF > "${WORKDIR}/module-compress.config" || die + CONFIG_MODULE_COMPRESS=y CONFIG_MODULE_COMPRESS_XZ=y EOF + # CONFIG_MODULE_COMPRESS_ALL is supported only by >=6.12, for older + # versions we accomplish the same by overriding suffix-y= + if use modules-compress; then + echo "CONFIG_MODULE_COMPRESS_ALL=y" \ + >> "${WORKDIR}/module-compress.config" || die + else + echo "# CONFIG_MODULE_COMPRESS_ALL is not set" \ + >> "${WORKDIR}/module-compress.config" || die + fi merge_configs+=( "${WORKDIR}/module-compress.config" ) fi