sign_official_build: retain /boot for EFI devices
authorAmey Deshpande <ameyd@google.com>
Tue, 29 Mar 2016 21:31:54 +0000 (14:31 -0700)
committerchrome-bot <chrome-bot@chromium.org>
Fri, 22 Apr 2016 22:43:26 +0000 (15:43 -0700)
TEST=Ran sign_official_build locally on image w/ cros_efi and checked
the signed image had /boot in rootfs.
BUG=chromium:604967
BRANCH=None

Change-Id: Id6e1a6409e07fa37a5c116c66ac937dd9aec1481
Reviewed-on: https://chromium-review.googlesource.com/335469
Commit-Ready: Amey Deshpande <ameyd@google.com>
Tested-by: Amey Deshpande <ameyd@google.com>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
scripts/image_signing/sign_official_build.sh

index 83f31c6..4f3407e 100755 (executable)
@@ -775,12 +775,14 @@ sign_image_file() {
   # We do NOT strip /boot for factory installer, since some devices need it to
   # boot EFI. crbug.com/260512 would obsolete this requirement.
   #
-  # We also do NOT strip /boot for legacy BIOS devices.  This is because
-  # "cros_installer postinst" on legacy BIOS relies on presence of /boot in
-  # rootfs.  We infer the BIOS type from the kernel config.
+  # We also do NOT strip /boot for legacy BIOS or EFI devices.  This is because
+  # "cros_installer postinst" on BIOS or EFI systems relies on presence of
+  # /boot in rootfs to update kernel.  We infer the BIOS type from the kernel
+  # config.
   local kerna_config="$(grab_kernel_config "${input}" 2)"
   if [[ "${image_type}" != "factory_install" &&
-        " ${kerna_config} " != *" cros_legacy "* ]]; then
+        " ${kerna_config} " != *" cros_legacy "* &&
+        " ${kerna_config} " != *" cros_efi "* ]]; then
     "${SCRIPT_DIR}/strip_boot_from_image.sh" --image "${output}"
   fi
   update_rootfs_hash "${output}" "${dm_partno}" \