Improve error output when boot option fails to load

This commit is contained in:
Jeremy Soller
2019-10-03 13:19:24 -06:00
committed by Tim Crawford
parent 7050fc3a26
commit 52d5d1b2c5
4 changed files with 35 additions and 1 deletions

View File

@ -1317,6 +1317,8 @@ Returns:
{ {
CHAR16 *TmpStr; CHAR16 *TmpStr;
gST->ConOut->ClearScreen(gST->ConOut);
// //
// If Boot returned with EFI_SUCCESS and there is not in the boot device // If Boot returned with EFI_SUCCESS and there is not in the boot device
// select loop then we need to pop up a UI and wait for user input. // select loop then we need to pop up a UI and wait for user input.
@ -1360,6 +1362,8 @@ Returns:
{ {
CHAR16 *TmpStr; CHAR16 *TmpStr;
gST->ConOut->ClearScreen(gST->ConOut);
// //
// If Boot returned with failed status then we need to pop up a UI and wait // If Boot returned with failed status then we need to pop up a UI and wait
// for user input. // for user input.

View File

@ -105,6 +105,8 @@ BdsBootDeviceSelect (
BOOLEAN BootNextExist; BOOLEAN BootNextExist;
LIST_ENTRY *LinkBootNext; LIST_ENTRY *LinkBootNext;
EFI_EVENT ConnectConInEvent; EFI_EVENT ConnectConInEvent;
UINTN Index;
EFI_INPUT_KEY Key;
// //
// Got the latest boot option // Got the latest boot option
@ -273,6 +275,16 @@ BdsBootDeviceSelect (
BootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_FAILED)); BootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_FAILED));
PlatformBdsBootFail (BootOption, Status, ExitData, ExitDataSize); PlatformBdsBootFail (BootOption, Status, ExitData, ExitDataSize);
// Wait for key
gST->ConOut->OutputString (
gST->ConOut,
GetStringById (STRING_TOKEN (STR_ANY_KEY_CONTINUE))
);
Status = gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &Index);
ASSERT_EFI_ERROR (Status);
ASSERT (Index == 0);
while (!EFI_ERROR (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key))) {}
// //
// Check the next boot option // Check the next boot option
// //

View File

@ -203,6 +203,7 @@ CallBootManager (
CHAR16 *ExitData; CHAR16 *ExitData;
UINTN ExitDataSize; UINTN ExitDataSize;
EFI_STRING_ID Token; EFI_STRING_ID Token;
UINTN Index;
EFI_INPUT_KEY Key; EFI_INPUT_KEY Key;
CHAR16 *HelpString; CHAR16 *HelpString;
UINTN HelpSize; UINTN HelpSize;
@ -390,10 +391,15 @@ CallBootManager (
} else { } else {
gOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_FAILED)); gOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_FAILED));
PlatformBdsBootFail (gOption, Status, ExitData, ExitDataSize); PlatformBdsBootFail (gOption, Status, ExitData, ExitDataSize);
// Wait for key
gST->ConOut->OutputString ( gST->ConOut->OutputString (
gST->ConOut, gST->ConOut,
GetStringById (STRING_TOKEN (STR_ANY_KEY_CONTINUE)) GetStringById (STRING_TOKEN (STR_ANY_KEY_CONTINUE))
); );
gST->ConIn->ReadKeyStroke (gST->ConIn, &Key); Status = gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &Index);
ASSERT_EFI_ERROR (Status);
ASSERT (Index == 0);
while (!EFI_ERROR (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key))) {}
} }
} }

View File

@ -77,6 +77,8 @@ HotkeyBoot (
EFI_STATUS Status; EFI_STATUS Status;
UINTN ExitDataSize; UINTN ExitDataSize;
CHAR16 *ExitData; CHAR16 *ExitData;
UINTN Index;
EFI_INPUT_KEY Key;
if (mHotkeyBootOption == NULL) { if (mHotkeyBootOption == NULL) {
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
@ -97,6 +99,16 @@ HotkeyBoot (
// //
mHotkeyBootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_FAILED)); mHotkeyBootOption->StatusString = GetStringById (STRING_TOKEN (STR_BOOT_FAILED));
PlatformBdsBootFail (mHotkeyBootOption, Status, ExitData, ExitDataSize); PlatformBdsBootFail (mHotkeyBootOption, Status, ExitData, ExitDataSize);
// Wait for key
gST->ConOut->OutputString (
gST->ConOut,
GetStringById (STRING_TOKEN (STR_ANY_KEY_CONTINUE))
);
Status = gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &Index);
ASSERT_EFI_ERROR (Status);
ASSERT (Index == 0);
while (!EFI_ERROR (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key))) {}
} else { } else {
// //
// Call platform action to indicate the boot success // Call platform action to indicate the boot success