summaryrefslogtreecommitdiff
path: root/include/efi_loader.h
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2021-01-12 14:46:24 +0300
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2021-01-13 04:38:00 +0300
commit5f59518a7b1aef9ad3a91defa06cff82dd01cdc5 (patch)
tree10ae6cf6e06c87338628373ab9346e5922382789 /include/efi_loader.h
parentea1a9ec5f430359720d9a0621ed1acfbba6a142a (diff)
downloadu-boot-5f59518a7b1aef9ad3a91defa06cff82dd01cdc5.tar.xz
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 'include/efi_loader.h')
-rw-r--r--include/efi_loader.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/efi_loader.h b/include/efi_loader.h
index df29d45a34..2a69ef844b 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -474,7 +474,8 @@ void efi_restore_gd(void);
/* Call this to relocate the runtime section to an address space */
void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map);
/* Call this to set the current device name */
-void efi_set_bootdev(const char *dev, const char *devnr, const char *path);
+void efi_set_bootdev(const char *dev, const char *devnr, const char *path,
+ void *buffer, size_t buffer_size);
/* Add a new object to the object list. */
void efi_add_handle(efi_handle_t obj);
/* Create handle */
@@ -873,7 +874,8 @@ static inline efi_status_t efi_add_runtime_mmio(void *mmio_ptr, u64 len)
/* No loader configured, stub out EFI_ENTRY */
static inline void efi_restore_gd(void) { }
static inline void efi_set_bootdev(const char *dev, const char *devnr,
- const char *path) { }
+ const char *path, void *buffer,
+ size_t buffer_size) { }
static inline void efi_net_set_dhcp_ack(void *pkt, int len) { }
static inline void efi_print_image_infos(void *pc) { }
static inline efi_status_t efi_launch_capsules(void)