Closed JohnAZoidberg closed 3 years ago
Because Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib doesn't signal end of DXE.
Fixed by
Author: Daniel Schaefer <git@danielschaefer.me>
Date: Fri May 7 05:17:31 2021 +0800
Signal EndOfDxe in boot manager
Otherwise we can't load a 3rd party image because we're still in DXE.
MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c prevents
that.
diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index 82cd311df5..47b6f459d4 100644
--- a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -155,6 +155,11 @@ PlatformBootManagerBeforeConsole (
EFI_INPUT_KEY F2;
EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
+ //^M
+ // Signal EndOfDxe PI Event^M
+ //^M
+ EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid);^M
+^M
//
// Update the console variables.
//
diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index afba07573f..a7b99cab53 100644
--- a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -48,6 +48,7 @@
PrintLib
[Guids]
+ gEfiEndOfDxeEventGroupGuid^M
[Protocols]
gEfiGenericMemTestProtocolGuid ## CONSUMES
in edk2-platforms.
Executing Linux from ESP doesn't work.
Looks like we're not signaling the end of DXE.
This commit is a workaround: https://github.com/riscv/riscv-edk2/commit/c3508f4aef9b53e6d24870bc2212c275f0843861