From 6fb8b96d9bab1281f02081a1871379f771edc0f1 Mon Sep 17 00:00:00 2001 From: "Kinney, Michael D" Date: Tue, 20 Mar 2018 19:34:55 -0700 Subject: [PATCH] MdeModulePkg/BdsDxe: Move display of test key usage into BDS module Cc: Ruiyu Ni Cc: Star Zeng Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney Reviewed-by: Star Zeng --- MdeModulePkg/Universal/BdsDxe/BdsDxe.inf | 1 + MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf index 7e644aa995..7030d67907 100644 --- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf +++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf @@ -100,6 +100,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable ## SOMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed ## CONSUMES [Depex] TRUE diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c index a25663ea43..8946d79ab2 100644 --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c @@ -884,6 +884,18 @@ BdsEntry ( PERF_INMODULE_BEGIN("PlatformBootManagerAfterConsole"); PlatformBootManagerAfterConsole (); PERF_INMODULE_END("PlatformBootManagerAfterConsole"); + + // + // If any component set PcdTestKeyUsed to TRUE because use of a test key + // was detected, then display a warning message on the debug log and the console + // + if (PcdGetBool (PcdTestKeyUsed)) { + DEBUG ((DEBUG_ERROR, "**********************************\n")); + DEBUG ((DEBUG_ERROR, "** WARNING: Test Key is used. **\n")); + DEBUG ((DEBUG_ERROR, "**********************************\n")); + Print (L"** WARNING: Test Key is used. **\n"); + } + // // Boot to Boot Manager Menu when EFI_OS_INDICATIONS_BOOT_TO_FW_UI is set. Skip HotkeyBoot // -- 2.39.5