MdeModulePkg/BM: Add warning if no bootable options found
This commit is contained in:
@@ -484,6 +484,7 @@ UpdateBootManager (
|
|||||||
BOOLEAN IsLegacyOption;
|
BOOLEAN IsLegacyOption;
|
||||||
BOOLEAN NeedEndOp;
|
BOOLEAN NeedEndOp;
|
||||||
UINTN MaxLen;
|
UINTN MaxLen;
|
||||||
|
UINTN OptionCount;
|
||||||
|
|
||||||
DeviceType = (UINT16) -1;
|
DeviceType = (UINT16) -1;
|
||||||
|
|
||||||
@@ -526,6 +527,7 @@ UpdateBootManager (
|
|||||||
EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||||
EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||||
EndLabel->Number = LABEL_BOOT_OPTION_END;
|
EndLabel->Number = LABEL_BOOT_OPTION_END;
|
||||||
|
|
||||||
mKeyInput = 0;
|
mKeyInput = 0;
|
||||||
NeedEndOp = FALSE;
|
NeedEndOp = FALSE;
|
||||||
for (Index = 0; Index < BootOptionCount; Index++) {
|
for (Index = 0; Index < BootOptionCount; Index++) {
|
||||||
@@ -541,6 +543,8 @@ UpdateBootManager (
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OptionCount++;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Group the legacy boot option in the sub title created dynamically
|
// Group the legacy boot option in the sub title created dynamically
|
||||||
//
|
//
|
||||||
@@ -596,6 +600,10 @@ UpdateBootManager (
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (OptionCount == 0) {
|
||||||
|
HiiCreateSubTitleOpCode (StartOpCodeHandle, STRING_TOKEN (STR_NO_BOOTABLE_MEDIA), 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (NeedEndOp) {
|
if (NeedEndOp) {
|
||||||
HiiCreateEndOpCode (StartOpCodeHandle);
|
HiiCreateEndOpCode (StartOpCodeHandle);
|
||||||
}
|
}
|
||||||
|
@@ -21,4 +21,5 @@
|
|||||||
#string STR_BM_BANNER #language en-US "One Time Boot"
|
#string STR_BM_BANNER #language en-US "One Time Boot"
|
||||||
#string STR_BOOT_MANAGER_HELP #language en-US "Boot an entry one time"
|
#string STR_BOOT_MANAGER_HELP #language en-US "Boot an entry one time"
|
||||||
#string STR_ANY_KEY_CONTINUE #language en-US "Press any key to continue..."
|
#string STR_ANY_KEY_CONTINUE #language en-US "Press any key to continue..."
|
||||||
|
#string STR_NO_BOOTABLE_MEDIA #language en-US "No bootable media found"
|
||||||
#string STR_EMPTY_STRING #language en-US ""
|
#string STR_EMPTY_STRING #language en-US ""
|
||||||
|
Reference in New Issue
Block a user