MdeModulePkg/Universal/BdsDxe: fix setting autoboot timeout

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
This commit is contained in:
Michał Żygowski
2025-03-10 01:25:42 +02:00
committed by Sergii Dmytruk
parent e171a200d7
commit 248ecc5152
3 changed files with 15 additions and 19 deletions
@@ -377,9 +377,6 @@ PlatformBootManagerBeforeConsole (
EFI_INPUT_KEY F12;
EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
UINTN OptionNumber;
EFI_STATUS Status;
UINT16 BootTimeOut;
UINTN VarSize;
VisitAllInstancesOfProtocol (&gEfiPciRootBridgeIoProtocolGuid,
ConnectRootBridge, NULL);
@@ -408,17 +405,6 @@ PlatformBootManagerBeforeConsole (
OptionNumber = GetBootManagerMenuAppOption ();
EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)OptionNumber, 0, &F12, NULL);
Status = gRT->GetVariable(
L"Timeout",
&gEfiGlobalVariableGuid,
NULL,
&VarSize,
&BootTimeOut
);
if (!EFI_ERROR (Status) && BootTimeOut != 0) {
PcdSet16S (PcdPlatformBootTimeOut, BootTimeOut);
}
//
// Install ready to lock.
// This needs to be done before option rom dispatched.
@@ -501,7 +487,7 @@ PlatformBootManagerWaitCallback (
BootLogoUpdateProgress (
White.Pixel,
Black.Pixel,
L"Start boot option",
L"",
White.Pixel,
(Timeout - TimeoutRemain) * 100 / Timeout,
0
@@ -894,6 +894,7 @@ BootMaintRouteConfig (
goto Exit;
}
PcdSet16S (PcdPlatformBootTimeOut, NewBmmData->BootTimeOut);
Private->BmmOldFakeNVData.BootTimeOut = NewBmmData->BootTimeOut;
}
+13 -4
View File
@@ -746,10 +746,19 @@ BdsEntry (
InitializeHwErrRecSupport ();
//
// Initialize L"Timeout" EFI global variable.
//
BootTimeOut = PcdGet16 (PcdPlatformBootTimeOut);
Status = gRT->GetVariable(
L"Timeout",
&gEfiGlobalVariableGuid,
NULL,
&DataSize,
&BootTimeOut
);
if (!EFI_ERROR (Status) && BootTimeOut != 0 && BootTimeOut != 0xFFFF) {
PcdSet16S (PcdPlatformBootTimeOut, BootTimeOut);
} else {
BootTimeOut = PcdGet16 (PcdPlatformBootTimeOut);
}
if (BootTimeOut != 0xFFFF) {
//
// If time out value equal 0xFFFF, no need set to 0xFFFF to variable area because UEFI specification