Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: update_bootloaders.sh

Issue 6549034: kernel build: use %U+1 for dm-verity booting (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/crosutils.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mod_image_for_recovery.sh ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: update_bootloaders.sh
diff --git a/update_bootloaders.sh b/update_bootloaders.sh
index 0b34172dcc3bb1305bfbd96f2879fe83db953e32..de9ccdfe6b43f5e48b35eb8eea2acc7333ff8c27 100755
--- a/update_bootloaders.sh
+++ b/update_bootloaders.sh
@@ -77,7 +77,7 @@ set -e
# be set when the rootfs is stuffed.
if ! type -p update_x86_bootloaders; then
update_x86_bootloaders() {
- local old_root="$1" # e.g., sd%D%P
+ local old_root="$1" # e.g., /dev/sd%D%P or %U+1
local kernel_cmdline="$2"
local esp_fs_dir="$3"
local template_dir="$4"
@@ -89,25 +89,25 @@ if ! type -p update_x86_bootloaders; then
fi
# Rewrite grub table
- grub_dm_table_a=${dm_table//${old_root}/\$linuxpartA}
- grub_dm_table_b=${dm_table//${old_root}/\$linuxpartB}
+ grub_dm_table_a=${dm_table//${old_root}/\/dev\/\$linuxpartA}
+ grub_dm_table_b=${dm_table//${old_root}/\/dev\/\$linuxpartB}
sed -e "s|DMTABLEA|${grub_dm_table_a}|g" \
-e "s|DMTABLEB|${grub_dm_table_b}|g" \
"${template_dir}"/efi/boot/grub.cfg |
sudo dd of="${esp_fs_dir}"/efi/boot/grub.cfg
# Rewrite syslinux DM_TABLE
- syslinux_dm_table_usb=${dm_table//\/dev\/${old_root}/${FLAGS_usb_disk}}
+ syslinux_dm_table_usb=${dm_table//${old_root}/${FLAGS_usb_disk}}
sed -e "s|DMTABLEA|${syslinux_dm_table_usb}|g" \
"${template_dir}"/syslinux/usb.A.cfg |
sudo dd of="${esp_fs_dir}"/syslinux/usb.A.cfg
- syslinux_dm_table_a=${dm_table//\/dev\/${old_root}/HDROOTA}
+ syslinux_dm_table_a=${dm_table//${old_root}/HDROOTA}
sed -e "s|DMTABLEA|${syslinux_dm_table_a}|g" \
"${template_dir}"/syslinux/root.A.cfg |
sudo dd of="${esp_fs_dir}"/syslinux/root.A.cfg
- syslinux_dm_table_b=${dm_table//\/dev\/${old_root}/HDROOTB}
+ syslinux_dm_table_b=${dm_table//${old_root}/HDROOTB}
sed -e "s|DMTABLEB|${syslinux_dm_table_b}|g" \
"${template_dir}"/syslinux/root.B.cfg |
sudo dd of="${esp_fs_dir}"/syslinux/root.B.cfg
@@ -117,7 +117,7 @@ if ! type -p update_x86_bootloaders; then
sudo cp -f "${template_dir}"/vmlinuz "${esp_fs_dir}"/syslinux/vmlinuz.B
# The only work left for the installer is to pick the correct defaults
- # and replace HDROOTA and HDROOTB with the correct /dev/sd%D%P.
+ # and replace HDROOTA and HDROOTB with the correct /dev/sd%D%P/%U+1
}
fi
@@ -187,7 +187,7 @@ if [[ "${FLAGS_arch}" = "x86" ]]; then
# Extract kernel flags
kernel_cfg=
- old_root="sd%D%P"
+ old_root="%U+1"
if [[ -n "${FLAGS_kernel_cmdline}" ]]; then
info "Using supplied kernel_cmdline to update templates."
kernel_cfg="${FLAGS_kernel_cmdline}"
« no previous file with comments | « mod_image_for_recovery.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698