This commit is contained in:
M. Mediouni 2026-08-27 07:47:06 +09:00 committed by GitHub
commit 4290ff78e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View file

@ -355,6 +355,17 @@ UefiMain (
EFI_HANDLE ConInHandle;
EFI_SIMPLE_TEXT_INPUT_PROTOCOL *OldConIn;
SPLIT_LIST *Split;
UINT8 *SecureBoot;
// If Secure Boot is enabled, do not launch the UEFI shell
SecureBoot = NULL;
GetEfiGlobalVariable2 (EFI_SECURE_BOOT_MODE_NAME, (VOID **)&SecureBoot, NULL);
if ((SecureBoot != NULL) && (*SecureBoot == SECURE_BOOT_MODE_ENABLE)) {
FreePool (SecureBoot);
return EFI_SECURITY_VIOLATION;
} else if (SecureBoot != NULL) {
FreePool (SecureBoot);
}
if (PcdGet8 (PcdShellSupportLevel) > 3) {
return (EFI_UNSUPPORTED);

View file

@ -13,6 +13,8 @@
#include <Guid/ShellVariableGuid.h>
#include <Guid/ShellAliasGuid.h>
#include <Guid/GlobalVariable.h>
#include <Guid/ImageAuthentication.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/SimpleTextOut.h>