From 65f61f90ccae5f0b5f37ea3bdf86735bc58709a0 Mon Sep 17 00:00:00 2001 From: Amey Deshpande Date: Tue, 8 Mar 2016 12:05:53 -0800 Subject: signer: improve error handling in update_legacy_bootloader() BRANCH=None BUG=chromium:590933 TEST=Ran sign_official_build.sh locally and booted the image on kvm (using BIOS). $ ./sign_official_build.sh base chromiumos_base_image.bin \ ../../tests/devkeys chromiumos_base_image_signed.bin Change-Id: I2e1aad6e2073dea8e92d6ee25ac6972a5d555d71 Reviewed-on: https://chromium-review.googlesource.com/331661 Commit-Ready: Amey Deshpande Tested-by: Amey Deshpande Reviewed-by: Mike Frysinger --- scripts/image_signing/sign_official_build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/image_signing/sign_official_build.sh b/scripts/image_signing/sign_official_build.sh index a3f7c98e..83f31c6f 100755 --- a/scripts/image_signing/sign_official_build.sh +++ b/scripts/image_signing/sign_official_build.sh @@ -714,7 +714,11 @@ update_legacy_bootloader() { local esp_dir="$(make_temp_dir)" # We use the 'unsafe' variant because the EFI system partition is vfat type # and can be mounted in RW mode. - _mount_image_partition_retry "${image}" "${esp_partnum}" "${esp_dir}" + if ! _mount_image_partition_retry "${image}" "${esp_partnum}" \ + "${esp_dir}"; then + error "Could not mount EFI partition for updating legacy bootloader cfg." + return 1 + fi # If we can't find the dm parameter in the kernel config, bail out now. local kernel_config=$(grab_kernel_config "${image}" "${dm_partno}") -- cgit v1.2.1