g: add Make variable for controlling blob swapping

The upcoming cr50-codesigner change will allow to use it for swapping
arbitrary blobs in the Cr50 image before signing.

Let's use this feature to replace test RMA public key with the prod
one.

BRANCH=cr50, cr50-mp
BUG=b:73296144
TEST=with the rest of the patches in place verified that invoking make
     with CR50_SWAP_RMA_KEYS=1 causes swapping the RMA public key in
     the generated image.

Change-Id: I4c9994c1a542f456b24d2066ecada9f92f1bfaf3
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/996514
Reviewed-by: Randall Spangler <rspangler@chromium.org>
(cherry picked from commit 03cc82b93b)
Reviewed-on: https://chromium-review.googlesource.com/1015614
This commit is contained in:
Vadim Bendebury 2018-04-04 10:35:35 -07:00 committed by ChromeOS Commit Bot
parent e1ee721475
commit 268220b6dc
1 changed files with 5 additions and 0 deletions

View File

@ -190,6 +190,11 @@ ifeq ($(CHIP_MK_INCLUDED_ONCE),)
CHIP_MK_INCLUDED_ONCE=1
else
ifneq ($(CR50_SWAP_RMA_KEYS),)
RMA_KEY_BASE := board/$(BOARD)/rma_key_blob
RW_SIGNER_EXTRAS += --swap $(RMA_KEY_BASE).test,$(RMA_KEY_BASE).prod
endif
$(out)/RW/ec.RW_B.flat: $(out)/RW/ec.RW.flat
$(out)/RW/ec.RW.flat $(out)/RW/ec.RW_B.flat: SIGNER_EXTRAS = $(RW_SIGNER_EXTRAS)