From 190eefb3ff227a229396091eef9012ad69d956df Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Fri, 30 Jan 2015 16:51:28 -0800 Subject: [PATCH] sign_official_build.sh should work without dev-firmware keys The signing scripts pass a bunch of args around, including paths to the keys used to sign dev-mode-specific firmware. That was only used on Alex and ZGB, so all the newer systems don't have those keys and the script falls over. This uses the normal firmware keys if the dev-firmware keys don't exist. This was an oversight with the original CL that touched resign_firmwarefd.sh BUG=chromium:453901 BRANCH=ToT TEST=manual Download a newer signed recovery image, say for nyan, and save it as scripts/image_signing/nyan-recovery-mp.bin Temporarily delete the developer firmware keys from the devkeys: rm -f tests/devkeys/dev_firmware* Now try resigning the recovery image: cd scripts/image_signing ./sign_official_build.sh recovery nyan-recovery-mp.bin \ ../../tests/devkeys/ signed.bin \ ../../tests/devkeys/key.versions It should work. Change-Id: I474811158cb33e16ad09c16b0db825c40217dd70 Signed-off-by: Bill Richardson Reviewed-on: https://chromium-review.googlesource.com/245151 Reviewed-by: Mike Frysinger --- scripts/image_signing/resign_firmwarefd.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/image_signing/resign_firmwarefd.sh b/scripts/image_signing/resign_firmwarefd.sh index 237d7cb2cb..d4cb5b8c99 100755 --- a/scripts/image_signing/resign_firmwarefd.sh +++ b/scripts/image_signing/resign_firmwarefd.sh @@ -29,6 +29,12 @@ PREAMBLE_FLAG=$9 LOEM_OUTPUT_DIR=${10} LOEMID=${11} +if [ ! -e $DEV_FIRMWARE_KEYBLOCK ] || [ ! -e $DEV_FIRMWARE_DATAKEY ] ; then + echo "No dev firmware keyblock/datakey found. Reusing normal keys." + DEV_FIRMWARE_KEYBLOCK="$FIRMWARE_KEYBLOCK" + DEV_FIRMWARE_DATAKEY="$FIRMWARE_DATAKEY" +fi + # pass optional args [ -n "$VERSION" ] && VERSION="--version $VERSION" [ -n "$PREAMBLE_FLAG" ] && PREAMBLE_FLAG="--flags $PREAMBLE_FLAG"