] depmodwrapper-cross: add config directory option

Message ID 20220224090817.19935-1-liu.ming50@gmail.com
State New
Headers show
Series ] depmodwrapper-cross: add config directory option | expand

Commit Message

Ming Liu Feb. 24, 2022, 9:08 a.m. UTC
From: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

Native depmod by default try to find config files from the following
directories:
```
${STAGING_ETCDIR_NATIVE}/depmod.d
/run/depmod.d
/usr/local/lib/depmod.d
/lib/depmod.d
```

but none of them is correct, change to load config files from
${sysconfdir}/depmod.d of basedir.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Signed-off-by: Ming Liu <liu.ming50@gmail.com>
---
 meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
index 9a172675af..14fb8ff612 100644
--- a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
+++ b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
@@ -32,9 +32,9 @@  fi
 
 if [ ! -r ${PKGDATA_DIR}/kernel-depmod/System.map-\$4 ] || [ "\$kernelabi" != "\$4" ]; then
     echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/System.map-\$4" >&2
-    exec env depmod "\$1" "\$2" "\$3" "\$4"
+    exec env depmod -C "\$3/etc/depmod.d" "\$1" "\$2" "\$3" "\$4"
 else
-    exec env depmod "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
+    exec env depmod -C "\$3/etc/depmod.d" "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
 fi
 EOF
 	chmod +x ${D}${bindir_crossscripts}/depmodwrapper