image: fix build without ucert
authorDaniel Golle <daniel@makrotopia.org>
Tue, 7 Aug 2018 22:47:12 +0000 (00:47 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 18 Dec 2018 16:47:45 +0000 (17:47 +0100)
Make sure the Shell-expression returns true also in case of
key-build.ucert being absent.

Fixes commit 848b455d2e ("image: use ucert to append signature")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(backported from ec78f03de589adc9bd47a02d723d7054510601dd)

include/image-commands.mk

index 01040138a48a9d07d4e1a122ae6ce9545b27c62b..f7e6ba6aa6e730992fef12a0476b36a912626072 100644 (file)
@@ -309,7 +309,7 @@ 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" ] && { \
+       [ ! -s "$(BUILD_KEY)" -o ! -s "$(BUILD_KEY).ucert" ] || { \
                cp "$(BUILD_KEY).ucert" "$@.ucert" ;\
                usign -S -m "$@" -s "$(BUILD_KEY)" -x "$@.sig" ;\
                ucert -A -c "$@.ucert" -x "$@.sig" ;\