summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2011-04-13 08:27:10 +0800
committerHung-Te Lin <hungte@chromium.org>2011-04-13 08:27:10 +0800
commitb5633c6f65ac593769d615970a146717ee4d328c (patch)
treed9773d888d1bfa0e10b9f6babefc9b2041f4a7b2 /scripts
parent41f444a11b267285a41a22a996a86a249c99549c (diff)
downloadvboot-b5633c6f65ac593769d615970a146717ee4d328c.tar.gz
make_dev_ssd.sh: support updating legacy boot partitions
Change the boot default option in partition 12 (ESP) when we want to disable rootfs verification. BUG=chromium-os:12424 TEST=./make_dev_ssd --remove_rootfs_verification --recovery_key -i USB_IMAGE # the image is bootable by H2C and H2C BIOS(EFI). # Not tried on non-EFI (syslinux) firmware, but it should work. Change-Id: I7533bb73597041bbdc8cc57e4e8baaf6ca242309 R=wfrichar@chromium.org Review URL: http://codereview.chromium.org/6813109
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/image_signing/make_dev_ssd.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/image_signing/make_dev_ssd.sh b/scripts/image_signing/make_dev_ssd.sh
index a9f36a0f..17e84977 100755
--- a/scripts/image_signing/make_dev_ssd.sh
+++ b/scripts/image_signing/make_dev_ssd.sh
@@ -61,6 +61,22 @@ is_rootfs_verification_enabled() {
echo "$*" | grep -q 'root=/dev/dm-0'
}
+remove_legacy_boot_rootfs_verification() {
+ # See src/scripts/create_legacy_bootloader_templates
+ local image="$1"
+ local mount_point="$(make_temp_dir)"
+ local config_file
+ debug_msg "Removing rootfs verification for legacy boot configuration."
+ mount_image_partition "$image" 12 "$mount_point" || return $FLAGS_FALSE
+ config_file="$mount_point/efi/boot/grub.cfg"
+ [ ! -f "$config_file" ] ||
+ sudo sed -i 's/^ *set default=2 *$/set default=0/g' "$config_file"
+ config_file="$mount_point/syslinux/default.cfg"
+ [ ! -f "$config_file" ] ||
+ sudo sed -i 's/-vusb/-usb/g; s/-vhd/-hd/g' "$config_file"
+ sudo umount "$mount_point"
+}
+
# Wrapped version of dd
mydd() {
# oflag=sync is safer, but since we need bs=512, syncing every block would be
@@ -158,6 +174,7 @@ resign_ssd_kernel() {
kernel_config="$(remove_rootfs_verification "$kernel_config")"
debug_msg "New kernel config: $kernel_config"
echo "$name: Disabled rootfs verification."
+ remove_legacy_boot_rootfs_verification "$ssd_device"
fi
local new_kernel_config_file="$(make_temp_file)"
@@ -287,4 +304,11 @@ main() {
fi
}
+# People using this to process images may forget to add "-i",
+# so adding parameter check is safer.
+if [ "$#" -gt 0 ]; then
+ flags_help
+ err_die "Unknown parameters: $@"
+fi
+
main