2024年10月時点のgrub.cfgコピペ。UEFI32bitにも対応。
defaultA=2
defaultB=3
gptpriority $grubdisk 2 prioA
gptpriority $grubdisk 4 prioB
if [ $prioA -lt $prioB ]; then
set default=$defaultB
else
set default=$defaultA
fi
set timeout=2
# NOTE: These magic grub variables are a Chrome OS hack. They are not portable.
menuentry "local image A" {
linux /syslinux/vmlinuz.A quiet init=/sbin/init rootwait ro noresume
loglevel=7 noinitrd console= kvm-intel.vmentry_l1d_flush=always i915.modeset=1
cros_efi root=PARTUUID=6008351A-1204-194C-AA33-18862353C3A3
}
menuentry "local image B" {
linux /syslinux/vmlinuz.B quiet init=/sbin/init rootwait ro noresume
loglevel=7 noinitrd console= kvm-intel.vmentry_l1d_flush=always i915.modeset=1
cros_efi root=PARTUUID=FFB79E7E-7CB6-364D-899F-1552FB28E131
}
menuentry "verified image A" {
linux /syslinux/vmlinuz.A quiet init=/sbin/init rootwait ro noresume
loglevel=7 noinitrd console= kvm-intel.vmentry_l1d_flush=always
dm_verity.error_behavior=3 dm_verity.max_bios=-1 dm_verity.dev_wait=1
i915.modeset=1 cros_efi root=/dev/dm-0 dm="1 vroot none ro 1,0 4710400 verity
payload=PARTUUID=6008351A-1204-194C-AA33-18862353C3A3
hashtree=PARTUUID=6008351A-1204-194C-AA33-18862353C3A3 hashstart=4710400
alg=sha256
root_hexdigest=4965af8baebc11025ff284b835eb09f7e1d8fa77e49f86964cf8e8962c55a1ee
salt=a428438460b179c28239ed96c628d8b7971c35d7945576ced49b826f2fe9b15f"
}
menuentry "verified image B" {
linux /syslinux/vmlinuz.B quiet init=/sbin/init rootwait ro noresume
loglevel=7 noinitrd console= kvm-intel.vmentry_l1d_flush=always
dm_verity.error_behavior=3 dm_verity.max_bios=-1 dm_verity.dev_wait=1
i915.modeset=1 cros_efi root=/dev/dm-0 dm="1 vroot none ro 1,0 4710400 verity
payload=PARTUUID=FFB79E7E-7CB6-364D-899F-1552FB28E131
hashtree=PARTUUID=FFB79E7E-7CB6-364D-899F-1552FB28E131 hashstart=4710400
alg=sha256
root_hexdigest=4965af8baebc11025ff284b835eb09f7e1d8fa77e49f86964cf8e8962c55a1ee
salt=a428438460b179c28239ed96c628d8b7971c35d7945576ced49b826f2fe9b15f"
}
# FIXME: usb doesn't support verified boot for now
menuentry "Alternate USB Boot" {
linux (hd0,3)/boot/vmlinuz quiet init=/sbin/init rootwait ro noresume
loglevel=7 noinitrd console= kvm-intel.vmentry_l1d_flush=always
root=PARTUUID=6008351A-1204-194C-AA33-18862353C3A3 i915.modeset=1 cros_efi
}