Skip to contentSkip to conversation

kmod: Add an exclude directive to depmod

PATCH In review Saul Wold 2 participants 3 messages Mar 25, 2022

lore
Share & tools
lore

Saul Wold

author
#0 lore raw

PATCH 1/2 kmod: Add an exclude directive to depmod

This adds a new configuration directive to depmod that causes depmod to exclude a give path entry like .debug.

kernel-dbg provides the modules .debug/<module>.ko files and when installed either directly or when dbg-pkgs are selected this can cause depmod to fail.

This patch will be submitted to upstream kmod.

---
 .../kmod/depmodwrapper-cross_1.0.bb           |   3 +
 ...dd-support-for-excluding-a-directory.patch | 158 ++++++++++++++++++
 meta/recipes-kernel/kmod/kmod_29.bb           |   4 +
 3 files changed, 165 insertions(+)
 create mode 100644 meta/recipes-kernel/kmod/kmod/0001-depmod-Add-support-for-excluding-a-directory.patch
meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb +3 -0
index 04fc14a6d21..aa23ba41276 100644
@@ -16,6 +16,9 @@ do_populate_sysroot[depends] = ""
 
 do_install() {
 	install -d ${D}${bindir_crossscripts}/
+	install -d ${D}${sysconfdir}/depmod.d/
+
+	echo "exclude .debug" > ${D}${sysconfdir}/depmod.d/exclude.conf
 
 	cat > ${D}${bindir_crossscripts}/depmodwrapper << EOF
 #!/bin/sh
meta/recipes-kernel/kmod/kmod/0001-depmod-Add-support-for-excluding-a-directory.patch new file +158 -0

158 lines not on this page · raw message

meta/recipes-kernel/kmod/kmod_29.bb +4 -0
index 91951edde16..9b663490666 100644
@@ -20,6 +20,7 @@ SRCREV = "b6ecfc916a17eab8f93be5b09f4e4f845aabd3d1"
 SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git;branch=master \
            file://depmod-search.conf \
            file://avoid_parallel_tests.patch \
+           file://0001-depmod-Add-support-for-excluding-a-directory.patch \
            "
 
 S = "${WORKDIR}/git"
@@ -64,6 +65,9 @@ do_install:append () {
 
         # install depmod.d file for search/ dir
         install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${nonarch_base_libdir}/depmod.d/search.conf"
+
+        # Add .debug to the exclude path for depmod
+        echo "exclude .debug" > ${D}${nonarch_base_libdir}/depmod.d/exclude.conf
 }
 
 ALTERNATIVE_PRIORITY = "70"
Signature · 1 line
2.31.1
author
#1 lore raw

PATCH 2/2 depmodwrapper: Use native staging dir

Use the native staging dir so that we can get the correct depmod.d configuration files. When depmod runs we want to ensure that the newly supported exclude.conf is read so that .debug/<module>.ko files are excluded.

---
 meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb +2 -2
index aa23ba41276..9921b7e8ad7 100644
@@ -35,9 +35,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 -C "\$3${sysconfdir}/depmod.d" "\$1" "\$2" "\$3" "\$4"
+    exec env depmod -C "\${STAGING_BASE_LIBDIR_NATIVE}/depmod.d" "\$1" "\$2" "\$3" "\$4"
 else
-    exec env depmod -C "\$3${sysconfdir}/depmod.d" "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
+    exec env depmod -C "\${STAGING_BASE_LIBDIR_NATIVE}/depmod.d" "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
 fi
 EOF
 	chmod +x ${D}${bindir_crossscripts}/depmodwrapper
Signature · 1 line
2.31.1
#2 lore raw

Re: [oe] [PATCH 2/2] depmodwrapper: Use native staging dir

wrong ML

Quoted 38 lines · Saul Wold

Use the native staging dir so that we can get the correct depmod.d configuration files. When depmod runs we want to ensure that the newly supported exclude.conf is read so that .debug/<module>.ko files are excluded.

---
 meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb +2 -3
index aa23ba41276..9921b7e8ad7 100644
@@ -35,9 +35,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 -C "\$3${sysconfdir}/depmod.d" "\$1" "\$2" "\$3" "\$4"
+    exec env depmod -C "\${STAGING_BASE_LIBDIR_NATIVE}/depmod.d" "\$1" "\$2" "\$3" "\$4"
 else
-    exec env depmod -C "\$3${sysconfdir}/depmod.d" "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
+    exec env depmod -C "\${STAGING_BASE_LIBDIR_NATIVE}/depmod.d" "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
 fi
 EOF
        chmod +x ${D}${bindir_crossscripts}/depmodwrapper
--

2.31.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#96211): https://lists.openembedded.org/g/openembedded-devel/message/96211
Mute This Topic: https://lists.openembedded.org/mt/90030002/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-