summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-12-28 09:58:57 +0100
committerMichał Górny <mgorny@gentoo.org>2023-12-30 17:19:09 +0100
commit59e3804695ddfd8749aeb717421818122f1185cc (patch)
tree3b6585de9e218481bfd5415227f7e83db2c9aec0 /eclass
parentkernel-{build,install}.eclass: Rename flag to modules-compress (diff)
downloadgentoo-59e3804695ddfd8749aeb717421818122f1185cc.tar.gz
gentoo-59e3804695ddfd8749aeb717421818122f1185cc.tar.bz2
gentoo-59e3804695ddfd8749aeb717421818122f1185cc.zip
linux-mod-r1.eclass: Add USE=modules-compress
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 <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/linux-mod-r1.eclass14
1 files 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