summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2021-01-12 12:46:24 +0100
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2021-01-13 02:38:00 +0100
commit5f59518a7b1aef9ad3a91defa06cff82dd01cdc5 (patch)
tree10ae6cf6e06c87338628373ab9346e5922382789 /fs
parentea1a9ec5f430359720d9a0621ed1acfbba6a142a (diff)
downloadu-boot-5f59518a7b1aef9ad3a91defa06cff82dd01cdc5.tar.gz
u-boot-5f59518a7b1aef9ad3a91defa06cff82dd01cdc5.tar.xz
u-boot-5f59518a7b1aef9ad3a91defa06cff82dd01cdc5.zip
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/fs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/fs.c b/fs/fs.c
index 5e80648b5b..68a15553cc 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -752,7 +752,8 @@ int do_load(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[],
if (IS_ENABLED(CONFIG_CMD_BOOTEFI))
efi_set_bootdev(argv[1], (argc > 2) ? argv[2] : "",
- (argc > 4) ? argv[4] : "");
+ (argc > 4) ? argv[4] : "", map_sysmem(addr, 0),
+ len_read);
printf("%llu bytes read in %lu ms", len_read, time);
if (time > 0) {