* [PATCH] kernel-module-split: fix re-signing of modules built in a subdirectory
@ 2026-11-25 0:56 mark.yang
2026-11-27 5:05 ` [OE-core] " Bruce Ashfield
0 siblings, 1 reply; 2+ messages in thread
From: mark.yang @ 2026-11-25 0:56 UTC (permalink / raw)
To: openembedded-core; +Cc: mark.yang
From: "mark.yang" <mark.yang@lge.com>
Out-of-tree modules built in a subdirectory of ${S}, such as
lttng-modules, are not signed again after package stripping and end up
in the packages without a signature.
A kernel with CONFIG_MODULE_SIG_FORCE=y then refuses to load them.
modprobe fails with "Key was rejected by service" and the kernel logs:
Loading of unsigned module is rejected
To reproduce, set CONFIG_MODULE_SIG=y and CONFIG_MODULE_SIG_ALL=y in
linux-yocto and build lttng-modules. In log.do_package, modules_sign
enters ${S}, signs nothing and succeeds:
NOTE: make ... M=.../lttng-modules-2.16.0 modules_sign
make[1]: Entering directory '.../lttng-modules-2.16.0'
make[1]: Leaving directory '.../lttng-modules-2.16.0'
Since 02890c1eff10 ("kernel-module-split: Remove get_ext_mod")
modules_sign always gets M=${S}, but lttng-modules runs Kbuild in
${S}/src and modules.order is only there.
Use MODULES_MODULE_SYMVERS_LOCATION, which module.bbclass already uses
to find Module.symvers in the same directory. modules_sign then signs
the modules:
NOTE: make ... M=.../lttng-modules-2.16.0/src modules_sign
SIGN .../lttng-modules/lttng-ring-buffer-client-discard.ko
Signed-off-by: mark.yang <mark.yang@lge.com>
---
meta/classes-recipe/kernel-module-split.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes-recipe/kernel-module-split.bbclass b/meta/classes-recipe/kernel-module-split.bbclass
index 9a7f04f37b..1722687365 100644
--- a/meta/classes-recipe/kernel-module-split.bbclass
+++ b/meta/classes-recipe/kernel-module-split.bbclass
@@ -69,7 +69,7 @@ post_strip_kernel_modules_signing(){
oe_runmake \
-C ${KBUILD_OUTPUT} \
MODLIB=${PKGD}${KERNEL_MODULE_INSTALL_PREFIX} \
- ${@'M=%s' % '${S}' if not "virtual/kernel" in d.getVar('PROVIDES') else ''} \
+ ${@'M=${B}/%s' % (d.getVar('MODULES_MODULE_SYMVERS_LOCATION') or '') if not "virtual/kernel" in d.getVar('PROVIDES') else ''} \
modules_sign
fi
}
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [OE-core] [PATCH] kernel-module-split: fix re-signing of modules built in a subdirectory
2026-11-25 0:56 [PATCH] kernel-module-split: fix re-signing of modules built in a subdirectory mark.yang
@ 2026-11-27 5:05 ` Bruce Ashfield
0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2026-11-27 5:05 UTC (permalink / raw)
To: mark.yang; +Cc: openembedded-core
On Tue, Nov 25, 2026 at 9:56 AM mark.yang via openembedded-core
<mark.yang=lge.com@lists.openembedded.org> wrote:
>
> Use MODULES_MODULE_SYMVERS_LOCATION, which module.bbclass already uses
> to find Module.symvers in the same directory. modules_sign then signs
> the modules:
Thanks for the detailed commit message, the reproducer and logs made
this easy to follow.
Using MODULES_MODULE_SYMVERS_LOCATION makes sense to me, it's the
parameterisation that RP mentioned when get_ext_mod was dropped, and
module.bbclass already looks for Module.symvers in that same spot.
> - ${@'M=%s' % '${S}' if not "virtual/kernel" in d.getVar('PROVIDES') else ''} \
> + ${@'M=${B}/%s' % (d.getVar('MODULES_MODULE_SYMVERS_LOCATION') or '') if not "virtual/kernel" in d.getVar('PROVIDES') else ''} \
The expression is more complicated than it needs to be, though. (At
least in my reading of it). It nests the conditional, a % format and
a getVar with an or '' guard.
I assume the getVar/or '' is there because kernel.bbclass never sets
MODULES_MODULE_SYMVERS_LOCATION, and an unset ${VAR} inside ${@...}
stops bitbake from running the python at all. If you give it a default
in kernel-module-split.bbclass:
MODULES_MODULE_SYMVERS_LOCATION ?= ""
then it is always set (module.bbclass inherits kernel-module-split,
so its ?= "" becomes redundant), and the call site can just expand
it, the same way it does ${S} today:
${@'M=${B}/${MODULES_MODULE_SYMVERS_LOCATION}' if not "virtual/kernel" in d.getVar('PROVIDES') else ''} \
Can you also mention the ${S} -> ${B} change in the commit message ?
For most module recipes B == S so nothing changes, but where they
differ (externalsrc without EXTERNALSRC_BUILD, etc) we now point at
${B}, which is where Kbuild ran and modules.order lives. That's the
right place, but it is a behaviour change and should be called out.
With those in a v2, I'm happy to ack it.
Bruce
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-27 5:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 0:56 [PATCH] kernel-module-split: fix re-signing of modules built in a subdirectory mark.yang
2026-11-27 5:05 ` [OE-core] " Bruce Ashfield
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.