All of lore.kernel.org
 help / color / mirror / Atom feed
From: mark.yang@lge.com
To: openembedded-core@lists.openembedded.org
Cc: "mark.yang" <mark.yang@lge.com>
Subject: [PATCH] kernel-module-split: fix re-signing of modules built in a subdirectory
Date: Wed, 25 Nov 2026 09:56:19 +0900	[thread overview]
Message-ID: <20261125005619.45574-1-mark.yang@lge.com> (raw)

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
 }

             reply	other threads:[~2026-11-25  0:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  0:56 mark.yang [this message]
2026-11-27  5:05 ` [OE-core] [PATCH] kernel-module-split: fix re-signing of modules built in a subdirectory Bruce Ashfield

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=20261125005619.45574-1-mark.yang@lge.com \
    --to=mark.yang@lge.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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 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.