[U-Boot] [PATCH 08/11] efi_selftest: allow to select a single test for exexution
Heinrich Schuchardt
xypron.glpk at gmx.de
Mon Oct 9 10:54:54 UTC 2017
On 10/09/2017 08:57 AM, Alexander Graf wrote:
>
>
> On 09.10.17 08:14, Heinrich Schuchardt wrote:
>> On 10/09/2017 06:46 AM, Alexander Graf wrote:
>>>
>>>
>>> On 08.10.17 06:57, Heinrich Schuchardt wrote:
>>>> The second argument of bootefi is passed as a configuration
>>>> table to the selftest application. It is used to select
>>>> a single test to be executed.
>>>>
>>>> Tests get an on_request property. If this property is set
>>>> the tests are only executed if explicitly requested.
>>>>
>>>> A new command 'bootefi selftest list' is added that allows to list
>>>> all tests.
>>>>
>>>> The invocation of efi_selftest is changed to reflect that
>>>> bootefi selftest list will call the Exit bootservice.
>>>>
>>>> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
>>>
>>> Wouldn't it make more sense to just pass "bootargs" to the EFI payload
>>> as command line arguments?
>>>
>>> We could then just
>>>
>>> U-Boot# setenv bootargs list
>>> U-Boot# bootefi selftest
>>>
>>> to list the available self tests. Same for selecting them.
>>
>> Why bootargs?
>>
>
> Because bootargs is the variable that "bootm" pushes into a payload as
> command line arguments.
>
>>>
>>> That way we would also be able to directly load Linux as EFI binary and
>>> pass command line arguments to it without jumping through fdt patching
>>> hoops.
>>
>> Does the Linux EFI stub or grub.efi have a capability to receive the
>> command line?
>
> Linux does:
>
>
> https://github.com/torvalds/linux/blob/master/drivers/firmware/efi/libstub/efi-stub-helper.c#L773
>
> I don't think grub implements it today, but I don't see why it should.
> Any UEFI application that expects to be executed from the UEFI Shell
> certainly interprets the passed in command line.
>
>
> Alex
>
Thanks for pointing me at fields LoadOptionsSize and LoadOptions in the
EFI_Loaded_Image_Protocol. Yes it makes sense to use this mechanism.
I guess efi_setup_loaded_image would be a good place to set the fields.
We will have to free the associated memory when unloading the image
(efi_unload_image).
We should call efi_unload_image from efi_exit when indicated by the
subsystem and exit code.
I will put these changes into separate patches.
Regards
Heinrich
More information about the U-Boot
mailing list