[PATCH 3/3] efi_loader: setting boot device

Heinrich Schuchardt xypron.glpk at gmx.de
Tue Jan 19 19:43:44 CET 2021


On 1/19/21 7:06 PM, Simon Glass wrote:
> Hi Heinrich,
>
> On Tue, 12 Jan 2021 at 12:58, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>>
>> Up to now the bootefi command used the last file loaded to determine the
>> boot partition. This has led to errors when the fdt had been loaded from
>> another partition after the EFI binary.
>>
>> Before setting the boot device from a loaded file check if it is a PE-COFF
>> image or a FIT image.
>>
>> For a PE-COFF image remember address and size, boot device and path.
>>
>> For a FIT image remember boot device and path.
>>
>> If the PE-COFF image is overwritten by loading another file, forget it.
>>
>> Do not allow to start an image via bootefi which is not the last loaded
>> PE-COFF image.
>>
>> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
>> ---
>>   cmd/bootefi.c        | 136 ++++++++++++++++++++++++++-----------------
>>   doc/uefi/uefi.rst    |  11 ++--
>>   fs/fs.c              |   3 +-
>>   include/efi_loader.h |   6 +-
>>   net/tftp.c           |   9 ++-
>>   5 files changed, 98 insertions(+), 67 deletions(-)
>>
>
> Does this need an update to the tests?

Our current tests still run successfully.

The observed problematic behavior is not covered by our tests. To run
GRUB or helloworld.efi we just load one file and execute it.

So it would make sense to extend the coverage of our tests with a future
patch.

Best regards

Heinrich

>
> Regards,
> Simon
>



More information about the U-Boot mailing list