summaryrefslogtreecommitdiffstats
path: root/src/interface/efi/efiprefix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interface/efi/efiprefix.c')
-rw-r--r--src/interface/efi/efiprefix.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/interface/efi/efiprefix.c b/src/interface/efi/efiprefix.c
index 26116068..10d8f0bf 100644
--- a/src/interface/efi/efiprefix.c
+++ b/src/interface/efi/efiprefix.c
@@ -22,6 +22,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <stdlib.h>
#include <errno.h>
#include <ipxe/device.h>
+#include <ipxe/uri.h>
#include <ipxe/init.h>
#include <ipxe/efi/efi.h>
#include <ipxe/efi/efi_driver.h>
@@ -30,6 +31,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/efi/efi_autoexec.h>
#include <ipxe/efi/efi_cachedhcp.h>
#include <ipxe/efi/efi_watchdog.h>
+#include <ipxe/efi/efi_path.h>
#include <ipxe/efi/efi_veto.h>
/**
@@ -79,16 +81,19 @@ 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 *devpath = efi_loaded_image_path;
- EFI_DEVICE_PATH_PROTOCOL *filepath = efi_loaded_image->FilePath;
+ struct uri *uri;
+
+ /* Set current working URI from device path, if present */
+ uri = efi_path_uri ( devpath );
+ if ( uri )
+ churi ( uri );
+ uri_put ( uri );
/* Identify autoboot device, if any */
efi_set_autoboot_ll_addr ( device, devpath );
/* Store cached DHCP packet, if any */
efi_cachedhcp_record ( device, devpath );
-
- /* Load autoexec script, if any */
- efi_autoexec_load ( device, filepath );
}
/** EFI application initialisation function */
@@ -103,6 +108,9 @@ struct init_fn efi_init_application_fn __init_fn ( INIT_NORMAL ) = {
*/
static int efi_probe ( struct root_device *rootdev __unused ) {
+ /* Try loading autoexec script */
+ efi_autoexec_load();
+
/* Remove any vetoed drivers */
efi_veto();