diff mbox series

efi_loader: Print extra information from the bootmgr

Message ID 20250328125819.1080935-1-ilias.apalodimas@linaro.org
State Accepted
Commit f5e0f2198ec1226b4fd0121439facc30cb886a2a
Headers show
Series efi_loader: Print extra information from the bootmgr | expand

Commit Message

Ilias Apalodimas March 28, 2025, 12:58 p.m. UTC
Instead of just printing the label, add information for the Device
path as well so it's easier to see if we are booting from disk, network
etc

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
---
 lib/efi_loader/efi_bootmgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Heinrich Schuchardt April 11, 2025, 7:08 a.m. UTC | #1
On 3/28/25 13:58, Ilias Apalodimas wrote:
> Instead of just printing the label, add information for the Device
> path as well so it's easier to see if we are booting from disk, network
> etc
>
> Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> ---
>   lib/efi_loader/efi_bootmgr.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
> index f9534ef85edb..6b9d809ff618 100644
> --- a/lib/efi_loader/efi_bootmgr.c
> +++ b/lib/efi_loader/efi_bootmgr.c
> @@ -690,7 +690,7 @@ static efi_status_t try_load_entry(u16 n, efi_handle_t *handle,
>   			goto error;
>   	}
>
> -	log_info("Booting: %ls\n", lo.label);
> +	log_info("Booting: Label: %ls Device path: %pD\n", lo.label, lo.file_path);

I think we can remove "Label:" and but "Device path:" on a new line.

The output is truncated according to CONFIG_SYS_PBSIZE=276:

Booting: Label: nvme 0 Device path:
/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,6d00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5500000002000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,550000000300

In this case the filename is not shown at all.

efi_dp_shorten() might help to provide a printable output.

But I don't believe that a non-developer would have a benefit from an
output like:

HD(2,GPT,54e58a03-c1db-4c6b-afda-24340c39cda5,0x109000,0x32000)\EFI\ubuntu\bootriscv64.efi)

I would not know the GUIDs for my partitions by heart.

Isn't log_debug() more adequate here?

Best regards

Heinrich

>
>   	/* Ignore the optional data in auto-generated boot options */
>   	if (size >= sizeof(efi_guid_t) &&
Ilias Apalodimas April 11, 2025, 9:42 a.m. UTC | #2
On Fri, 11 Apr 2025 at 10:08, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> On 3/28/25 13:58, Ilias Apalodimas wrote:
> > Instead of just printing the label, add information for the Device
> > path as well so it's easier to see if we are booting from disk, network
> > etc
> >
> > Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> > ---
> >   lib/efi_loader/efi_bootmgr.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
> > index f9534ef85edb..6b9d809ff618 100644
> > --- a/lib/efi_loader/efi_bootmgr.c
> > +++ b/lib/efi_loader/efi_bootmgr.c
> > @@ -690,7 +690,7 @@ static efi_status_t try_load_entry(u16 n, efi_handle_t *handle,
> >                       goto error;
> >       }
> >
> > -     log_info("Booting: %ls\n", lo.label);
> > +     log_info("Booting: Label: %ls Device path: %pD\n", lo.label, lo.file_path);
>
> I think we can remove "Label:" and but "Device path:" on a new line.
>
> The output is truncated according to CONFIG_SYS_PBSIZE=276:
>
> Booting: Label: nvme 0 Device path:
> /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,6d00000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,5500000002000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,550000000300
>
> In this case the filename is not shown at all.
>
> efi_dp_shorten() might help to provide a printable output.
>
> But I don't believe that a non-developer would have a benefit from an
> output like:
>
> HD(2,GPT,54e58a03-c1db-4c6b-afda-24340c39cda5,0x109000,0x32000)\EFI\ubuntu\bootriscv64.efi)
>
> I would not know the GUIDs for my partitions by heart.
>
> Isn't log_debug() more adequate here?

I dont have a strong opinion tbh. I was mostly driver by looking into
EDK2 which prints something along the lines of
URI: http://<URL>/image.img

I can either switch to log_debug or print a human readable form I guess.

Thanks
/Ilias
>
> Best regards
>
> Heinrich
>
> >
> >       /* Ignore the optional data in auto-generated boot options */
> >       if (size >= sizeof(efi_guid_t) &&
>
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
index f9534ef85edb..6b9d809ff618 100644
--- a/lib/efi_loader/efi_bootmgr.c
+++ b/lib/efi_loader/efi_bootmgr.c
@@ -690,7 +690,7 @@  static efi_status_t try_load_entry(u16 n, efi_handle_t *handle,
 			goto error;
 	}
 
-	log_info("Booting: %ls\n", lo.label);
+	log_info("Booting: Label: %ls Device path: %pD\n", lo.label, lo.file_path);
 
 	/* Ignore the optional data in auto-generated boot options */
 	if (size >= sizeof(efi_guid_t) &&