summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2019-04-12 13:18:05 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-15 17:51:41 -0700
commitc04a0865f98191c16c9254034f48bd9c46f483d2 (patch)
tree4fe87114b2bcee10ffbf11de54553bee73ca81b9 /util
parentc91a91b0f4fc5e171a766a1c55692504dbcf278e (diff)
downloadchrome-ec-c04a0865f98191c16c9254034f48bd9c46f483d2.tar.gz
signer: allow board id of 0:0:0
In the prod branch the prod signer sets the board id to FFFF:0:10000, because we're going to start doing automatic signing. We need to be able to override that board id to 0:0:0. bs doesn't support this right now because it always assumes the first field of the given board id is a 4 character string that it needs to convert into hex. This change modifies bs to use 0 for the board_id rlz if the rlz is 0 instead of trying to convert an ascii character into hex. 0 is the only digit bs will accept for the board_id, because it's easy to interpret. BUG=none BRANCH=cr50 TEST=sign image with CR50_BOARD_ID=0:0:0. Make sure gsctool -b shows the RLZ is 0 instead of 0x30. Change-Id: I1fe30877ff8d6d1574934c55c2fb5cdc543c34ad Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1565549 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
Diffstat (limited to 'util')
-rwxr-xr-xutil/signer/bs11
1 files changed, 9 insertions, 2 deletions
diff --git a/util/signer/bs b/util/signer/bs
index 7c07d8fc40..8c6b3a3822 100755
--- a/util/signer/bs
+++ b/util/signer/bs
@@ -99,8 +99,15 @@ tweak_manifest () {
exit 1
fi
- # Convert board RLZ code from ASCII to hex
- rlz="0x$(echo -n ${bid_params[0]} | hexdump -ve '/1 "%02x"')"
+ if [[ "${bid_params[0]}" == "0" ]] ; then
+ rlz="0"
+ elif [[ ${#bid_params[0]} == 4 ]] ; then
+ # Convert 4 char board RLZ code from ASCII to hex
+ rlz="0x$(echo -n ${bid_params[0]} | hexdump -ve '/1 "%02x"')"
+ else
+ echo "Invalid RLZ ${bid_params[0]}"
+ exit 1
+ fi
# Prepare text of all three board ID related nodes
sub="$(printf "\\\n\"board_id\": %s,\\\n" "${rlz}")"