All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MODSIGN: Only sign modules if built in-tree
@ 2012-10-31 13:27 Josh Boyer
  2012-11-01  7:08 ` Rusty Russell
  0 siblings, 1 reply; 13+ messages in thread
From: Josh Boyer @ 2012-10-31 13:27 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Bruno Wolff III, dhowells, linux-kernel

When building out-of-tree modules, the current modules_install target
will attempt to sign them if module signing is enabled.  This will only
work if the signing keys are present in the build tree.  That will
often not be the case for modules that are built out-of-tree against
distribution kernel development packages.  This distros will not include
the signing keys, and build errors such as:

    INSTALL /home/bruno/rpmbuild/BUILD/dahdi-linux-2.6.1/drivers/dahdi/dahdi_dyamic_eth.ko
    Can't read private key
    make[2]: *** [/home/bruno/rpmbuild/BUILD/dahdi-linux-2.6.1/drivers/dahdi/dahdi_dynamic.ko] Error 2

will prevent such modules from successfully being installed.  This changes
the mod_sign_cmd to only sign the modules if they are built in-tree.  Those
built externally can sign them manually.

Reported-by: Bruno Wolff III <bruno@wolff.to>
Signed-off-by: Josh Boyer <jwboyer@redhat.com>
---
 Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Makefile b/Makefile
index 42d0e56..3d10a87 100644
--- a/Makefile
+++ b/Makefile
@@ -720,6 +720,7 @@ export mod_strip_cmd
 
 
 ifeq ($(CONFIG_MODULE_SIG),y)
+ifeq ($(KBUILD_EXTMOD),)
 MODSECKEY = ./signing_key.priv
 MODPUBKEY = ./signing_key.x509
 export MODPUBKEY
@@ -727,6 +728,9 @@ mod_sign_cmd = perl $(srctree)/scripts/sign-file $(MODSECKEY) $(MODPUBKEY)
 else
 mod_sign_cmd = true
 endif
+else
+mod_sign_cmd = true
+endif
 export mod_sign_cmd
 
 
-- 
1.7.12.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-11-08  3:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-31 13:27 [PATCH] MODSIGN: Only sign modules if built in-tree Josh Boyer
2012-11-01  7:08 ` Rusty Russell
2012-11-01 11:26   ` Josh Boyer
2012-11-01 14:50     ` Josh Boyer
2012-11-02  3:17       ` Rusty Russell
2012-11-02 12:34         ` [PATCH v2] " Josh Boyer
2012-11-05  2:01           ` Rusty Russell
2012-11-05 13:24             ` Josh Boyer
2012-11-05 19:19             ` Josh Boyer
2012-11-06  1:34               ` Rusty Russell
2012-11-06 12:54                 ` Josh Boyer
2012-11-07 19:21                   ` Bruno Wolff III
2012-11-08  3:18                     ` Bruno Wolff III

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.