MdeModulePkg: Wait for input on each boot failure
This commit is contained in:
@@ -787,7 +787,7 @@ BootManagerCallback (
|
|||||||
{
|
{
|
||||||
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption;
|
EFI_BOOT_MANAGER_LOAD_OPTION *BootOption;
|
||||||
UINTN BootOptionCount;
|
UINTN BootOptionCount;
|
||||||
EFI_INPUT_KEY Key;
|
//EFI_INPUT_KEY Key;
|
||||||
|
|
||||||
if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
|
if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
|
||||||
//
|
//
|
||||||
@@ -831,13 +831,13 @@ BootManagerCallback (
|
|||||||
EfiBootManagerBoot (&BootOption[QuestionId - 1]);
|
EfiBootManagerBoot (&BootOption[QuestionId - 1]);
|
||||||
BmSetConsoleMode (TRUE);
|
BmSetConsoleMode (TRUE);
|
||||||
|
|
||||||
if (EFI_ERROR (BootOption[QuestionId - 1].Status)) {
|
//if (EFI_ERROR (BootOption[QuestionId - 1].Status)) {
|
||||||
gST->ConOut->OutputString (
|
// gST->ConOut->OutputString (
|
||||||
gST->ConOut,
|
// gST->ConOut,
|
||||||
HiiGetString (gBootManagerPrivate.HiiHandle, STRING_TOKEN (STR_ANY_KEY_CONTINUE), NULL)
|
// HiiGetString (gBootManagerPrivate.HiiHandle, STRING_TOKEN (STR_ANY_KEY_CONTINUE), NULL)
|
||||||
);
|
// );
|
||||||
gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
|
// gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
|
||||||
}
|
//}
|
||||||
|
|
||||||
EfiBootManagerFreeLoadOptions (BootOption, BootOptionCount);
|
EfiBootManagerFreeLoadOptions (BootOption, BootOptionCount);
|
||||||
|
|
||||||
|
@@ -1779,6 +1779,8 @@ EfiBootManagerBoot (
|
|||||||
UINTN FileSize;
|
UINTN FileSize;
|
||||||
EFI_BOOT_LOGO_PROTOCOL *BootLogo;
|
EFI_BOOT_LOGO_PROTOCOL *BootLogo;
|
||||||
EFI_EVENT LegacyBootEvent;
|
EFI_EVENT LegacyBootEvent;
|
||||||
|
EFI_INPUT_KEY Key;
|
||||||
|
UINTN Index;
|
||||||
|
|
||||||
if (BootOption == NULL) {
|
if (BootOption == NULL) {
|
||||||
return;
|
return;
|
||||||
@@ -1914,6 +1916,19 @@ EfiBootManagerBoot (
|
|||||||
BmDestroyRamDisk (RamDiskDevicePath);
|
BmDestroyRamDisk (RamDiskDevicePath);
|
||||||
FreePool (RamDiskDevicePath);
|
FreePool (RamDiskDevicePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gST->ConIn != NULL) {
|
||||||
|
gST->ConOut->ClearScreen (gST->ConOut);
|
||||||
|
AsciiPrint (
|
||||||
|
"Boot Failed. %s\n"
|
||||||
|
"Press any key to continue...\n",
|
||||||
|
BootOption->Description);
|
||||||
|
Status = gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &Index);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
ASSERT (Index == 0);
|
||||||
|
while (!EFI_ERROR (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key))) {}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user