Skip to content

Commit 3910eb7

Browse files
committed
System76PayloadPkg: Wait for input on each boot failure
Signed-off-by: Tim Crawford <tcrawford@system76.com>
1 parent da250dd commit 3910eb7

3 files changed

Lines changed: 18 additions & 10 deletions

File tree

System76PayloadPkg/Library/BootManagerUiLib/BootManager.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,6 @@ BootManagerCallback (
826826
{
827827
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption;
828828
UINTN BootOptionCount;
829-
EFI_INPUT_KEY Key;
830829

831830
if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
832831
//
@@ -871,14 +870,6 @@ BootManagerCallback (
871870
EfiBootManagerBoot (&BootOption[QuestionId - 1]);
872871
BmSetConsoleMode (TRUE);
873872

874-
if (EFI_ERROR (BootOption[QuestionId - 1].Status)) {
875-
gST->ConOut->OutputString (
876-
gST->ConOut,
877-
HiiGetString (gBootManagerPrivate.HiiHandle, STRING_TOKEN (STR_ANY_KEY_CONTINUE), NULL)
878-
);
879-
gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
880-
}
881-
882873
EfiBootManagerFreeLoadOptions (BootOption, BootOptionCount);
883874

884875
return EFI_SUCCESS;

System76PayloadPkg/Library/BootManagerUiLib/BootManagerStrings.uni

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@
55

66
#string STR_BM_BANNER #language en-US "One Time Boot"
77
#string STR_BOOT_MANAGER_HELP #language en-US "Boot an entry one time"
8-
#string STR_ANY_KEY_CONTINUE #language en-US "Press any key to continue..."
98
#string STR_NO_BOOTABLE_MEDIA #language en-US "No bootable media found"
109
#string STR_EMPTY_STRING #language en-US ""

System76PayloadPkg/Library/UefiBootManagerLib/BmBoot.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,6 +2043,24 @@ EfiBootManagerBoot (
20432043
//
20442044
BmReportLoadFailure (EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR, Status);
20452045
BootOption->Status = Status;
2046+
2047+
if (gST->ConOut != NULL) {
2048+
gST->ConOut->ClearScreen (gST->ConOut);
2049+
AsciiPrint (
2050+
"Boot failed: %s\n"
2051+
"Press any key to continue...\n",
2052+
BootOption->Description
2053+
);
2054+
}
2055+
if (gST->ConIn != NULL) {
2056+
EFI_INPUT_KEY Key;
2057+
UINTN Index;
2058+
2059+
Status = gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &Index);
2060+
ASSERT_EFI_ERROR (Status);
2061+
ASSERT (Index == 0);
2062+
while (!EFI_ERROR (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key))) {}
2063+
}
20462064
return;
20472065
}
20482066
}

0 commit comments

Comments
 (0)