summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2015-01-28 13:23:15 +0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-28 11:14:03 +0000
commit40837258677fca4b9bfb37b7bfb288baf40831e0 (patch)
tree6e88013c4052c5e88f89e8da605aa55bf0b92dbe
parent5fb14634b9f7618592b9e88d9aa74b2111f15ee1 (diff)
downloadvboot-stabilize-6736.B.tar.gz
sign_official_buid: Fix "incorrect rootfs hash" when image has no firmware updater .stabilize-6736.B
For each mount_image_partition, we have to unmount explicitly before doing other changes (especially when using dd) to image. Otherwise system may flush data when releaseing loop device and cause output image to be corrupted. BUG=chromium:449450 TEST=sign_official_build.sh factory factory_install_shim.bin \ ../../../tests/devkeys signed.bin ../../../tests/devkeys/key.versions sign_official_build.sh verify signed.bin BRANCH=signer Change-Id: I20756d9769c3737e25cfea348a9a4d64cc43b202 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/243496 Reviewed-by: Mike Frysinger <vapier@chromium.org>
-rwxr-xr-xscripts/image_signing/sign_official_build.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/image_signing/sign_official_build.sh b/scripts/image_signing/sign_official_build.sh
index f6126878..8d782add 100755
--- a/scripts/image_signing/sign_official_build.sh
+++ b/scripts/image_signing/sign_official_build.sh
@@ -476,9 +476,12 @@ resign_firmware_payload() {
local shellball_dir=$(make_temp_dir)
# extract_firmware_bundle can fail if the image has no firmware update.
- extract_firmware_bundle "${firmware_bundle}" "${shellball_dir}" ||
- { echo "Didn't find a firmware update. Not signing firmware."
- return; }
+ if ! extract_firmware_bundle "${firmware_bundle}" "${shellball_dir}"; then
+ # Unmount now to prevent changes.
+ sudo umount "${rootfs_dir}"
+ echo "Didn't find a firmware update. Not signing firmware."
+ return
+ fi
echo "Found a valid firmware update shellball."
local image_file sign_args=() loem_sfx loem_output_dir