diff options
author | Dandan Bi <dandan.bi@intel.com> | 2016-06-30 11:37:56 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2016-07-07 12:49:01 +0800 |
commit | 984cb6462ac36bb90ce165e6507c31cda2369163 (patch) | |
tree | a698c9e4702289778768775de7bd9b19ade74203 /MdeModulePkg | |
parent | 237e849da45eac8dbd343fbaa9bac40135e879f7 (diff) | |
download | edk2-platforms-984cb6462ac36bb90ce165e6507c31cda2369163.tar.xz |
MdeModulePkg/BootMaintUiLib: Update menus when open BMM form
BootMaintenanceManagerUiLib depend on the LeagcyBootMaintUiLib to show the
legacy menus. So we need to do the actions related to LegacyUi in BMM
after the LeagcyBootMaintUiLib have been initialized. So now : 1). update
menus (including legacy menus), 2) re-scan boot options (including legacy
boot option) when opening the BMM form. We think when opening BMM form,
the LeagcyBootMaintUiLib must have been initialized.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdeModulePkg')
3 files changed, 46 insertions, 9 deletions
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c index 393091f39a..c2263e3422 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c @@ -84,6 +84,7 @@ BMM_CALLBACK_DATA gBootMaintenancePrivate = { BMM_CALLBACK_DATA *mBmmCallbackInfo = &gBootMaintenancePrivate;
BOOLEAN mAllMenuInit = FALSE;
+BOOLEAN mFirstEnterBMMForm = FALSE;
/**
Init all memu.
@@ -106,6 +107,16 @@ FreeAllMenu ( );
/**
+
+ Update the menus in the BMM page.
+
+**/
+VOID
+CustomizeMenus (
+ VOID
+ );
+
+/**
This function will change video resolution and text mode
according to defined setup mode or defined boot mode
@@ -874,14 +885,33 @@ BootMaintCallback ( UINTN Index;
EFI_DEVICE_PATH_PROTOCOL * File;
- if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
+ if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED && Action != EFI_BROWSER_ACTION_FORM_OPEN) {
//
- // Do nothing for other UEFI Action. Only do call back when data is changed.
+ // Do nothing for other UEFI Action. Only do call back when data is changed or the form is open.
//
return EFI_UNSUPPORTED;
}
Private = BMM_CALLBACK_DATA_FROM_THIS (This);
+
+ if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
+ if (QuestionId == KEY_VALUE_TRIGGER_FORM_OPEN_ACTION) {
+ if (!mFirstEnterBMMForm) {
+ //
+ // BMMUiLib depends on LegacyUi library to show legacy menus.
+ // If we want to show Legacy menus correctly in BMM page,
+ // we must do it after the LegacyUi library has already been initialized.
+ // Opening the BMM form is the appropriate time that the LegacyUi library has already been initialized.
+ // So we do the tasks which are related to legacy menus here.
+ // 1. Update the menus (including legacy munu) show in BootMiantenanceManager page.
+ // 2. Re-scan the BootOption menus (including the legacy boot option).
+ //
+ CustomizeMenus ();
+ BOpt_GetBootOptions (Private);
+ mFirstEnterBMMForm = TRUE;
+ }
+ }
+ }
//
// Retrive uncommitted data from Form Browser
//
@@ -1227,11 +1257,6 @@ InitializeBmmConfig ( CallbackData->BmmFakeNvData.ForceReconnect = TRUE;
//
- // Update the menus.
- //
- CustomizeMenus ();
-
- //
// Backup Initialize BMM configuartion data to BmmOldFakeNVData
//
CopyMem (&CallbackData->BmmOldFakeNVData, &CallbackData->BmmFakeNvData, sizeof (BMM_FAKE_NV_DATA));
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.vfr b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.vfr index d46a3e9b91..b0a636f566 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.vfr +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.vfr @@ -1,7 +1,7 @@ ///** @file
// Boot Maintenance Utility Formset
//
-// Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
@@ -27,6 +27,17 @@ formset form formid = FORM_MAIN_ID,
title = STRING_TOKEN(STR_FORM_MAIN_TITLE);
+ //
+ // Add this invisible text in order to indicate enter Boot Maintenance Manager form.
+ // To trigger the form open action.
+ //
+ suppressif TRUE;
+ text
+ help = STRING_TOKEN(STR_NONE),
+ text = STRING_TOKEN(STR_NONE),
+ flags = INTERACTIVE,
+ key = KEY_VALUE_TRIGGER_FORM_OPEN_ACTION;
+ endif;
label LABEL_FORM_MAIN_START;
//
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/FormGuid.h b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/FormGuid.h index 3e3897e6ba..299a149f60 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/FormGuid.h +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/FormGuid.h @@ -1,7 +1,7 @@ /** @file
Formset guids, form id and VarStore data structure for Boot Maintenance Manager.
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -72,6 +72,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define KEY_VALUE_NO_SAVE_AND_EXIT_BOOT 0x1114
#define KEY_VALUE_SAVE_AND_EXIT_DRIVER 0x1115
#define KEY_VALUE_NO_SAVE_AND_EXIT_DRIVER 0x1116
+#define KEY_VALUE_TRIGGER_FORM_OPEN_ACTION 0x1117
#define MAXIMUM_NORMAL_KEY_VALUE 0x11FF
|