summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorC Shapiro <shapiroc@chromium.org>2017-08-25 13:01:39 -0600
committerchrome-bot <chrome-bot@chromium.org>2017-08-25 19:54:10 -0700
commit9b3e2cba5b3bdc87c5b1d5905a2ceea451036eb0 (patch)
treef63b2669b02b803b182a6c53d67c4dcd9ab47907
parent594eb296fed7809a1e7faa714df5ca710f99a576 (diff)
downloadvboot-9b3e2cba5b3bdc87c5b1d5905a2ceea451036eb0.tar.gz
[unibuild] Fix issues with model specific fw sign
Updated the current coral config to use the fake keys from the loemkeys dev keyset (ACME) and then tested/debugged this flow based on that config. Fixed issue where key_id wasn't eval'd in bash when it was passed to grep because it has ' quotes around it. BUG=b:64842314 TEST=~/trunk/src/platform/vboot_reference/scripts/image_signing/sign_official_build.sh recovery ../build/images/coral/R62-9877.0.2017_08_25_1030-a1/recovery_image.bin ../platform/vboot_reference/tests/loemkeys coral_loem_signed_recovery.bin BRANCH=None Change-Id: I50a58e512e9a83dc2707951f12d709f9006d67ca Reviewed-on: https://chromium-review.googlesource.com/636344 Commit-Ready: C Shapiro <shapiroc@google.com> Tested-by: C Shapiro <shapiroc@google.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
-rwxr-xr-xscripts/image_signing/sign_official_build.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/image_signing/sign_official_build.sh b/scripts/image_signing/sign_official_build.sh
index 651726c1..d56c1569 100755
--- a/scripts/image_signing/sign_official_build.sh
+++ b/scripts/image_signing/sign_official_build.sh
@@ -582,8 +582,9 @@ resign_firmware_payload() {
# updater script will be looking for.
if [[ -e "${KEY_DIR}/loem.ini" ]]; then
# loem.ini has the format KEY_ID_VALUE = KEY_INDEX
- local key_index="$(grep '[0-9]\+ = ${key_id}' ${KEY_DIR}/loem.ini " \
- "| cut -d ' ' -f 1)"
+ local match="$(grep -E "[0-9]+ = ${key_id}" "${KEY_DIR}/loem.ini")"
+ local key_index="$(echo "${match}" | cut -d ' ' -f 1)"
+ info "Detected key index from loem.ini as ${key_index} for ${key_id}"
if [[ -z "${key_index}" ]]; then
die "Failed to find key_id ${key_id} in loem.ini file for model " \
"${model_name}"