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 (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 72048158015 for ; Thu, 28 Dec 2023 10:36:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C56052BC0D7; Thu, 28 Dec 2023 10:35:44 +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 83AA22BC0D4 for ; Thu, 28 Dec 2023 10:35:44 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 3/4] linux-mod-r1.eclass: Add USE=modules-compress Date: Thu, 28 Dec 2023 11:35:35 +0100 Message-ID: <20231228103536.420981-3-mgorny@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231228103536.420981-1-mgorny@gentoo.org> References: <20231228103536.420981-1-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: e7353496-0592-4047-bbda-fcd2d6dc6443 X-Archives-Hash: 9f82c2f3a3360e6dc87e62621945d7e9 Add a `modules-compress` USE flag to explicitly control kernel module compression. When the flag is disabled, modules are installed uncompressed even if the kernel supports compression (which is going to be the case for new sys-kernel/gentoo-kernel* builds). When it is enabled, the eclass compresses modules using the compressor configured, or fails if no compression is supported. Signed-off-by: Michał Górny --- eclass/linux-mod-r1.eclass | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/eclass/linux-mod-r1.eclass b/eclass/linux-mod-r1.eclass index 44fc927c3a70..54df2406e5c7 100644 --- a/eclass/linux-mod-r1.eclass +++ b/eclass/linux-mod-r1.eclass @@ -111,7 +111,7 @@ _LINUX_MOD_R1_ECLASS=1 inherit edo linux-info multiprocessing toolchain-funcs -IUSE="dist-kernel modules-sign +strip ${MODULES_OPTIONAL_IUSE}" +IUSE="dist-kernel modules-compress modules-sign +strip ${MODULES_OPTIONAL_IUSE}" RDEPEND=" sys-apps/kmod[tools] @@ -835,6 +835,8 @@ _modules_prepare_toolchain() { # If enabled in the kernel configuration, this compresses the given # modules using the same format. _modules_process_compress() { + use modules-compress || return + local -a compress if linux_chkconfig_present MODULE_COMPRESS_XZ; then compress=( @@ -853,13 +855,13 @@ _modules_process_compress() { fi elif linux_chkconfig_present MODULE_COMPRESS_ZSTD; then compress=(zstd -qT"$(makeopts_jobs)" --rm) + else + die "USE=modules-compress enabled but no MODULE_COMPRESS* configured" fi - if [[ -v compress ]]; then - # could fail, assumes have commands that were needed for the kernel - einfo "Compressing modules (matching the kernel configuration) ..." - edob "${compress[@]}" -- "${@}" - fi + # could fail, assumes have commands that were needed for the kernel + einfo "Compressing modules (matching the kernel configuration) ..." + edob "${compress[@]}" -- "${@}" } # @FUNCTION: _modules_process_depmod.d -- 2.43.0