Reviewed-by: Eric Dong <eric.d...@intel.com> -----Original Message----- From: Bi, Dandan Sent: Thursday, December 17, 2015 5:52 PM To: edk2-devel@lists.01.org Cc: Gao, Liming; Dong, Eric Subject: [patch] MdeModulePkg:Update Boot Manager form when enter it.
Currently BootManager is an independent library,used by UiApp.It only load boot option when enter UiApp.So when add boot option through boot maintenance manager, it will not display in boot manager. In order to fix this issue,now we update the boot manager form every time we enter it. Cc: Liming Gao <liming....@intel.com> Cc: Eric Dong <eric.d...@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan...@intel.com> --- MdeModulePkg/Library/BootManagerLib/BootManager.c | 16 ++++++++++++---- MdeModulePkg/Library/BootManagerLib/BootManagerVfr.Vfr | 11 +++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Library/BootManagerLib/BootManager.c b/MdeModulePkg/Library/BootManagerLib/BootManager.c index cfeedeb..a38f18a 100644 --- a/MdeModulePkg/Library/BootManagerLib/BootManager.c +++ b/MdeModulePkg/Library/BootManagerLib/BootManager.c @@ -676,10 +676,22 @@ BootManagerCallback ( ) { EFI_BOOT_MANAGER_LOAD_OPTION *BootOption; UINTN BootOptionCount; EFI_INPUT_KEY Key; + + if (Action == EFI_BROWSER_ACTION_FORM_OPEN) { + // + //Means enter the boot manager form. + //Update the boot manage page,because the boot option may changed. + // + if (QuestionId == 0x1212){ + UpdateBootManager(); + } + return EFI_SUCCESS; + } + if (Action != EFI_BROWSER_ACTION_CHANGED) { // // Do nothing for other UEFI Action. Only do call back when data is changed. // return EFI_UNSUPPORTED; @@ -754,14 +766,10 @@ BootManagerLibConstructor ( BootManagerLibStrings, NULL ); ASSERT (gBootManagerPrivate.HiiHandle != NULL); - // - // Update boot manager page - // - UpdateBootManager (); return EFI_SUCCESS; } /** diff --git a/MdeModulePkg/Library/BootManagerLib/BootManagerVfr.Vfr b/MdeModulePkg/Library/BootManagerLib/BootManagerVfr.Vfr index d3281f5..14c1f8f 100644 --- a/MdeModulePkg/Library/BootManagerLib/BootManagerVfr.Vfr +++ b/MdeModulePkg/Library/BootManagerLib/BootManagerVfr.Vfr @@ -31,10 +31,21 @@ formset subtitle text = STRING_TOKEN(STR_LAST_STRING); subtitle text = STRING_TOKEN(STR_BOOT_OPTION_BANNER); subtitle text = STRING_TOKEN(STR_LAST_STRING); // + //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; + + // // This is where we will dynamically add choices for the Boot Manager // label LABEL_BOOT_OPTION; label LABEL_BOOT_OPTION_END; -- 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel