From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heinrich Schuchardt Date: Tue, 19 Jan 2021 19:43:44 +0100 Subject: [PATCH 3/3] efi_loader: setting boot device In-Reply-To: References: <20210112195842.252946-1-xypron.glpk@gmx.de> <20210112195842.252946-4-xypron.glpk@gmx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 1/19/21 7:06 PM, Simon Glass wrote: > Hi Heinrich, > > On Tue, 12 Jan 2021 at 12:58, Heinrich Schuchardt 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 >> --- >> 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 >