linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: Lucas De Marchi <lucas.de.marchi@gmail.com>
Cc: linux-modules <linux-modules@vger.kernel.org>,
	Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Subject: RE: [PATCH] libkmod: Always search modules.builtin if no alias has been found
Date: Mon, 10 May 2021 13:55:09 +0000	[thread overview]
Message-ID: <91eb2b9fbd854cb0a3436fb4fcb7ceb1@XBOX03.axis.com> (raw)
In-Reply-To: <CAKi4VAJLS7_9T3kUcxqphASF+3FegXeDmaDebsEFEaejU0BS0w@mail.gmail.com>

> -----Original Message-----
> From: Lucas De Marchi <lucas.de.marchi@gmail.com>
> Sent: den 9 maj 2021 07:55
> To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> Cc: linux-modules <linux-modules@vger.kernel.org>; Peter Kjellerstedt
> <peter.kjellerstedt@axis.com>
> Subject: Re: [PATCH] libkmod: Always search modules.builtin if no alias
> has been found
> 
> On Tue, May 4, 2021 at 5:17 PM Peter Kjellerstedt <pkj@axis.com> wrote:
> >
> > Commit 89443220e broke the lookup for builtin modules. modules.builtin
> > was no longer searched if kmod_lookup_alias_from_kernel_builtin_file()
> > returned 0.
> >
> > Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> > ---
> >
> > I do not know if this is the correct thing to do, or if the commit
> > message makes any sense. However, it solves the problem we were seeing.
> > We use fuse, which installs /etc/modules-load.d/fuse.conf to load the
> > fuse kernel module. However, we have fuse built-in. Normally, the
> > following can be seen in the log:
> >
> >   systemd-modules-load[192]: Module 'fuse' is built in
> >
> > but after commit 89443220e, we instead got:
> >
> >   systemd-modules-load[193]: Failed to find module 'fuse'
> >
> > //Peter
> >
> >  libkmod/libkmod-module.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
> > index 76a6dc3..6720930 100644
> > --- a/libkmod/libkmod-module.c
> > +++ b/libkmod/libkmod-module.c
> > @@ -577,7 +577,7 @@ KMOD_EXPORT int kmod_module_new_from_lookup(struct kmod_ctx *ctx,
> >
> >         DBG(ctx, "lookup modules.builtin.modinfo %s\n", alias);
> >         err = kmod_lookup_alias_from_kernel_builtin_file(ctx, alias, list);
> > -       if (err == -ENOSYS) {
> > +       if (err == 0 || err == -ENOSYS) {
> 
> So in your case you do have modules.builtin.modinfo, but fuse doesn't
> show up there. On the other hand it is listed in modules.builtin.
> Does modules.builtin.info contain anything or is it an empty file?

We have neither modules.builtin.modinfo nor modules.builtin.info.
A little googling turned out that modules.builtin.modinfo seems to have 
been introduced in 5.2, but this product uses a 4.19 based kernel.

> It seems to me something else is broken:  all modules in
> modules.builtin should be in modules.builtin.modinfo as well. What is
> the result of the following commands?
> 
> grep fuse /lib/modules/$(uname -r)/modules.builtin

kernel/fs/fuse/fuse.ko

> grep fuse /lib/modules/$(uname -r)/modules.builtin.modinfo

grep: /lib/modules/4.19.110-axis8/modules.builtin.modinfo: No such file or directory

This is an embedded product built with our own distribution based on 
Poky Gatesgarth from the Yocto Project. The rootfs is read-only, including 
/lib/modules, so any contest there is created when the firmware image is 
built.

> thanks
> Lucas De Marchi
> 
> >                 /* Optional index missing, try the old one */
> >                 DBG(ctx, "lookup modules.builtin %s\n", alias);
> >                 err = kmod_lookup_alias_from_builtin_file(ctx, alias, list);

//Peter


  reply	other threads:[~2021-05-10 13:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 23:58 [PATCH] libkmod: Always search modules.builtin if no alias has been found Peter Kjellerstedt
2021-05-09  5:55 ` Lucas De Marchi
2021-05-10 13:55   ` Peter Kjellerstedt [this message]
2021-05-11 16:58     ` Lucas De Marchi
2021-05-11 18:01       ` Lucas De Marchi
2021-05-12 13:30         ` Peter Kjellerstedt

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=91eb2b9fbd854cb0a3436fb4fcb7ceb1@XBOX03.axis.com \
    --to=peter.kjellerstedt@axis.com \
    --cc=linux-modules@vger.kernel.org \
    --cc=lucas.de.marchi@gmail.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;
as well as URLs for NNTP newsgroup(s).