Skip to content

Commit

Permalink
modsign: Use if_changed rule for extracting cert from module signing key
Browse files Browse the repository at this point in the history
We couldn't use if_changed for this before, because it didn't live in
the kernel/ directory so we couldn't add it to $(targets). It was easier
just to leave it as it was.

Now it's in the certs/ directory we can use if_changed, the same as we
do for the trusted certificate list.

Aside from making things consistent, this means we don't need to depend
explicitly on the include/config/module/sig/key.h file. And we also get
to automatically do the right thing and re-extract the cert if the user
does odd things like using a relative filename and then playing silly
buggers with adding/removing that file in both the source and object
trees. We always favour the one in the object tree if it exists, and
now we'll correctly re-extract the cert when it changes. Previously we'd
*only* re-extract the cert if the config option changed, even if the
actual file we're using did change.

Signed-off-by: David Woodhouse <[email protected]>
Signed-off-by: David Howells <[email protected]>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Aug 14, 2015
1 parent cfc411e commit 62172c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions certs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ endif
# GCC PR#66871 again.
$(obj)/system_certificates.o: $(obj)/signing_key.x509

$(obj)/signing_key.x509: scripts/extract-cert include/config/module/sig/key.h $(X509_DEP)
$(call cmd,extract_certs,$(MODULE_SIG_KEY_SRCPREFIX)$(CONFIG_MODULE_SIG_KEY))
targets += signing_key.x509
$(obj)/signing_key.x509: scripts/extract-cert $(X509_DEP) FORCE
$(call if_changed,extract_certs,$(MODULE_SIG_KEY_SRCPREFIX)$(CONFIG_MODULE_SIG_KEY))
endif

0 comments on commit 62172c8

Please sign in to comment.