In grub_disk_open() don't override error message when no _valid_ device can be found, instead use the one set from the last function which failed, which is more informative.
The current message "disk not found" discards precious info about the reason of the failure; for instance the disk may exist but cannot be opened because of permissions issues, in this case telling "disk not found" is inaccurate and may mislead the user about the actual cause of the failure. https://savannah.gnu.org/bugs/?42409 --- grub-core/kern/disk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/grub-core/kern/disk.c b/grub-core/kern/disk.c index 789f8c0..eb40523 100644 --- a/grub-core/kern/disk.c +++ b/grub-core/kern/disk.c @@ -233,8 +233,7 @@ grub_disk_open (const char *name) if (! dev) { - grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("disk `%s' not found"), - name); + grub_errno = GRUB_ERR_UNKNOWN_DEVICE; goto fail; } if (disk->log_sector_size > GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS -- 2.9.3 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel