From: "Benjamin Doron" <benjamin.doron00@gmail.com>
To: devel@edk2.groups.io
Cc: Eric Dong <eric.dong@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>,
Nate DeSimone <nathaniel.l.desimone@intel.com>
Subject: [edk2-platforms][PATCH v2 1/2] BoardModulePkg/BoardBdsHookLib: Register UiApp as boot option
Date: Fri, 13 Aug 2021 20:42:37 -0400 [thread overview]
Message-ID: <20210814004238.10783-1-benjamin.doron00@gmail.com> (raw)
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
next reply other threads:[~2021-08-14 0:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-14 0:42 Benjamin Doron [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210814004238.10783-1-benjamin.doron00@gmail.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox