On Wed, Jul 19, 2023 at 1:44 PM Bruce Ashfield via
lists.openembedded.org
<bruce.ashfield=gmail....@lists.openembedded.org> wrote:
>
> On Wed, Jul 19, 2023 at 1:32 PM Petr Gotthard
> <petr.gotth...@advantech.cz> wrote:
> >
> > Hello,
> > the out-of-tree kernel modules built with latest master have broken 
> > "vermagic" and thus cannot be loaded.
> >
> > The patch 
> > https://git.yoctoproject.org/poky/commit/?id=bb0f9e87700aa40ec8db880ede3c018c1d055786
> > added to meta/classes-recipe/kernel-arch.bbclass:
> >         export LOCALVERSION ?= "${KERNEL_LOCALVERSION}"
> > so when somebody sets the KERNEL_LOCALVERSION, the kernel is build with 
> > this suffix. So far so good.
> >
> > The problem is that the "make-mod-scripts" doesn't know the 
> > KERNEL_LOCALVERSION, so it does not set the LOCALVERSION.
> > When the LOCALVERSION is not set, one suffix used to build the kernel is 
> > missing, the module "vermagic" doesn't match the kernel and the out-of-tree 
> > modules fail to load.
> > For example, after building the kernel the 
> > "kernel-build-artifacts/include/generated/utsrelease.h" contains 
> > "6.1.33-g8f7f371be2", however after running "make-mod-scripts" it's only 
> > "6.1.33".
> >
>
> Hmm.
>
> I explicitly tested this scenario to make sure it worked, since you
> run into the same issue when building modules on-target.
>
> make-mod-scripts is running out of the same SCM as the main kernel
> build, so it should match, and did in my testing (otherwise
> lttng-modules wouldn't work).

'er wait, I think I see the issue. I have a local change that isn't ready for
submission that changes the way make-mod-scripts build, which may
have masked things. Plus, I'm never letting the SCM information be
automatically picked up into the localversion.

Which goes back to me being interested in your kernel recipe, version,
etc. This is less of an issue with that commit, versus an issue with newer
kernel versions (without that change, you always get a "+" added to the
local version, which ensures that absolutely nothing built out of tree
ever loads).

To answer your other question, we can't really store the SCM version
anywhere else, as it is not always correct when you consider all of the
ways we build kernel modules. That's why I'm inhibiting the localversion
and making sure it is explicitly set.

Bruce


>
> Can you send the exact steps, which kernel recipe you are using, etc.
> That way I can reproduce the problem locally.
>
> Bruce
>
>
> > One solution to this would be to store the KERNEL_LOCALVERSION somewhere 
> > and then restore it by the "make-mod-scripts" to make sure the build 
> > environment is initialized properly. I am just not sure where is the right 
> > storage for this.
> >
> >
> > Petr
> >
> >
> >
> >
>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await
> thee at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>
> 
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#184592): 
https://lists.openembedded.org/g/openembedded-core/message/184592
Mute This Topic: https://lists.openembedded.org/mt/100240236/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to