public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-platforms][PATCH v2 1/2] BoardModulePkg/BoardBdsHookLib: Register UiApp as boot option
@ 2021-08-14  0:42 Benjamin Doron
  2021-08-14  0:42 ` [edk2-platforms][PATCH v2 2/2] BoardModulePkg/BoardBdsHookLib: Simplify hotkey registration Benjamin Doron
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Benjamin Doron @ 2021-08-14  0:42 UTC (permalink / raw)
  To: devel; +Cc: Eric Dong, Liming Gao, Nate DeSimone

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@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Benjamin Doron <benjamin.doron00@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/BoardBdsHookLib.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/BoardBootOption.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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-08-27  0:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-14  0:42 [edk2-platforms][PATCH v2 1/2] BoardModulePkg/BoardBdsHookLib: Register UiApp as boot option Benjamin Doron
2021-08-14  0:42 ` [edk2-platforms][PATCH v2 2/2] BoardModulePkg/BoardBdsHookLib: Simplify hotkey registration Benjamin Doron
2021-08-26 23:41   ` Nate DeSimone
2021-08-26 23:49     ` Benjamin Doron
2021-08-27  0:27       ` Nate DeSimone
2021-08-26 23:41 ` [edk2-platforms][PATCH v2 1/2] BoardModulePkg/BoardBdsHookLib: Register UiApp as boot option Nate DeSimone
2021-08-27  0:23 ` Nate DeSimone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox