From 43297a4ed0a3760bbdd0b8c286b779f174ca5368 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 9 Aug 2024 11:04:53 +0100 Subject: gentoo auto-resync : 09:08:2024 - 11:04:52 --- eclass/dist-kernel-utils.eclass | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'eclass/dist-kernel-utils.eclass') diff --git a/eclass/dist-kernel-utils.eclass b/eclass/dist-kernel-utils.eclass index 0b0eb0ec8818..bb058d488a13 100644 --- a/eclass/dist-kernel-utils.eclass +++ b/eclass/dist-kernel-utils.eclass @@ -160,7 +160,7 @@ dist-kernel_PV_to_KV() { } # @FUNCTION: dist-kernel_get_module_suffix -# @USAGE: +# @USAGE: # @DESCRIPTION: # Returns the suffix for kernel modules based on the CONFIG_MODULES_COMPESS_* # setting in the kernel config and USE=modules-compress. @@ -169,7 +169,7 @@ dist-kernel_get_module_suffix() { [[ ${#} -eq 1 ]] || die "${FUNCNAME}: invalid arguments" - local config=${1}/.config + local config=${1} if ! in_iuse modules-compress || ! use modules-compress; then echo .ko @@ -198,7 +198,19 @@ dist-kernel_compressed_module_cleanup() { [[ ${#} -ne 1 ]] && die "${FUNCNAME}: invalid arguments" local path=${1} - local preferred=$(dist-kernel_get_module_suffix "${path}/source") + local config_path=/usr/src/linux-${KV_FULL}/.config + + local option + for option in config source/.config build/.config; do + if [[ -f ${path}/${option} ]]; then + config_path=${path}/${option} + break + fi + done + + local preferred= + [[ -f ${config_path} ]] && preferred=$(dist-kernel_get_module_suffix "${config_path}") + local basename suffix while read -r basename; do -- cgit v1.2.3