Skip to content

Commit

Permalink
grub_fs_probe(): dprint errors from filesystems
Browse files Browse the repository at this point in the history
When filesystem detection fails, all that's currently debug-logged is a
series of messages like:

    grub-core/kern/fs.c:56:fs: Detecting ntfs...
    grub-core/kern/fs.c:76:fs: ntfs detection failed.

repeated for each filesystem.  Any messages provided to grub_error() by
the filesystem are lost, and one has to break out gdb to figure out what
went wrong.

With this change, one instead sees:

    grub-core/kern/fs.c:56:fs: Detecting fat...
    grub-core/osdep/hostdisk.c:357:hostdisk: reusing open device
    `/path/to/device'
    grub-core/kern/fs.c:77:fs: error: invalid modification timestamp for /.
    grub-core/kern/fs.c:79:fs: fat detection failed.

in the debug prints.

Signed-off-by: Robbie Harwood <[email protected]>
(cherry picked from commit 838c79d658797d0662ee7f9e033e38ee88059e02)
  • Loading branch information
frozencemetery committed Jul 19, 2022
1 parent ed4aad4 commit 8436d90
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions grub-core/kern/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ grub_fs_probe (grub_device_t device)
if (grub_errno == GRUB_ERR_NONE)
return p;

grub_dprintf ("fs", _("error: %s.\n"), grub_errmsg);
grub_error_push ();
grub_dprintf ("fs", "%s detection failed.\n", p->name);
grub_error_pop ();
Expand Down

0 comments on commit 8436d90

Please sign in to comment.