From: Henning Schild <henning.schild@siemens.com>
To: "Bezdeka, Florian (T CED SES-DE)" <florian.bezdeka@siemens.com>
Cc: "isar-users@googlegroups.com" <isar-users@googlegroups.com>,
"Liao,
Pingfang (Marshell) (DI FA CTR SVC CN)"
<Pingfang.Liao@siemens.com>
Subject: Re: [PATCH] linux-module: make sure out-of-tree modules win over built-in
Date: Fri, 26 Aug 2022 14:53:32 +0200 [thread overview]
Message-ID: <20220826145332.5b9f8689@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <20220826143215.37712251@md1za8fc.ad001.siemens.net>
Am Fri, 26 Aug 2022 14:32:15 +0200
schrieb Henning Schild <henning.schild@siemens.com>:
> Am Fri, 26 Aug 2022 13:34:22 +0200
> schrieb "Bezdeka, Florian (T CED SES-DE)"
> <florian.bezdeka@siemens.com>:
>
> > On Thu, 2022-08-25 at 22:40 +0200, Henning Schild wrote:
> > > If we built an out of tree module that happens to be already part
> > > of the kernel,
> > >
> >
> > This hopefully does not happen in the wild and is likely a very
> > special situation we're facing internally while working on
> > upstreaming some driver stuff.
>
> That period is going to be very long, like years. And it is rare but
> valid. Any board could require a slightly modified version of a driver
> already in the kernel, and if it is just a backport of something new
> not yet in your old kernel.
>
> While the conflict could also be solved with recompiling that kernel,
> with the conflicting driver disabled, that would be kind of a big deal
> to solve such a small issue.
>
> > I'm not sure if this is really relevant for Isar itself. If the
> > decision is "let's take it", I would vote for "disabled per
> > default".
>
> I think it is relevant, that is why i propose it.
>
> But yes, we could maybe not say "INSTALL_MOD_DIR ?= "extra"" but maybe
> allow for an array of "EXTRA_FILES". That would also allow to ship
> things like /etc/modprobe.d/ and /etc/udev.d/.
>
> Or we could make the pattern that such EXTRA_FILES would have to come
> from another BSP package which the module package itself would depend
> on. All there would be to do is to write that extra package and allow
> the modification of "Depends:" of an Isar built module package.
>
> I think i might give that last approach a try, all Isar would need to
> do is allow that Depends to change. Might feel a little obfuscated in
> the end, especially if others might want to do similar things. But let
> us see.
Likely one could also just patch the modules sources to ship those
files on "make modules_install" and they would just like that become
part of the package.
Feels kind of hacky since "make install" would seem the better place,
but that does not exist in your average external module. I will play
with that idea, since it would allow that out-of-tree module to accept
a patch that would be useful for anyone using it, Isar or not.
Henning
> Henning
>
> > > 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
> > >
> >
>
prev parent reply other threads:[~2022-08-26 12:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 20:40 Henning Schild
2022-08-26 11:34 ` Bezdeka, Florian
2022-08-26 12:32 ` Henning Schild
2022-08-26 12:53 ` Henning Schild [this message]
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=20220826145332.5b9f8689@md1za8fc.ad001.siemens.net \
--to=henning.schild@siemens.com \
--cc=Pingfang.Liao@siemens.com \
--cc=florian.bezdeka@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