diff options
author | Michael Brown | 2023-02-02 00:54:19 +0100 |
---|---|---|
committer | Michael Brown | 2023-02-02 00:54:19 +0100 |
commit | 6f250be279311d461f78bb17eb8b5b70ad90dd0a (patch) | |
tree | 07c07d85835367e6844965aba420ccc6811a5ac3 /src/interface/efi/efiprefix.c | |
parent | [realtek] Explicitly disable VLAN offload (diff) | |
download | ipxe-6f250be279311d461f78bb17eb8b5b70ad90dd0a.tar.gz ipxe-6f250be279311d461f78bb17eb8b5b70ad90dd0a.tar.xz ipxe-6f250be279311d461f78bb17eb8b5b70ad90dd0a.zip |
[efi] Allow autoexec script to be located alongside iPXE binary
Try loading the autoexec.ipxe script first from the directory
containing the iPXE binary (based on the relative file path provided
to us via EFI_LOADED_IMAGE_PROTOCOL), then fall back to trying the
root directory.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/efi/efiprefix.c')
-rw-r--r-- | src/interface/efi/efiprefix.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/interface/efi/efiprefix.c b/src/interface/efi/efiprefix.c index bdc36d9b..26116068 100644 --- a/src/interface/efi/efiprefix.c +++ b/src/interface/efi/efiprefix.c @@ -78,16 +78,17 @@ EFI_STATUS EFIAPI _efi_start ( EFI_HANDLE image_handle, */ static void efi_init_application ( void ) { EFI_HANDLE device = efi_loaded_image->DeviceHandle; - EFI_DEVICE_PATH_PROTOCOL *path = efi_loaded_image_path; + EFI_DEVICE_PATH_PROTOCOL *devpath = efi_loaded_image_path; + EFI_DEVICE_PATH_PROTOCOL *filepath = efi_loaded_image->FilePath; /* Identify autoboot device, if any */ - efi_set_autoboot_ll_addr ( device, path ); + efi_set_autoboot_ll_addr ( device, devpath ); /* Store cached DHCP packet, if any */ - efi_cachedhcp_record ( device, path ); + efi_cachedhcp_record ( device, devpath ); /* Load autoexec script, if any */ - efi_autoexec_load ( device ); + efi_autoexec_load ( device, filepath ); } /** EFI application initialisation function */ |