[lkml]   [2021]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] builddeb: Support signing kernels with a Machine Owner Key
If the config file specifies a signing key, use it to sign
the kernel so that machines with SecureBoot enabled can boot.

Signed-off-by: Matthew Wilcox (Oracle) <>
scripts/package/builddeb | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 91a502bb97e8..4fa6ff2b5cac 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -147,7 +147,15 @@ else
cp "$tmpdir/boot/$version"
cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version"
-cp "$($MAKE -s -f $srctree/Makefile image_name)" "$tmpdir/$installed_image_path"
+vmlinux=$($MAKE -s -f $srctree/Makefile image_name)
+if is_enabled CONFIG_MODULE_SIG; then
+ cert=$srctree/$(grep ^CONFIG_MODULE_SIG_KEY= include/config/auto.conf | cut -d\" -f2)
+ key=${cert%pem}priv
+ sbsign --key $key --cert $cert "$vmlinux" --output "$tmpdir/$installed_image_path"
+ cp "$vmlinux" "$tmpdir/$installed_image_path"

if is_enabled CONFIG_OF_EARLY_FLATTREE; then
# Only some architectures with OF support have this target
 \ /
  Last update: 2021-10-13 22:07    [W:0.080 / U:2.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site