summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2017-03-06 18:04:56 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-03-09 01:09:37 -0800
commit3c16e87eb4703d3eb029526965bb59d3ada9794d (patch)
tree7a4384ce1d14b27a1daa5c2da5b7eb37489adc15 /chip
parent46d6b0471231f8fc9549666acf75eb16334f593e (diff)
downloadchrome-ec-3c16e87eb4703d3eb029526965bb59d3ada9794d.tar.gz
cr50: use empty rollback map when building debug images
Debug images should run on any H1 device, no matter what its INFO mask is set to. This is achieved by emptying the info {} section of the manifest when building images with nonempty CR50_DEV in the environment. BRANCH=cr50 BUG=b:35774863 TEST=built images with and without CR50_DEV=1, verified that the manifest has the info{} section emptied when CR50_DEV is set. Verified that the RW images boot fine. Change-Id: Ied314c175d5c02f4108b7af85c244b6da8547616 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/450904 Reviewed-by: Marius Schilder <mschilder@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/g/build.mk21
1 files changed, 19 insertions, 2 deletions
diff --git a/chip/g/build.mk b/chip/g/build.mk
index 10415d1507..d425b4c09e 100644
--- a/chip/g/build.mk
+++ b/chip/g/build.mk
@@ -119,12 +119,13 @@ ifneq ($(CR50_DEV),)
CPPFLAGS += -DCR50_DEV=1
endif
+MANIFEST := util/signer/ec_RW-manifest-dev.json
CR50_RO_KEY ?= rom-testkey-A.pem
ifeq ($(H1_DEVIDS),)
CR50_RW_KEY = loader-testkey-A.pem
SIGNER = $(out)/util/signer
SIGNER_EXTRAS =
-SIGNER_MANIFEST := util/signer/ec_RW-manifest-dev.json
+SIGNER_MANIFEST := $(MANIFEST)
else
SIGNER = $(HOME)/bin/codesigner
CR50_RW_KEY = cr50_rom0-dev-blsign.pem.pub
@@ -144,8 +145,24 @@ ifneq ($(CHIP_MK_INCLUDED_ONCE),)
#
# H1_DEVIDS='<num 1> <num 2>' make ...
#
+ifeq ($(SIGNER_MANIFEST),)
SIGNER_MANIFEST := $(shell mktemp /tmp/h1.signer.XXXXXX)
-DUMMY := $(shell /bin/cp util/signer/ec_RW-manifest-dev.json $(SIGNER_MANIFEST))
+endif
+ifneq ($(CR50_DEV),)
+
+#
+# When building a debug image, we don't want rollback protection to be in the
+# way - a debug image, which is guaranteed to be node locked should run on any
+# H1, whatever its info mask state is. The awk script below clears out the
+# info {} section of the manifest.
+#
+DUMMY := $(shell /usr/bin/awk 'BEGIN {skip = 0}; \
+ /^},/ {skip = 0}; \
+ {if (!skip) {print };} \
+ /\"info\": {/ {skip = 1};' $(MANIFEST) > $(SIGNER_MANIFEST))
+else
+DUMMY := $(shell /bin/cp $(MANIFEST) $(SIGNER_MANIFEST))
+endif
REPLACEMENT := $(shell printf \
'\\n \\"DEV_ID0\\": %d,\\n \\"DEV_ID1\\": %d,' $(H1_DEVIDS))
NODE_JSON := $(shell sed -i \