image: use ucert to append signature
authorDaniel Golle <[email protected]>
Mon, 6 Aug 2018 19:20:57 +0000 (21:20 +0200)
committerDaniel Golle <[email protected]>
Tue, 7 Aug 2018 21:20:49 +0000 (23:20 +0200)
Signed-off-by: Daniel Golle <[email protected]>
include/image-commands.mk

index 28b39c310e499caea4fe8a6d9ad6dceb5d95363b..01040138a48a9d07d4e1a122ae6ce9545b27c62b 100644 (file)
@@ -309,6 +309,12 @@ metadata_json = \
 
 define Build/append-metadata
        $(if $(SUPPORTED_DEVICES),-echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@)
+       [ -s "$(BUILD_KEY)" -a -s "$(BUILD_KEY).ucert" ] && { \
+               cp "$(BUILD_KEY).ucert" "[email protected]" ;\
+               usign -S -m "$@" -s "$(BUILD_KEY)" -x "[email protected]" ;\
+               ucert -A -c "[email protected]" -x "[email protected]" ;\
+               fwtool -S "[email protected]" "$@" ;\
+       }
 endef
 
 define Build/kernel2minor