diff --git a/src/image/efi_image.c b/src/image/efi_image.c index a112a8fcb..942b7aeeb 100644 --- a/src/image/efi_image.c +++ b/src/image/efi_image.c @@ -30,6 +30,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include #include #include +#include #include #include #include @@ -140,6 +141,7 @@ static int efi_image_exec ( struct image *image ) { void *interface; } loaded; EFI_HANDLE handle; + EFI_MEMORY_TYPE type; wchar_t *cmdline; EFI_STATUS efirc; int rc; @@ -231,6 +233,9 @@ static int efi_image_exec ( struct image *image ) { assert ( loaded.image->LoadOptionsSize == 0 ); assert ( loaded.image->LoadOptions == NULL ); + /* Record image code type */ + type = loaded.image->ImageCodeType; + /* Set command line */ loaded.image->LoadOptions = cmdline; loaded.image->LoadOptionsSize = @@ -253,6 +258,12 @@ static int efi_image_exec ( struct image *image ) { goto err_start_image; } + /* If image was a driver, connect it up to anything available */ + if ( type == EfiBootServicesCode ) { + DBGC ( image, "EFIIMAGE %p connecting drivers\n", image ); + efi_driver_reconnect_all(); + } + /* Success */ rc = 0;