public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Henning Schild <henning.schild@siemens.com>,
	Pingfang Liao <Pingfang.Liao@siemens.com>
Subject: [PATCH] linux-module: make sure out-of-tree modules win over built-in
Date: Thu, 25 Aug 2022 22:40:52 +0200	[thread overview]
Message-ID: <20220825204052.9151-1-henning.schild@siemens.com> (raw)

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


             reply	other threads:[~2022-08-25 20:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-25 20:40 Henning Schild [this message]
2022-08-26 11:34 ` Bezdeka, Florian
2022-08-26 12:32   ` Henning Schild
2022-08-26 12:53     ` Henning Schild

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220825204052.9151-1-henning.schild@siemens.com \
    --to=henning.schild@siemens.com \
    --cc=Pingfang.Liao@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox