mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 14:41:31 +02:00
grub_install: Use hd0,gpt1 as a hint when searching for root
In the context of load.cfg in the memdisk, root is set to memdisk, so passing it as a hint to search is not helpful. While we don't know for sure whether hd0 is the boot disk, it's a safe hint for most situations. Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
parent
8e46d15150
commit
e78a59cc65
@ -141,10 +141,11 @@ done
|
|||||||
info "Generating ${GRUB_DIR}/load.cfg"
|
info "Generating ${GRUB_DIR}/load.cfg"
|
||||||
# Include a small initial config in the core image to search for the ESP
|
# Include a small initial config in the core image to search for the ESP
|
||||||
# by filesystem ID in case the platform doesn't provide the boot disk.
|
# by filesystem ID in case the platform doesn't provide the boot disk.
|
||||||
# The existing $root value is given as a hint so it is searched first.
|
# $root points to memdisk here so instead use hd0,gpt1 as a hint so it is
|
||||||
|
# searched first.
|
||||||
ESP_FSID=$(sudo grub-probe -t fs_uuid -d "${LOOP_DEV}p1")
|
ESP_FSID=$(sudo grub-probe -t fs_uuid -d "${LOOP_DEV}p1")
|
||||||
sudo_clobber "${ESP_DIR}/${GRUB_DIR}/load.cfg" <<EOF
|
sudo_clobber "${ESP_DIR}/${GRUB_DIR}/load.cfg" <<EOF
|
||||||
search.fs_uuid ${ESP_FSID} root \$root
|
search.fs_uuid ${ESP_FSID} root hd0,gpt1
|
||||||
set prefix=(memdisk)
|
set prefix=(memdisk)
|
||||||
set
|
set
|
||||||
EOF
|
EOF
|
||||||
|
Loading…
x
Reference in New Issue
Block a user