[edk2-devel] [edk2-platforms][PATCH v2 1/2] BoardModulePkg/BoardBdsHookLib: Register UiApp as boot option

Nate DeSimone nathaniel.l.desimone at intel.com
Fri Aug 27 00:23:19 UTC 2021


Pushed: https://github.com/tianocore/edk2-platforms/commit/b401dfd

-----Original Message-----
From: Benjamin Doron <benjamin.doron00 at gmail.com> 
Sent: Friday, August 13, 2021 5:43 PM
To: devel at edk2.groups.io
Cc: Dong, Eric <eric.dong at intel.com>; Liming Gao <gaoliming at byosoft.com.cn>; Desimone, Nathaniel L <nathaniel.l.desimone at intel.com>
Subject: [edk2-platforms][PATCH v2 1/2] BoardModulePkg/BoardBdsHookLib: Register UiApp as boot option

BootManagerMenuApp is the default PcdBootManagerMenuFile. It allows choosing a boot device, but system configuration is performed in UiApp.
Therefore, un-comment and fix UiApp boot option registration.

The F2 hotkey can be used to enter UiApp.

Cc: Eric Dong <eric.dong at intel.com>
Cc: Liming Gao <gaoliming at byosoft.com.cn>
Cc: Nate DeSimone <nathaniel.l.desimone at intel.com>
Signed-off-by: Benjamin Doron <benjamin.doron00 at gmail.com>
---
 Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c |  2 +-  Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c | 29 +++++++-------------
 2 files changed, 11 insertions(+), 20 deletions(-)

diff --git a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
index a37139a0074e..0bcee7c9a4ba 100644
--- a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
+++ b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHook
+++ Lib.c
@@ -1385,7 +1385,7 @@ BdsAfterConsoleReadyBeforeBootOptionCallback (
       break;   } -  Print (L"Press F7 for BootMenu!\n");+  Print (L"Press F2 for Setup, or F7 for BootMenu!\n");   }diff --git a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c
index 87138bdd79ff..e734e3ad15c3 100644
--- a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c
+++ b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOpt
+++ ion.c
@@ -15,6 +15,7 @@ BOOLEAN    mHotKeypressed = FALSE;
 EFI_EVENT  HotKeyEvent    = NULL;  UINTN      mBootMenuOptionNumber;+UINTN      mSetupOptionNumber;   /**@@ -361,20 +362,11 @@ RegisterDefaultBootOption (
   if (mBootMenuOptionNumber == LoadOptionNumberUnassigned) {     DEBUG ((DEBUG_INFO, "BootMenuOptionNumber (%d) should not be same to LoadOptionNumberUnassigned(%d).\n", mBootMenuOptionNumber, LoadOptionNumberUnassigned));   }-#if 0+   //   // Boot Manager Menu   //-  EfiInitializeFwVolDevicepathNode (&FileNode, &mUiFile);--  gBS->HandleProtocol (-         gImageHandle,-         &gEfiLoadedImageProtocolGuid,-         (VOID **) &LoadedImage-         );-  DevicePath = AppendDevicePathNode (DevicePathFromHandle (LoadedImage->DeviceHandle), (EFI_DEVICE_PATH_PROTOCOL *) &FileNode);-#endif-+  mSetupOptionNumber = RegisterFvBootOption (&mUiFile, L"Enter Setup", (UINTN) -1, LOAD_OPTION_CATEGORY_APP | LOAD_OPTION_ACTIVE | LOAD_OPTION_HIDDEN, NULL, 0); }  /**@@ -463,14 +455,13 @@ RegisterStaticHotkey (
   //   // [F2]/[F7]   //-  F2.Key.ScanCode    = SCAN_F2;-  F2.Key.UnicodeChar = CHAR_NULL;-  F2.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID;-  F2.KeyState.KeyToggleState = 0;-  Status = EfiBootManagerGetBootManagerMenu (&BootOption);-  ASSERT_EFI_ERROR (Status);-  RegisterBootOptionHotkey ((UINT16) BootOption.OptionNumber, &F2.Key, TRUE);-  EfiBootManagerFreeLoadOption (&BootOption);+  if (mSetupOptionNumber) {+    F2.Key.ScanCode    = SCAN_F2;+    F2.Key.UnicodeChar = CHAR_NULL;+    F2.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID;+    F2.KeyState.KeyToggleState = 0;+    RegisterBootOptionHotkey ((UINT16) mSetupOptionNumber, &F2.Key, TRUE);+  }    F7.Key.ScanCode    = SCAN_F7;   F7.Key.UnicodeChar = CHAR_NULL;-- 
2.31.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#79874): https://edk2.groups.io/g/devel/message/79874
Mute This Topic: https://groups.io/mt/84876595/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list