MdeModulePkg: Be more verbose about SecureBoot and the reason why the boot failed

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
This commit is contained in:
Patrick Rudolph
2020-06-16 08:50:52 +02:00
committed by Tim Crawford
parent 10cbbe06d3
commit 9657bbe08f
2 changed files with 17 additions and 0 deletions

View File

@@ -1781,6 +1781,7 @@ EfiBootManagerBoot (
EFI_EVENT LegacyBootEvent; EFI_EVENT LegacyBootEvent;
EFI_INPUT_KEY Key; EFI_INPUT_KEY Key;
UINTN Index; UINTN Index;
UINT8 *SecureBoot;
if (BootOption == NULL) { if (BootOption == NULL) {
return; return;
@@ -1920,6 +1921,21 @@ EfiBootManagerBoot (
if (gST->ConOut != NULL) { if (gST->ConOut != NULL) {
gST->ConOut->ClearScreen (gST->ConOut); gST->ConOut->ClearScreen (gST->ConOut);
//
// When UEFI Secure Boot is enabled, unsigned modules won't load.
//
SecureBoot = NULL;
GetEfiGlobalVariable2 (EFI_SECURE_BOOT_MODE_NAME, (VOID**)&SecureBoot, NULL);
if ((SecureBoot != NULL) && (*SecureBoot == SECURE_BOOT_MODE_ENABLE)) {
AsciiPrint ("SecureBoot is enabled.\n");
} else {
AsciiPrint ("SecureBoot is disabled.\n");
}
if (SecureBoot != NULL) {
FreePool (SecureBoot);
}
AsciiPrint ( AsciiPrint (
"Booting from '%s' failed; verify it contains a 64-bit UEFI OS.\n" "Booting from '%s' failed; verify it contains a 64-bit UEFI OS.\n"
"\nPress any key to continue booting...\n", "\nPress any key to continue booting...\n",

View File

@@ -44,6 +44,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Protocol/DeferredImageLoad.h> #include <Protocol/DeferredImageLoad.h>
#include <Protocol/PlatformBootManager.h> #include <Protocol/PlatformBootManager.h>
#include <Guid/ImageAuthentication.h>
#include <Guid/MemoryTypeInformation.h> #include <Guid/MemoryTypeInformation.h>
#include <Guid/FileInfo.h> #include <Guid/FileInfo.h>
#include <Guid/GlobalVariable.h> #include <Guid/GlobalVariable.h>