public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] linux-module: make sure out-of-tree modules win over built-in
@ 2022-08-25 20:40 Henning Schild
  2022-08-26 11:34 ` Bezdeka, Florian
  0 siblings, 1 reply; 4+ messages in thread
From: Henning Schild @ 2022-08-25 20:40 UTC (permalink / raw)
  To: isar-users; +Cc: Henning Schild, Pingfang Liao

If we built an out of tree module that happens to be already part of the
kernel, we want to make sure depmod prefers the external one. In order
to do so simply include a config file into every module package, by
default using the kernels default INSTALL_MOD_DIR which is "extra".

Should there be multiple modules using different such directories, all
recipes should set INSTALL_MOD_DIR listing them all in the desired
order. That interface for multiple such very special modules is not nice
but since they are pretty special it might be just good enough.

Reported-by: Pingfang Liao <Pingfang.Liao@siemens.com>
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/recipes-kernel/linux-module/files/debian/rules.tmpl | 1 +
 meta/recipes-kernel/linux-module/module.inc              | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/meta/recipes-kernel/linux-module/files/debian/rules.tmpl b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
index d3bd7dc30f21..abd3c88fac7e 100755
--- a/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
+++ b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
@@ -55,6 +55,7 @@ override_dh_auto_build:
 
 override_dh_auto_install:
 	$(MAKE) -C $(KDIR) M=$(PWD) INSTALL_MOD_PATH=$(PWD)/debian/${PN} modules_install
+	install -D -m 0644 $(PWD)/debian/${PN}.conf $(PWD)/debian/${PN}/usr/lib/depmod.d/${PN}.conf
 
 %:
 	CFLAGS= LDFLAGS= dh $@ --parallel
diff --git a/meta/recipes-kernel/linux-module/module.inc b/meta/recipes-kernel/linux-module/module.inc
index b20ec32ae20a..475e7aef05ea 100644
--- a/meta/recipes-kernel/linux-module/module.inc
+++ b/meta/recipes-kernel/linux-module/module.inc
@@ -29,9 +29,12 @@ TEMPLATE_FILES = "debian/control.tmpl \
                   debian/rules.tmpl"
 TEMPLATE_VARS += "KERNEL_NAME KERNEL_TYPE KERNEL_IMAGE_PKG KERNEL_HEADERS_PKG DEBIAN_BUILD_DEPENDS PN"
 
+INSTALL_MOD_DIR ?= "extra"
+
 do_prepare_build() {
     cp -r ${WORKDIR}/debian ${S}/
 
+    echo "search ${INSTALL_MOD_DIR} built-in" > ${S}/debian/${PN}.conf
     for module in ${AUTOLOAD}; do
         echo "echo $module >> /etc/modules" >> ${S}/debian/postinst
     done
-- 
2.35.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-26 12:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-25 20:40 [PATCH] linux-module: make sure out-of-tree modules win over built-in Henning Schild
2022-08-26 11:34 ` Bezdeka, Florian
2022-08-26 12:32   ` Henning Schild
2022-08-26 12:53     ` Henning Schild

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox