commit:     ca268d7717dcb157e97399721f33b4f516701bf9
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue May 30 21:32:21 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue May 30 21:52:11 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ca268d77

linux-mod-r1.eclass: respect EROOT for depmod.d confdirs

Previous commit raised concerns about this, turns out passing
`-b ${EROOT}` is not sufficient.

Not really harmful, but also avoid passing -b / given results
in double //lib/modules in depmod -v.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 eclass/linux-mod-r1.eclass | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/eclass/linux-mod-r1.eclass b/eclass/linux-mod-r1.eclass
index c914a7223efb..30395c1496f5 100644
--- a/eclass/linux-mod-r1.eclass
+++ b/eclass/linux-mod-r1.eclass
@@ -1219,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"

Reply via email to