From 1050e66c8f7c67ab8b3d1895e2559f03baeb2345 Mon Sep 17 00:00:00 2001 From: Jax Jiang Date: Fri, 11 Feb 2022 01:46:55 +0800 Subject: x86: grub2: search for the "kernel" filesystem on all disks Previously, grub2 was hardcoded to always look on "hd0" for the kernel. This works well when the system only had a single disk. But if there was a second disk/stick present, it may have look on the wrong drive because of enumeration races. This patch utilizes grub2 search function to look for a filesystem with the label "kernel". This works thanks to existing setup in scripts/gen_image_generic.sh. Which sets the "kernel" label on both the fat and ext4 filesystem variants. Signed-off-by: Jax Jiang Suggested-by: Alberto Bursi (MX100 WA) (word wrapped, slightly rewritten commit message, removed MX100 WA) Signed-off-by: Christian Lamparter --- target/linux/x86/image/grub-efi.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'target/linux/x86/image/grub-efi.cfg') diff --git a/target/linux/x86/image/grub-efi.cfg b/target/linux/x86/image/grub-efi.cfg index 14d30e88e4..bbb31f7747 100644 --- a/target/linux/x86/image/grub-efi.cfg +++ b/target/linux/x86/image/grub-efi.cfg @@ -3,7 +3,7 @@ set default="0" set timeout="@TIMEOUT@" -set root='(hd0,gpt1)' +search -l kernel -s root menuentry "@TITLE@" { linux /boot/vmlinuz @GPT_ROOTPART@ @CMDLINE@ noinitrd -- cgit v1.2.3