summaryrefslogtreecommitdiff
path: root/eclass/linux-mod-r1.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-12-30 17:41:14 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-12-30 17:41:14 +0000
commit35e3ee5faf74dc69409f957f81a6848d4d24c49f (patch)
treed6bc6dbf01adb34336a16db816df491d45013f2d /eclass/linux-mod-r1.eclass
parentab3caa4e3adb16caadd7e9e1d9f606b34f20d2b3 (diff)
gentoo auto-resync : 30:12:2023 - 17:41:14
Diffstat (limited to 'eclass/linux-mod-r1.eclass')
-rw-r--r--eclass/linux-mod-r1.eclass17
1 files changed, 10 insertions, 7 deletions
diff --git a/eclass/linux-mod-r1.eclass b/eclass/linux-mod-r1.eclass
index 44fc927c3a70..67a4b64eb481 100644
--- a/eclass/linux-mod-r1.eclass
+++ b/eclass/linux-mod-r1.eclass
@@ -109,9 +109,9 @@ esac
if [[ ! ${_LINUX_MOD_R1_ECLASS} ]]; then
_LINUX_MOD_R1_ECLASS=1
-inherit edo linux-info multiprocessing toolchain-funcs
+inherit dist-kernel-utils 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]
@@ -468,6 +468,7 @@ linux-mod-r1_pkg_postinst() {
debug-print-function ${FUNCNAME[0]} "${@}"
_modules_check_function ${#} 0 0 || return 0
+ dist-kernel_compressed_module_cleanup "${EROOT}/lib/modules/${KV_FULL}"
_modules_update_depmod
# post_process ensures modules were installed and that the eclass' USE
@@ -835,6 +836,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 +856,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