• [gentoo-dev] [PATCH] (dist-)kernel-{install,utils}.eclass: fix finding

    From Andrew Ammerlaan@21:1/5 to All on Thu Aug 8 18:50:01 2024
    The source symlink does not exist on all systems.

    If we can't find any config at all then there will be no preferred suffix
    which means we fall back to the old '-nt' based cleaning.

    Closes: https://bugs.gentoo.org/937569
    Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
    ---
    eclass/dist-kernel-utils.eclass | 18 +++++++++++++++---
    eclass/kernel-install.eclass | 2 +-
    2 files changed, 16 insertions(+), 4 deletions(-)

    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: <kernel_dir>
    +# @USAGE: <kernel_config>
    # @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}: inva