From 3810dd6a469ba3e0014a390d92f1fc220dd20c3b Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 31 May 2023 03:22:19 +0100 Subject: gentoo auto-resync : 31:05:2023 - 03:22:19 --- eclass/Manifest.gz | Bin 37817 -> 37818 bytes eclass/linux-mod-r1.eclass | 37 +++++++++++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) (limited to 'eclass') diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz index c8ec595e6f2f..1e39db9f6d78 100644 Binary files a/eclass/Manifest.gz and b/eclass/Manifest.gz differ diff --git a/eclass/linux-mod-r1.eclass b/eclass/linux-mod-r1.eclass index d665c42f9dd8..30395c1496f5 100644 --- a/eclass/linux-mod-r1.eclass +++ b/eclass/linux-mod-r1.eclass @@ -544,6 +544,7 @@ modules_post_process() { (( ${#mods[@]} )) || die "${FUNCNAME[0]} was called with no installed modules under ${path}" + _modules_process_depmod.d "${mods[@]#"${path}/"}" _modules_process_strip "${mods[@]}" _modules_process_sign "${mods[@]}" _modules_sanity_modversion "${mods[@]}" # after strip/sign in case broke it @@ -850,6 +851,27 @@ _modules_process_compress() { fi } +# @FUNCTION: _modules_process_depmod.d +# @USAGE: ... +# @INTERNAL +# @DESCRIPTION: +# Generate a depmod.d file to ensure priority if duplicate modules +# exist, such as stale modules in different directories, or to +# override the kernel's own modules. +_modules_process_depmod.d() { + ( + [[ ${SLOT%/*} == 0 ]] && slot= || slot=-${SLOT%/*} + insinto /lib/depmod.d + newins - ${PN}${slot}.conf < <( + echo "# Automatically generated by linux-mod-r1.eclass for ${CATEGORY}/${PN}" + for mod; do + [[ ${mod} =~ ^(.+)/(.+).ko$ ]] && + echo "override ${BASH_REMATCH[2]} ${KV_FULL} ${BASH_REMATCH[1]}" + done + ) + ) +} + # @FUNCTION: _modules_process_sign # @USAGE: ... # @INTERNAL @@ -1197,8 +1219,19 @@ _modules_update_depmod() { einfo "Updating module dependencies for kernel ${KV_FULL} ..." if [[ -f ${map} ]]; then - nonfatal edob depmod -ae -F "${map}" -b "${EROOT:-/}" "${KV_FULL}" && - return 0 + local depmodargs=( -ae -F "${map}" "${KV_FULL}" ) + + # for nicer postinst display, keep command shorter if EROOT is unset + [[ ${EROOT} ]] && + depmodargs+=( + -b "${EROOT}" + + # EROOT from -b is not used when looking for configuration + # directories, so pass the whole list from kmod's tools/depmod.c + --config="${EROOT}"/{etc,run,usr/local/lib,lib}/depmod.d + ) + + nonfatal edob depmod "${depmodargs[@]}" && return 0 else eerror eerror "System.map for kernel ${KV_FULL} was not found, may be due to the" -- cgit v1.2.3