From 05371345b75454c20a12433384a0d5dc29064f07 Mon Sep 17 00:00:00 2001 From: Amey Deshpande Date: Thu, 21 May 2015 14:46:06 -0700 Subject: sign_official_build: preserve /boot for legacy BIOS This patch checks for 'cros_legacy' in the kernel config, and skips running strip_boot_from_image.sh if present. This is because 'cros_installer postinst' on legacy BIOS relies on presence of /boot in rootfs. BRANCH=signer BUG=b:20947354 TEST=Ran the script with devkeys, and checked presence of /boot in the signed .bin file by mounting locally $ ./sign_official_build.sh ssd chromiumos_image.bin ../../tests/devkeys \ chromiumos_image_signed.bin ../../tests/devkeys/key.versions Change-Id: Ieb919067b353839019bc1c561d7bb66bebac1040 Reviewed-on: https://chromium-review.googlesource.com/272742 Tested-by: Amey Deshpande Reviewed-by: Mike Frysinger Commit-Queue: Amey Deshpande --- scripts/image_signing/sign_official_build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/image_signing/sign_official_build.sh b/scripts/image_signing/sign_official_build.sh index 53c9ef5a..52721063 100755 --- a/scripts/image_signing/sign_official_build.sh +++ b/scripts/image_signing/sign_official_build.sh @@ -663,7 +663,13 @@ sign_image_file() { resign_firmware_payload "${output}" # We do NOT strip /boot for factory installer, since some devices need it to # boot EFI. crbug.com/260512 would obsolete this requirement. - if [[ "${image_type}" != "factory_install" ]]; then + # + # 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. + local kerna_config="$(grab_kernel_config "${input}" 2)" + if [[ "${image_type}" != "factory_install" && + " ${kerna_config} " != *" cros_legacy "* ]]; then "${SCRIPT_DIR}/strip_boot_from_image.sh" --image "${output}" fi update_rootfs_hash "${output}" "${dm_partno}" \ -- cgit v1.2.1