From: Michael Brown Date: Mon, 19 May 2014 22:08:42 +0000 (+0100) Subject: [efi] Do not try to fetch loaded image device path protocol X-Git-Tag: v1.20.1~1169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cdd3bb6567b6e2fafa18db82bfb2c7d2bce9ebb;p=thirdparty%2Fipxe.git [efi] Do not try to fetch loaded image device path protocol Some UEFI systems (observed with a Mac Pro) do not provide a loaded image device path protocol. We don't currently use the loaded image device path protocol for anything beyond printing a debug message, so simply remove the code which attempts to fetch it. Reported-by: Matt Woodward Tested-by: Matt Woodward Signed-off-by: Michael Brown --- diff --git a/src/interface/efi/efi_init.c b/src/interface/efi/efi_init.c index e6ef3d054..5eb101350 100644 --- a/src/interface/efi/efi_init.c +++ b/src/interface/efi/efi_init.c @@ -34,9 +34,6 @@ EFI_HANDLE efi_image_handle; /** Loaded image protocol for this image */ EFI_LOADED_IMAGE_PROTOCOL *efi_loaded_image; -/** Loaded image protocol device path for this image */ -EFI_DEVICE_PATH_PROTOCOL *efi_loaded_image_path; - /** System table passed to entry point */ EFI_SYSTEM_TABLE *efi_systab; @@ -44,10 +41,6 @@ EFI_SYSTEM_TABLE *efi_systab; static EFI_GUID efi_loaded_image_protocol_guid = EFI_LOADED_IMAGE_PROTOCOL_GUID; -/** EFI loaded image device path protocol GUID */ -static EFI_GUID efi_loaded_image_device_path_protocol_guid - = EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID; - /** Event used to signal shutdown */ static EFI_EVENT efi_shutdown_event; @@ -152,7 +145,6 @@ EFI_STATUS efi_init ( EFI_HANDLE image_handle, struct efi_protocol *prot; struct efi_config_table *tab; void *loaded_image; - void *loaded_image_path; EFI_STATUS efirc; int rc; @@ -220,21 +212,6 @@ EFI_STATUS efi_init ( EFI_HANDLE image_handle, DBGC ( systab, "EFI image base address %p\n", efi_loaded_image->ImageBase ); - /* Get loaded image device path protocol */ - if ( ( efirc = bs->OpenProtocol ( image_handle, - &efi_loaded_image_device_path_protocol_guid, - &loaded_image_path, image_handle, NULL, - EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) { - rc = -EEFI ( efirc ); - DBGC ( systab, "EFI could not get loaded image device path " - "protocol: %s", strerror ( rc ) ); - return efirc; - } - efi_loaded_image_path = loaded_image_path; - DBGC ( systab, "EFI image device path " ); - DBGC_EFI_DEVPATH ( systab, efi_loaded_image_path ); - DBGC ( systab, "\n" ); - /* EFI is perfectly capable of gracefully shutting down any * loaded devices if it decides to fall back to a legacy boot. * For no particularly comprehensible reason, it doesn't