From: Paul Barker <paul@pbarker.dev>
To: xiangyu.chen@eng.windriver.com,
openembedded-core@lists.openembedded.org, arindam.nath@amd.com
Subject: Re: [OE-core][PATCH] grub: update search parameter
Date: Thu, 05 Mar 2026 11:49:19 +0000 [thread overview]
Message-ID: <2c704d3b5aa8852a3d4e24143fdedb8f530517ae.camel@pbarker.dev> (raw)
In-Reply-To: <20260226081937.671793-1-xiangyu.chen@eng.windriver.com>
[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]
On Thu, 2026-02-26 at 16:19 +0800, Xiangyu Chen via
lists.openembedded.org wrote:
> From: Xiangyu Chen <xiangyu.chen@windriver.com>
>
> 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")
> Signed-off-by: Xiangyu Chen <xiangyu.chen@windriver.com>
> ---
> 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
I'm not sure that this can work for all use cases. The grub
documentatation for hints says "First try the device HINT" (i.e. it's
explicitly a device), whereas the documentation for cmdpath says that it
is "an absolute directory name".
Best regards,
--
Paul Barker
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
next prev parent reply other threads:[~2026-03-05 11:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 8:19 [OE-core][PATCH] grub: update search parameter Xiangyu Chen
2026-03-05 11:49 ` Paul Barker [this message]
2026-03-31 2:57 ` Xiangyu Chen
2026-04-23 6:04 ` Xiangyu Chen
2026-04-23 6:38 ` Yoann Congal
2026-04-23 7:18 ` Xiangyu Chen
2026-04-23 7:29 ` Yoann Congal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c704d3b5aa8852a3d4e24143fdedb8f530517ae.camel@pbarker.dev \
--to=paul@pbarker.dev \
--cc=arindam.nath@amd.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=xiangyu.chen@eng.windriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox