Hi Paul,

On 3/5/26 19:49, Paul Barker wrote:
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".
While the documentation defines $cmdpath as a directory and hints as devices, grub’s internal implementation of grub_disk_open (grub-core/kern/disk.c [1]) is designed to handle this exact "device+path" format.

When a hint like (hd0,gpt1)/EFI/BOOT/ is passed, grub_disk_open calls find_part_sep to locate the partition/path delimiter. It then uses grub_memcpy to extract only the device part (e.g., (hd0) into the raw buffer for the disk driver.

The remaining string (gpt1)/EFI/BOOT/) is passed to grub_partition_probe, which identifies the partition and gracefully
ignores the trailing directory path.

The current syntax ($cmdpath) results in double parentheses ((hd0...)) if the variable is already populated. In grub_disk_open, this extracts a malformed device name ((hd0 which no driver can open, triggering a hard no such device error.


Ref:

[1] https://elixir.bootlin.com/grub/grub-2.14/source/grub-core/kern/disk.c#L192


Br,

Xiangyu

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#234261): 
https://lists.openembedded.org/g/openembedded-core/message/234261
Mute This Topic: https://lists.openembedded.org/mt/118009422/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to