From 4ba20a90ff45bf7dd2fb5144ebd7b49a4928b280 Mon Sep 17 00:00:00 2001 From: Xiangyu Chen Date: Thu, 23 Apr 2026 15:25:31 +0800 Subject: [PATCH] grub: update search parameter [ Upstream commit 42b530581f7246b3143ee50e3c6f981dcbb1dc74 ] Grub would report an error message in boot stage as below: "error: no such device: ((hd0,gpt1)/EFI/BOOT)/EFI/BOOT/grub.cfg" Consequently, the root variable is not set, and the intended protection against cross-device configuration loading (the purpose of the original 2014 commit) is lost. The most robust fix is to use the --hint parameter. This separates the search target from the device hint, avoiding fragile string concatenation and supporting both prefixed and non-prefixed $cmdpath formats. Fixes: 5ce73b6055ac ("grub: add cmdpath to grub configuration file") (From OE-Core rev: 2f509e353e2fc04923fc742312c81ed69b419643) Signed-off-by: Xiangyu Chen Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie Signed-off-by: Xiangyu Chen Signed-off-by: Yoann Congal Signed-off-by: Paul Barker --- meta/recipes-bsp/grub/files/cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/recipes-bsp/grub/files/cfg b/meta/recipes-bsp/grub/files/cfg index 8ca53d24d7..8fe1a8d0c7 100644 --- a/meta/recipes-bsp/grub/files/cfg +++ b/meta/recipes-bsp/grub/files/cfg @@ -1,2 +1,2 @@ -search.file ($cmdpath)/EFI/BOOT/grub.cfg root +search --file --set=root --hint-efi=$cmdpath /EFI/BOOT/grub.cfg set prefix=($root)/EFI/BOOT