MdeModulePkg/BM: Make it look like current BootMngr

This commit is contained in:
Tim Crawford
2020-02-03 14:29:03 -07:00
parent 06f4583ea5
commit 8a0955dfa8
4 changed files with 21 additions and 31 deletions

View File

@@ -484,6 +484,7 @@ UpdateBootManager (
BOOLEAN IsLegacyOption;
BOOLEAN NeedEndOp;
UINTN MaxLen;
UINTN OptionCount = 0;
DeviceType = (UINT16) -1;
@@ -526,6 +527,7 @@ UpdateBootManager (
EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
EndLabel->Number = LABEL_BOOT_OPTION_END;
mKeyInput = 0;
NeedEndOp = FALSE;
for (Index = 0; Index < BootOptionCount; Index++) {
@@ -541,6 +543,8 @@ UpdateBootManager (
continue;
}
OptionCount++;
//
// 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) {
HiiCreateEndOpCode (StartOpCodeHandle);
}