efi_loader: setting boot device
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Tue, 12 Jan 2021 11:46:24 +0000 (12:46 +0100)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Wed, 13 Jan 2021 01:38:00 +0000 (02:38 +0100)
commit5f59518a7b1aef9ad3a91defa06cff82dd01cdc5
tree10ae6cf6e06c87338628373ab9346e5922382789
parentea1a9ec5f430359720d9a0621ed1acfbba6a142a
efi_loader: setting boot device

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@gmx.de>
cmd/bootefi.c
doc/uefi/uefi.rst
fs/fs.c
include/efi_loader.h
net/tftp.c