Skip to contentSkip to conversation

package.bbclass: Avoid stripping signed kernel modules in splitdebuginfo

PATCH Christoph Lauer 1 participant 1 message Jul 13, 2022 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Am 13.07.22 um 23:07 schrieb Christoph Lauer:

Quoted 30 lines

From: Christoph Lauer <[email protected]>

Since commit d756b346f248df47b0540644adb1d0f17bcc4b6e kernel modules are stripped by the functions 'runstrip' and 'splitdebuginfo'. Signed modules must not be stripped. Function 'runstrip' avoids this by running is_kernel_module_signed. Apply the same check to splitdebuginfo.

---
  meta/classes/package.bbclass | 5 +++++
  1 file changed, 5 insertions(+)
meta/classes/package.bbclass +5 -1
index 4850134022..63887b34f8 100644
@@ -382,6 +382,11 @@ def splitdebuginfo(file, dvar, dv, d):
      debugfile = dvar + dest
      sources = []
 
+    if file.endswith(".ko") and file.find("/lib/modules/") != -1:
+        if oe.package.is_kernel_module_signed(file):
+            bb.debug(1, "Skip strip on signed module %s" % file)
+            return (file, sources)
+
      # Split the file...
      bb.utils.mkdirhier(os.path.dirname(debugfile))
      #bb.note("Split %s -> %s" % (file, debugfile))
--

2.17.1

Quoted 8 lines

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#167990): https://lists.openembedded.org/g/openembedded-core/message/167990
Mute This Topic: https://lists.openembedded.org/mt/92366982/7029217
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

You're correct that oe.package.is_elf already ran on the file before splitdebuginfo is called, but the result is currently not available to splitdebuginfo AFAIS. It could be by extending the parameters and what not, but I'm too lazy to do that for what was meant to be a rather small change. Instead I'll follow your first suggestion to check on file extension and file location (as is_elf does too). That should cover all kernel modules and is specific enough to avoid false positives.