aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Woodhouse2015-08-14 10:17:16 -0500
committerDavid Howells2015-08-14 10:32:52 -0500
commit3ee550f12c1529a023f71c9b5becb3351911047b (patch)
treea60711f8662b42d5720b90567daf718cb90eca93 /certs/Makefile
parent62172c81f2d6c2311284467d6aaa00bd8967e136 (diff)
downloadkernel-omap-3ee550f12c1529a023f71c9b5becb3351911047b.tar.gz
kernel-omap-3ee550f12c1529a023f71c9b5becb3351911047b.tar.xz
kernel-omap-3ee550f12c1529a023f71c9b5becb3351911047b.zip
modsign: Handle signing key in source tree
Since commit 1329e8cc69 ("modsign: Extract signing cert from CONFIG_MODULE_SIG_KEY if needed"), the build system has carefully coped with the signing key being specified as a relative path in either the source or or the build trees. However, the actual signing of modules has not worked if the filename is relative to the source tree. Fix that by moving the config_filename helper into scripts/Kbuild.include so that it can be used from elsewhere, and then using it in the top-level Makefile to find the signing key file. Kill the intermediate $(MODPUBKEY) and $(MODSECKEY) variables too, while we're at it. There's no need for them. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'certs/Makefile')
-rw-r--r--certs/Makefile54
1 files changed, 0 insertions, 54 deletions
diff --git a/certs/Makefile b/certs/Makefile
index 3c782d025c36..28ac694dd11a 100644
--- a/certs/Makefile
+++ b/certs/Makefile
@@ -4,60 +4,6 @@
4 4
5obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o 5obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o
6 6
7###############################################################################
8#
9# When a Kconfig string contains a filename, it is suitable for
10# passing to shell commands. It is surrounded by double-quotes, and
11# any double-quotes or backslashes within it are escaped by
12# backslashes.
13#
14# This is no use for dependencies or $(wildcard). We need to strip the
15# surrounding quotes and the escaping from quotes and backslashes, and
16# we *do* need to escape any spaces in the string. So, for example:
17#
18# Usage: $(eval $(call config_filename,FOO))
19#
20# Defines FOO_FILENAME based on the contents of the CONFIG_FOO option,
21# transformed as described above to be suitable for use within the
22# makefile.
23#
24# Also, if the filename is a relative filename and exists in the source
25# tree but not the build tree, define FOO_SRCPREFIX as $(srctree)/ to
26# be prefixed to *both* command invocation and dependencies.
27#
28# Note: We also print the filenames in the quiet_cmd_foo text, and
29# perhaps ought to have a version specially escaped for that purpose.
30# But it's only cosmetic, and $(patsubst "%",%,$(CONFIG_FOO)) is good
31# enough. It'll strip the quotes in the common case where there's no
32# space and it's a simple filename, and it'll retain the quotes when
33# there's a space. There are some esoteric cases in which it'll print
34# the wrong thing, but we don't really care. The actual dependencies
35# and commands *do* get it right, with various combinations of single
36# and double quotes, backslashes and spaces in the filenames.
37#
38###############################################################################
39#
40quote := $(firstword " ")
41space :=
42space +=
43space_escape := %%%SPACE%%%
44#
45define config_filename
46ifneq ($$(CONFIG_$(1)),"")
47$(1)_FILENAME := $$(subst \\,\,$$(subst \$$(quote),$$(quote),$$(subst $$(space_escape),\$$(space),$$(patsubst "%",%,$$(subst $$(space),$$(space_escape),$$(CONFIG_$(1)))))))
48ifneq ($$(patsubst /%,%,$$(firstword $$($(1)_FILENAME))),$$(firstword $$($(1)_FILENAME)))
49else
50ifeq ($$(wildcard $$($(1)_FILENAME)),)
51ifneq ($$(wildcard $$(srctree)/$$($(1)_FILENAME)),)
52$(1)_SRCPREFIX := $(srctree)/
53endif
54endif
55endif
56endif
57endef
58#
59###############################################################################
60
61ifeq ($(CONFIG_SYSTEM_TRUSTED_KEYRING),y) 7ifeq ($(CONFIG_SYSTEM_TRUSTED_KEYRING),y)
62 8
63$(eval $(call config_filename,SYSTEM_TRUSTED_KEYS)) 9$(eval $(call config_filename,SYSTEM_TRUSTED_KEYS))