aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthijs Lavrijsen <mattiwatti@gmail.com>2023-09-25 03:02:29 +0200
committerMatthijs Lavrijsen <mattiwatti@gmail.com>2023-09-25 21:17:57 +0200
commitbb77cca1a797c79e63dd0e951650548ef2005f83 (patch)
tree0b9abd83dc5a4a7d7ec9a76e74a755dc1a61e75a
parent41b17319e8d812a0c267e7570ba1583ffee73aaa (diff)
Loader: continue booting if the driver is already loaded
-rw-r--r--Application/Loader/Loader.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/Application/Loader/Loader.c b/Application/Loader/Loader.c
index 42bdfb1..a0849f0 100644
--- a/Application/Loader/Loader.c
+++ b/Application/Loader/Loader.c
@@ -266,20 +266,19 @@ StartAndConfigureDriver(
Print(L"[LOADER] StartImage failed: %llx (%r).\r\n", Status, Status);
goto Exit;
}
-
- Status = gBS->LocateProtocol(&gEfiGuardDriverProtocolGuid,
- NULL,
- (VOID**)&EfiGuardDriverProtocol);
- if (EFI_ERROR(Status))
- {
- Print(L"[LOADER] LocateProtocol failed: %llx (%r).\r\n", Status, Status);
- goto Exit;
- }
}
else
{
+ ASSERT_EFI_ERROR(Status);
Print(L"[LOADER] The driver is already loaded.\r\n");
- Status = EFI_ALREADY_STARTED;
+ }
+
+ Status = gBS->LocateProtocol(&gEfiGuardDriverProtocolGuid,
+ NULL,
+ (VOID**)&EfiGuardDriverProtocol);
+ if (EFI_ERROR(Status))
+ {
+ Print(L"[LOADER] LocateProtocol failed: %llx (%r).\r\n", Status, Status);
goto Exit;
}
@@ -424,7 +423,9 @@ TryBootOptionsInOrder(
// Print what we're booting
if (ConvertedPath != NULL)
{
- Print(L"Booting %Sdevice path %S...\r\n", IsLegacy ? L"legacy " : L"", ConvertedPath);
+ Print(L"Booting \"%S\"...\r\n -> %S = %S\r\n",
+ (BootOptions[Index].Description != NULL ? BootOptions[Index].Description : L"<null description>"),
+ IsLegacy ? L"Legacy path" : L"Path", ConvertedPath);
FreePool(ConvertedPath);
}
@@ -580,9 +581,6 @@ UefiMain(
// Locate, load, start and configure the driver
//
CONST EFI_STATUS DriverStatus = StartAndConfigureDriver(ImageHandle, SystemTable);
- if (DriverStatus == EFI_ALREADY_STARTED)
- return EFI_SUCCESS;
-
if (EFI_ERROR(DriverStatus))
{
Print(L"\r\nERROR: driver load failed with status %llx (%r).\r\n"