summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Engelbrecht <engeg@google.com>2021-03-01 21:46:14 -0700
committerCommit Bot <commit-bot@chromium.org>2021-03-10 01:15:22 +0000
commitce7171190f1975d1ea3e65a1d46d640ebc243d9e (patch)
treec86149f40eeb34f075d03d4ce1b61b083096eb9b
parenta2b582f6e1915f061bd89214560736ed34cceef7 (diff)
downloadvboot-ce7171190f1975d1ea3e65a1d46d640ebc243d9e.tar.gz
sign_gsc_firmware: support rewriting filename
When the gsc signer reads the contents of the payload it finds out if it is a cr50 or ti50 chip. We write the chip type to a .rename file next to the bin (which has a @CHIP@ in the path) so that the signer can rename the artifact for placement. Signed-off-by: George Engelbrecht <engeg@google.com> BRANCH=None BUG=b:179964270 TEST=local signer Change-Id: I0600cb60bb614111802119293ba0c63f2b61c231 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2728736 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: George Engelbrecht <engeg@google.com> Tested-by: George Engelbrecht <engeg@google.com>
-rwxr-xr-xscripts/image_signing/sign_gsc_firmware.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/image_signing/sign_gsc_firmware.sh b/scripts/image_signing/sign_gsc_firmware.sh
index 30e27950..bc5b89ac 100755
--- a/scripts/image_signing/sign_gsc_firmware.sh
+++ b/scripts/image_signing/sign_gsc_firmware.sh
@@ -492,6 +492,7 @@ sign_gsc_firmware() {
local output_file="$9"
local generation="${10}"
local temp_dir
+ local chip_name
temp_dir="$(make_temp_dir)"
@@ -500,11 +501,13 @@ sign_gsc_firmware() {
# H1 flash size, image size must match.
IMAGE_SIZE="$(( 512 * 1024 ))"
IMAGE_BASE="0x40000"
+ chip_name="cr50"
;;
(d)
# D2 flash size, image size must match.
IMAGE_SIZE="$(( 1024 * 1024 ))"
IMAGE_BASE="0x80000"
+ chip_name="ti50"
;;
esac
@@ -544,6 +547,9 @@ sign_gsc_firmware() {
paste_bin "${output_file}" "${bin}" "${IMAGE_BASE}" "${hex_base}"
done
+ # Tell the signer how to rename the @CHIP@ portion of the output.
+ echo "${chip_name}" > "${output_file}.rename"
+
info "Image successfully signed to ${output_file}"
}