All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] efi_loader: bootmgr: print a message when loading from BootNext failed
@ 2019-05-28 10:13 Heinrich Schuchardt
  2019-05-29  9:40 ` Alexander Graf
  0 siblings, 1 reply; 4+ messages in thread
From: Heinrich Schuchardt @ 2019-05-28 10:13 UTC (permalink / raw)
  To: u-boot

From: AKASHI Takahiro <takahiro.akashi@linaro.org>

If a user defines BootNext but not BootOrder and loading from BootNext
fails, you will see only a message like this:
	BootOrder not defined

This may confuse a user. Adding an error message will be helpful.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

Adjust message for fallback from BootNext to BootOrder.

An example output looks like this:

=> bootefi bootmgr
Loading from Boot0010 failed
Loading from BootNext failed, falling back to BootOrder
Loading from Boot0002 failed
Loading from Boot0003 failed
Loading from Boot0004 failed
EFI boot manager: Cannot load any image

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 lib/efi_loader/efi_bootmgr.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
index 7bf51874c1..00de8165d0 100644
--- a/lib/efi_loader/efi_bootmgr.c
+++ b/lib/efi_loader/efi_bootmgr.c
@@ -149,8 +149,10 @@ static efi_status_t try_load_entry(u16 n, efi_handle_t *handle)

 		ret = EFI_CALL(efi_load_image(true, efi_root, lo.file_path,
 					      NULL, 0, handle));
-		if (ret != EFI_SUCCESS)
+		if (ret != EFI_SUCCESS) {
+			printf("Loading from Boot%04X failed\n", n);
 			goto error;
+		}

 		attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS |
 			     EFI_VARIABLE_RUNTIME_ACCESS;
@@ -215,6 +217,7 @@ efi_status_t efi_bootmgr_load(efi_handle_t *handle)
 				ret = try_load_entry(bootnext, handle);
 				if (ret == EFI_SUCCESS)
 					return ret;
+				printf("Loading from BootNext failed, falling back to BootOrder\n");
 			}
 		} else {
 			printf("Deleting BootNext failed\n");
--
2.20.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 1/1] efi_loader: bootmgr: print a message when loading from BootNext failed
  2019-05-28 10:13 [U-Boot] [PATCH 1/1] efi_loader: bootmgr: print a message when loading from BootNext failed Heinrich Schuchardt
@ 2019-05-29  9:40 ` Alexander Graf
  2019-05-29 10:59   ` Heinrich Schuchardt
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Graf @ 2019-05-29  9:40 UTC (permalink / raw)
  To: u-boot


On 28.05.19 12:13, Heinrich Schuchardt wrote:
> From: AKASHI Takahiro <takahiro.akashi@linaro.org>
>
> If a user defines BootNext but not BootOrder and loading from BootNext
> fails, you will see only a message like this:
> 	BootOrder not defined
>
> This may confuse a user. Adding an error message will be helpful.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>


Why is the SoB line in the middle of the patch description?


> Adjust message for fallback from BootNext to BootOrder.
>
> An example output looks like this:
>
> => bootefi bootmgr
> Loading from Boot0010 failed
> Loading from BootNext failed, falling back to BootOrder
> Loading from Boot0002 failed
> Loading from Boot0003 failed
> Loading from Boot0004 failed


How hard would it be to print the device path for the respective 
BootXXXX entries as well? Users usually don't think in boot entries.


Alex


> EFI boot manager: Cannot load any image
>
> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>   lib/efi_loader/efi_bootmgr.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
> index 7bf51874c1..00de8165d0 100644
> --- a/lib/efi_loader/efi_bootmgr.c
> +++ b/lib/efi_loader/efi_bootmgr.c
> @@ -149,8 +149,10 @@ static efi_status_t try_load_entry(u16 n, efi_handle_t *handle)
>
>   		ret = EFI_CALL(efi_load_image(true, efi_root, lo.file_path,
>   					      NULL, 0, handle));
> -		if (ret != EFI_SUCCESS)
> +		if (ret != EFI_SUCCESS) {
> +			printf("Loading from Boot%04X failed\n", n);
>   			goto error;
> +		}
>
>   		attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS |
>   			     EFI_VARIABLE_RUNTIME_ACCESS;
> @@ -215,6 +217,7 @@ efi_status_t efi_bootmgr_load(efi_handle_t *handle)
>   				ret = try_load_entry(bootnext, handle);
>   				if (ret == EFI_SUCCESS)
>   					return ret;
> +				printf("Loading from BootNext failed, falling back to BootOrder\n");
>   			}
>   		} else {
>   			printf("Deleting BootNext failed\n");
> --
> 2.20.1
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 1/1] efi_loader: bootmgr: print a message when loading from BootNext failed
  2019-05-29  9:40 ` Alexander Graf
@ 2019-05-29 10:59   ` Heinrich Schuchardt
  2019-05-29 12:39     ` Alexander Graf
  0 siblings, 1 reply; 4+ messages in thread
From: Heinrich Schuchardt @ 2019-05-29 10:59 UTC (permalink / raw)
  To: u-boot

On 5/29/19 11:40 AM, Alexander Graf wrote:
>
> On 28.05.19 12:13, Heinrich Schuchardt wrote:
>> From: AKASHI Takahiro <takahiro.akashi@linaro.org>
>>
>> If a user defines BootNext but not BootOrder and loading from BootNext
>> fails, you will see only a message like this:
>>     BootOrder not defined
>>
>> This may confuse a user. Adding an error message will be helpful.
>>
>> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
>
>
> Why is the SoB line in the middle of the patch description?

Everything below was not in Takahiros patch.

>
>
>> Adjust message for fallback from BootNext to BootOrder.
>>
>> An example output looks like this:
>>
>> => bootefi bootmgr
>> Loading from Boot0010 failed
>> Loading from BootNext failed, falling back to BootOrder
>> Loading from Boot0002 failed
>> Loading from Boot0003 failed
>> Loading from Boot0004 failed
>
>
> How hard would it be to print the device path for the respective
> BootXXXX entries as well? Users usually don't think in boot entries.

The change is trivial. Output could look like

=> efidebug boot add 0001 label1 scsi 0:1 "\path1\file1.efi"
=> efidebug boot add 0002 label2 scsi 0:1 "\path2\file2.efi"
=> efidebug boot order 0001 0002
=> bootefi bootmgr
Loading from Boot0001
(/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(0,0)/HD(1,MBR,0x1bb2fc9c,0x800,0x3fffe)/\path1\file1.efi)
failed
Loading from Boot0002
(/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(0,0)/HD(1,MBR,0x1bb2fc9c,0x800,0x3fffe)/\path2\file2.efi)
failed
EFI boot manager: Cannot load any image
=>

But as you see it does not fit into 80 character lines and the terminal
might cut of the interesting part of the line. Failure may also depend
on the command line parameters.

I think adding the label makes more sense.

Best regards

Heinrich

>
>
> Alex
>
>
>> EFI boot manager: Cannot load any image
>>
>> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
>> ---
>>   lib/efi_loader/efi_bootmgr.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
>> index 7bf51874c1..00de8165d0 100644
>> --- a/lib/efi_loader/efi_bootmgr.c
>> +++ b/lib/efi_loader/efi_bootmgr.c
>> @@ -149,8 +149,10 @@ static efi_status_t try_load_entry(u16 n,
>> efi_handle_t *handle)
>>
>>           ret = EFI_CALL(efi_load_image(true, efi_root, lo.file_path,
>>                             NULL, 0, handle));
>> -        if (ret != EFI_SUCCESS)
>> +        if (ret != EFI_SUCCESS) {
>> +            printf("Loading from Boot%04X failed\n", n);
>>               goto error;
>> +        }
>>
>>           attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS |
>>                    EFI_VARIABLE_RUNTIME_ACCESS;
>> @@ -215,6 +217,7 @@ efi_status_t efi_bootmgr_load(efi_handle_t *handle)
>>                   ret = try_load_entry(bootnext, handle);
>>                   if (ret == EFI_SUCCESS)
>>                       return ret;
>> +                printf("Loading from BootNext failed, falling back to
>> BootOrder\n");
>>               }
>>           } else {
>>               printf("Deleting BootNext failed\n");
>> --
>> 2.20.1
>>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 1/1] efi_loader: bootmgr: print a message when loading from BootNext failed
  2019-05-29 10:59   ` Heinrich Schuchardt
@ 2019-05-29 12:39     ` Alexander Graf
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2019-05-29 12:39 UTC (permalink / raw)
  To: u-boot



> Am 29.05.2019 um 12:59 schrieb Heinrich Schuchardt <xypron.glpk@gmx.de>:
> 
>> On 5/29/19 11:40 AM, Alexander Graf wrote:
>> 
>>> On 28.05.19 12:13, Heinrich Schuchardt wrote:
>>> From: AKASHI Takahiro <takahiro.akashi@linaro.org>
>>> 
>>> If a user defines BootNext but not BootOrder and loading from BootNext
>>> fails, you will see only a message like this:
>>>     BootOrder not defined
>>> 
>>> This may confuse a user. Adding an error message will be helpful.
>>> 
>>> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
>> 
>> 
>> Why is the SoB line in the middle of the patch description?
> 
> Everything below was not in Takahiros patch.

The SoB still comes at the end though :).

> 
>> 
>> 
>>> Adjust message for fallback from BootNext to BootOrder.
>>> 
>>> An example output looks like this:
>>> 
>>> => bootefi bootmgr
>>> Loading from Boot0010 failed
>>> Loading from BootNext failed, falling back to BootOrder
>>> Loading from Boot0002 failed
>>> Loading from Boot0003 failed
>>> Loading from Boot0004 failed
>> 
>> 
>> How hard would it be to print the device path for the respective
>> BootXXXX entries as well? Users usually don't think in boot entries.
> 
> The change is trivial. Output could look like
> 
> => efidebug boot add 0001 label1 scsi 0:1 "\path1\file1.efi"
> => efidebug boot add 0002 label2 scsi 0:1 "\path2\file2.efi"
> => efidebug boot order 0001 0002
> => bootefi bootmgr
> Loading from Boot0001
> (/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(0,0)/HD(1,MBR,0x1bb2fc9c,0x800,0x3fffe)/\path1\file1.efi)
> failed
> Loading from Boot0002
> (/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(0,0)/HD(1,MBR,0x1bb2fc9c,0x800,0x3fffe)/\path2\file2.efi)
> failed
> EFI boot manager: Cannot load any image
> =>
> 
> But as you see it does not fit into 80 character lines and the terminal
> might cut of the interesting part of the line. Failure may also depend
> on the command line parameters.
> 
> I think adding the label makes more sense.

I agree. Maybe even only the label.

Booting label1... failed
Booting label2...
Welcome to grub!


Alex

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-29 12:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-28 10:13 [U-Boot] [PATCH 1/1] efi_loader: bootmgr: print a message when loading from BootNext failed Heinrich Schuchardt
2019-05-29  9:40 ` Alexander Graf
2019-05-29 10:59   ` Heinrich Schuchardt
2019-05-29 12:39     ` Alexander Graf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.