From ec78f03de589adc9bd47a02d723d7054510601dd Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Wed, 8 Aug 2018 00:47:12 +0200
Subject: [PATCH] image: fix build without ucert

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>
---
 include/image-commands.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/image-commands.mk b/include/image-commands.mk
index 01040138a4..f7e6ba6aa6 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -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" ;\
-- 
2.30.2