From 52d9ce76dbe8d0ec5eb13b2df84877176bddc81c Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Mon, 3 Feb 2020 14:29:03 -0700 Subject: [PATCH] MdeModulePkg/BM: Make it look like current BootMngr --- .../Library/BootManagerUiLib/BootManager.c | 7 ++++++ .../Library/BootManagerUiLib/BootManager.h | 2 +- .../BootManagerUiLib/BootManagerStrings.uni | 19 ++++----------- .../BootManagerUiLib/BootManagerVfr.Vfr | 23 +++++++------------ 4 files changed, 20 insertions(+), 31 deletions(-) diff --git a/MdeModulePkg/Library/BootManagerUiLib/BootManager.c b/MdeModulePkg/Library/BootManagerUiLib/BootManager.c index 0205e760b5..087713ee33 100644 --- a/MdeModulePkg/Library/BootManagerUiLib/BootManager.c +++ b/MdeModulePkg/Library/BootManagerUiLib/BootManager.c @@ -493,6 +493,7 @@ UpdateBootManager ( BOOLEAN IsLegacyOption; BOOLEAN NeedEndOp; UINTN MaxLen; + UINTN OptionCount = 0; DeviceType = (UINT16)-1; @@ -550,6 +551,8 @@ UpdateBootManager ( continue; } + OptionCount++; + // // Group the legacy boot option in the sub title created dynamically // @@ -605,6 +608,10 @@ UpdateBootManager ( ); } + if (OptionCount == 0) { + HiiCreateSubTitleOpCode (StartOpCodeHandle, STRING_TOKEN (STR_NO_BOOTABLE_MEDIA), 0, 0, 0); + } + if (NeedEndOp) { HiiCreateEndOpCode (StartOpCodeHandle); } diff --git a/MdeModulePkg/Library/BootManagerUiLib/BootManager.h b/MdeModulePkg/Library/BootManagerUiLib/BootManager.h index 0076a9dfce..4405a663a5 100644 --- a/MdeModulePkg/Library/BootManagerUiLib/BootManager.h +++ b/MdeModulePkg/Library/BootManagerUiLib/BootManager.h @@ -46,7 +46,7 @@ typedef struct { 0x847bc3fe, 0xb974, 0x446d, {0x94, 0x49, 0x5a, 0xd5, 0x41, 0x2e, 0x99, 0x3b} \ } -#define BOOT_MANAGER_FORM_ID 0x1000 +#define BOOT_MANAGER_FORM_ID 0x1030 #define LABEL_BOOT_OPTION 0x00 #define LABEL_BOOT_OPTION_END 0x01 diff --git a/MdeModulePkg/Library/BootManagerUiLib/BootManagerStrings.uni b/MdeModulePkg/Library/BootManagerUiLib/BootManagerStrings.uni index 2fcb9a29c5..c280fd9f87 100644 --- a/MdeModulePkg/Library/BootManagerUiLib/BootManagerStrings.uni +++ b/MdeModulePkg/Library/BootManagerUiLib/BootManagerStrings.uni @@ -17,20 +17,9 @@ /=# #langdef en-US "English" -#langdef fr-FR "Français" -#string STR_BM_BANNER #language en-US "Boot Manager" - #language fr-FR "Boot Manager" -#string STR_BOOT_MANAGER_HELP #language en-US "This selection will take you to the Boot Manager" - #language fr-FR "This selection will take you to the Boot Manager" -#string STR_HELP_FOOTER #language en-US "Use the <↑> and <↓> keys to choose a boot option, the key to select a boot option, and the key to exit the Boot Manager Menu." - #language fr-FR "<↑> pour <↓> changer l'option, choisir une option, pour sortir" -#string STR_AND #language en-US " and " - #language fr-FR " et " -#string STR_BOOT_OPTION_BANNER #language en-US "Boot Manager Menu" - #language fr-FR "le Menu d'Option de Botte" +#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_ANY_KEY_CONTINUE #language en-US "Press any key to continue..." - #language fr-FR "Appuie n'importe quelle pour continuer..." -#string STR_LAST_STRING #language en-US "" - #language fr-FR "" - +#string STR_NO_BOOTABLE_MEDIA #language en-US "No bootable media found" +#string STR_EMPTY_STRING #language en-US "" diff --git a/MdeModulePkg/Library/BootManagerUiLib/BootManagerVfr.Vfr b/MdeModulePkg/Library/BootManagerUiLib/BootManagerVfr.Vfr index 4049fe6774..c49b6f50b1 100644 --- a/MdeModulePkg/Library/BootManagerUiLib/BootManagerVfr.Vfr +++ b/MdeModulePkg/Library/BootManagerUiLib/BootManagerVfr.Vfr @@ -8,7 +8,7 @@ //**/ #define FORMSET_GUID { 0x847bc3fe, 0xb974, 0x446d, 0x94, 0x49, 0x5a, 0xd5, 0x41, 0x2e, 0x99, 0x3b } -#define BOOT_MANAGER_FORM_ID 0x1000 +#define BOOT_MANAGER_FORM_ID 0x1030 #define LABEL_BOOT_OPTION 0x00 #define LABEL_BOOT_OPTION_END 0x01 @@ -20,22 +20,18 @@ formset classguid = gEfiIfrFrontPageGuid, form formid = BOOT_MANAGER_FORM_ID, - title = STRING_TOKEN(STR_BM_BANNER); - - subtitle text = STRING_TOKEN(STR_LAST_STRING); - subtitle text = STRING_TOKEN(STR_BOOT_OPTION_BANNER); - subtitle text = STRING_TOKEN(STR_LAST_STRING); + title = STRING_TOKEN(STR_BM_BANNER); // //Add this invisable text in order to indicate enter Boot Manager form. // suppressif TRUE; - text - help = STRING_TOKEN(STR_LAST_STRING ), - text = STRING_TOKEN(STR_LAST_STRING ), - flags = INTERACTIVE, - key = 0x1212; - endif; + text + help = STRING_TOKEN(STR_EMPTY_STRING), + text = STRING_TOKEN(STR_EMPTY_STRING), + flags = INTERACTIVE, + key = 0x1212; + endif; // // This is where we will dynamically add choices for the Boot Manager @@ -43,9 +39,6 @@ formset label LABEL_BOOT_OPTION; label LABEL_BOOT_OPTION_END; - subtitle text = STRING_TOKEN(STR_LAST_STRING); - subtitle text = STRING_TOKEN(STR_HELP_FOOTER); - endform; endformset;