kernel-module-split: don't re-sign compressed kernel modules
v2: added Signed-off-by
Quoted 66 lines · Markus Volk via lists.openembedded.org
With
CONFIG_MODULE_COMPRESS_ALLthe kernel installs modules with a compression suffix, andscripts/Makefile.modinstderives the compressed file from the signed uncompressed one, which is removed afterwards. Themodules_signtarget then has nothing to sign below ${PKGD} anddo_packagefails in sign-file with an openssl "no such file" error.Re-signing is not needed there either: compressed modules are not ELF files, so package stripping leaves them alone and the signature made during
modules_installis still valid.Found on a raspberrypi4-64 kernel, which enables both
MODULE_SIG_ALLandMODULE_COMPRESS_XZ. Tested by building linux-raspberrypi throughdo_package, which now packages 1861 signed .ko.xz modules.AI-Generated: Uses Claude Code
Signed-off-by Markus Volk <[email protected] <mailto:[email protected]>>--- meta/classes-recipe/kernel-module-split.bbclass | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)meta/classes-recipe/kernel-module-split.bbclass +0
-0@@ -53,8 +53,15 @@ post_strip_kernel_modules_signing(){ is_modules="$(${STAGING_KERNEL_DIR}/scripts/config --file${KBUILD_OUTPUT}/.config --state MODULES)"
is_module_sig="$(${STAGING_KERNEL_DIR}/scripts/config --file ${KBUILD_OUTPUT}/.config --state MODULE_SIG)" is_module_sig_all="$(${STAGING_KERNEL_DIR}/scripts/config --file${KBUILD_OUTPUT}/.config --state
MODULE_SIG_ALL)"meta/classes-recipe/kernel-module-split.bbclass +0
-2- - if [ "$is_modules" = "y" ] && [ "$is_module_sig" = "y" ] && ["$is_module_sig_all" = "y" ]; then
meta/classes-recipe/kernel-module-split.bbclass +3
-1+ is_module_compress_all="$(${STAGING_KERNEL_DIR}/scripts/config --file ${KBUILD_OUTPUT}/.config --state MODULE_COMPRESS_ALL)" + + # Compressed modules are not ELF files, so package strippingleaves them
+ # untouched and the signature made duringmodules_installis
still valid.meta/classes-recipe/kernel-module-split.bbclass +2
-0+ # Re-signing them is not only unnecessary but fails: with + # CONFIG_MODULE_COMPRESS_ALL the install targets carry thecompression
+ # suffix, and the uncompressed module their rule depends on does
notmeta/classes-recipe/kernel-module-split.bbclass +2
-0+ # exist below ${PKGD}. + if [ "$is_modules" = "y" ] && [ "$is_module_sig" = "y" ] && ["$is_module_sig_all" = "y" ] && [ "$is_module_compress_all" != "y" ]; then
# Sign modules under ${PKGD}, with M= if out-of-tree module. # Out-of-tree module Makefiles invoke the kernelMakefileby
appending M= (the module directory) to MAKEFLAGS.
# However, they usually do not provide amodules_sign
target. Therefore, the kernelmodules_signtarget has to
--
2.55.0-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#245995): <https://lists.openembedded.org/g/openembedded-core/message/245995>
Mute This Topic: <https://lists.openembedded.org/mt/121284810/3618223>
Group Owner: [email protected] <mailto:[email protected]>
Unsubscribe: <https://lists.openembedded.org/g/openembedded-core/unsub> [[email protected] <mailto:[email protected]>]
-=-=-=-=-=-=-=-=-=-=-=-