mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 14:41:31 +02:00
Use new grub2 variables to boot from the device with the bootloader
See http://codereview.chromium.org/2113004/show for details. This also adds a script to allow manual selection of the preferred image (A or B). BUG=none Review URL: http://codereview.chromium.org/2090006
This commit is contained in:
parent
2b6f8d140d
commit
9c5e5ecad3
23
build_image
23
build_image
@ -331,25 +331,18 @@ sudo mount "${ESP_LOOP_DEV}" "${ESP_DIR}"
|
|||||||
sudo mkdir -p "${ESP_DIR}/efi/boot"
|
sudo mkdir -p "${ESP_DIR}/efi/boot"
|
||||||
sudo grub-mkimage -p /efi/boot -o "${ESP_DIR}/efi/boot/bootx64.efi" \
|
sudo grub-mkimage -p /efi/boot -o "${ESP_DIR}/efi/boot/bootx64.efi" \
|
||||||
part_gpt fat ext2 normal boot sh chain configfile linux
|
part_gpt fat ext2 normal boot sh chain configfile linux
|
||||||
sudo cp "${ROOT_FS_DIR}/boot/vmlinuz" "${ESP_DIR}/efi/boot/vmlinuz"
|
cat <<'EOF' | sudo dd of="${ESP_DIR}/efi/boot/grub.cfg"
|
||||||
cat <<EOF | sudo dd of="${ESP_DIR}/efi/boot/grub.cfg"
|
|
||||||
set timeout=2
|
|
||||||
set default=0
|
set default=0
|
||||||
|
set timeout=2
|
||||||
|
|
||||||
menuentry "boot from disk" {
|
# NOTE: These magic grub variables are a Chrome OS hack. They are not portable.
|
||||||
linux /efi/boot/vmlinuz quiet console=tty2 init=/sbin/init boot=local rootwait root=/dev/sda3 ro noresume noswap i915.modeset=1 loglevel=1
|
|
||||||
|
menuentry "local image A" {
|
||||||
|
linux $grubpartA/boot/vmlinuz quiet console=tty2 init=/sbin/init boot=local rootwait root=/dev/$linuxpartA ro noresume noswap i915.modeset=1 loglevel=1
|
||||||
}
|
}
|
||||||
|
|
||||||
menuentry "boot from disk with serial debug" {
|
menuentry "local image B" {
|
||||||
linux /efi/boot/vmlinuz earlyprintk=serial,ttyS0,115200 console=ttyS0,115200 init=/sbin/init boot=local rootwait root=/dev/sda3 ro noresume noswap i915.modeset=1 loglevel=7
|
linux $grubpartB/boot/vmlinuz quiet console=tty2 init=/sbin/init boot=local rootwait root=/dev/$linuxpartB ro noresume noswap i915.modeset=1 loglevel=1
|
||||||
}
|
|
||||||
|
|
||||||
menuentry "boot from usb" {
|
|
||||||
linux /efi/boot/vmlinuz quiet console=tty2 init=/sbin/init boot=local rootwait root=/dev/sdb3 ro noresume noswap i915.modeset=1 loglevel=1
|
|
||||||
}
|
|
||||||
|
|
||||||
menuentry "boot from usb with serial debug" {
|
|
||||||
linux /efi/boot/vmlinuz earlyprintk=serial,ttyS0,115200 console=ttyS0,115200 init=/sbin/init boot=local rootwait root=/dev/sdb3 ro noresume noswap i915.modeset=1 loglevel=7
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
Loading…
x
Reference in New Issue
Block a user