<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Yes agreed, making this more consistent would be a good improvement and one that I would support. There is always the perennial issue of finding the time to make those improvements and balancing that with everything else that needs to get
 done <span style="font-family:"Segoe UI Emoji",sans-serif">😊</span>.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Benjamin Doron <benjamin.doron00@gmail.com> <br>
<b>Sent:</b> Thursday, August 26, 2021 4:50 PM<br>
<b>To:</b> Desimone, Nathaniel L <nathaniel.l.desimone@intel.com><br>
<b>Cc:</b> devel@edk2.groups.io; Dong, Eric <eric.dong@intel.com>; Liming Gao <gaoliming@byosoft.com.cn><br>
<b>Subject:</b> Re: [edk2-platforms][PATCH v2 2/2] BoardModulePkg/BoardBdsHookLib: Simplify hotkey registration<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Hi Nate,<o:p></o:p></p>
<div>
<p class="MsoNormal">That makes sense. I had been concerned that UiApp might be used in some places, but I didn't expect significant disparity between the boards (and I didn't check all of them, my mistake).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Maybe trying to align them on some differences, someday, might be a good idea? But not for now, in any case.<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu., Aug. 26, 2021, 7:41 p.m. Desimone, Nathaniel L, <<a href="mailto:nathaniel.l.desimone@intel.com">nathaniel.l.desimone@intel.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi Benjamin,<br>
<br>
In principle this is a good idea, unfortunately some platforms have been coded to do stuff like this:<br>
<a href="https://github.com/tianocore/edk2-platforms/blob/784f7739f5afd268042d4d9e8ef570131620c82c/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc#L323" target="_blank">https://github.com/tianocore/edk2-platforms/blob/784f7739f5afd268042d4d9e8ef570131620c82c/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc#L323</a><br>
<br>
And this:<br>
<a href="https://github.com/tianocore/edk2-platforms/blob/784f7739f5afd268042d4d9e8ef570131620c82c/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc#L210" target="_blank">https://github.com/tianocore/edk2-platforms/blob/784f7739f5afd268042d4d9e8ef570131620c82c/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc#L210</a><br>
<br>
So the only way we can maintain a consistent user experience is to explicitly call out the GUID for the boot device selection menu. For now, I'll just push the first patch in this series.<br>
<br>
Thanks,<br>
Nate<br>
<br>
-----Original Message-----<br>
From: Benjamin Doron <<a href="mailto:benjamin.doron00@gmail.com" target="_blank">benjamin.doron00@gmail.com</a>>
<br>
Sent: Friday, August 13, 2021 5:43 PM<br>
To: <a href="mailto:devel@edk2.groups.io" target="_blank">devel@edk2.groups.io</a><br>
Cc: Dong, Eric <<a href="mailto:eric.dong@intel.com" target="_blank">eric.dong@intel.com</a>>; Liming Gao <<a href="mailto:gaoliming@byosoft.com.cn" target="_blank">gaoliming@byosoft.com.cn</a>>; Desimone, Nathaniel L <<a href="mailto:nathaniel.l.desimone@intel.com" target="_blank">nathaniel.l.desimone@intel.com</a>><br>
Subject: [edk2-platforms][PATCH v2 2/2] BoardModulePkg/BoardBdsHookLib: Simplify hotkey registration<br>
<br>
Retrieve BootOption of BootManagerMenu for registering F7 hotkey, rather than creating an additional boot option.<br>
<br>
Tested, both F7 hotkey still opens the list of boot options.<br>
<br>
Cc: Eric Dong <<a href="mailto:eric.dong@intel.com" target="_blank">eric.dong@intel.com</a>><br>
Cc: Liming Gao <<a href="mailto:gaoliming@byosoft.com.cn" target="_blank">gaoliming@byosoft.com.cn</a>><br>
Cc: Nate DeSimone <<a href="mailto:nathaniel.l.desimone@intel.com" target="_blank">nathaniel.l.desimone@intel.com</a>><br>
Signed-off-by: Benjamin Doron <<a href="mailto:benjamin.doron00@gmail.com" target="_blank">benjamin.doron00@gmail.com</a>><br>
---<br>
Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c | 19 ++++---------------<br>
 1 file changed, 4 insertions(+), 15 deletions(-)<br>
<br>
diff --git a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c<br>
index e734e3ad15c3..7ac6c150f2e7 100644<br>
--- a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c<br>
+++ b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c<br>
@@ -14,7 +14,6 @@ BOOLEAN    mPxeBoot       = FALSE;<br>
 BOOLEAN    mHotKeypressed = FALSE;<br>
 EFI_EVENT  HotKeyEvent    = NULL;<br>
<br>
-UINTN      mBootMenuOptionNumber;<br>
 UINTN      mSetupOptionNumber;<br>
<br>
<br>
@@ -189,9 +188,6 @@ CreateFvBootOption (<br>
 EFI_GUID mUiFile = {<br>
   0x462CAA21, 0x7614, 0x4503, { 0x83, 0x6E, 0x8A, 0xB6, 0xF4, 0x66, 0x23, 0x31 }<br>
 };<br>
-EFI_GUID mBootMenuFile = {<br>
-  0xEEC25BDC, 0x67F2, 0x4D95, { 0xB1, 0xD5, 0xF8, 0x1B, 0x20, 0x39, 0xD1, 0x1D }<br>
-};<br>
<br>
<br>
 /**<br>
@@ -354,15 +350,6 @@ RegisterDefaultBootOption (<br>
     ShellDataSize = 0;<br>
     RegisterFvBootOption (&gUefiShellFileGuid,      INTERNAL_UEFI_SHELL_NAME, (UINTN) -1, LOAD_OPTION_ACTIVE, (UINT8 *)ShellData, ShellDataSize);<br>
<br>
-  //<br>
-  // Boot Menu<br>
-  //<br>
-  mBootMenuOptionNumber = RegisterFvBootOption (&mBootMenuFile, L"Boot Device List",   (UINTN) -1, LOAD_OPTION_CATEGORY_APP | LOAD_OPTION_ACTIVE | LOAD_OPTION_HIDDEN, NULL, 0);<br>
-<br>
-  if (mBootMenuOptionNumber == LoadOptionNumberUnassigned) {<br>
-    DEBUG ((DEBUG_INFO, "BootMenuOptionNumber (%d) should not be same to LoadOptionNumberUnassigned(%d).\n", mBootMenuOptionNumber, LoadOptionNumberUnassigned));<br>
-  }<br>
-<br>
   //<br>
   // Boot Manager Menu<br>
   //<br>
@@ -468,8 +455,10 @@ RegisterStaticHotkey (<br>
   F7.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID;<br>
   F7.KeyState.KeyToggleState = 0;<br>
   mBootMenuBoot  = !EnterSetup;<br>
-  RegisterBootOptionHotkey ((UINT16) mBootMenuOptionNumber, &F7.Key, mBootMenuBoot);<br>
-<br>
+  Status = EfiBootManagerGetBootManagerMenu (&BootOption);<br>
+  ASSERT_EFI_ERROR (Status);<br>
+  RegisterBootOptionHotkey ((UINT16) BootOption.OptionNumber, &F7.Key, mBootMenuBoot);<br>
+  EfiBootManagerFreeLoadOption (&BootOption);<br>
 }<br>
<br>
<br>
-- <br>
2.31.1<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr>   Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/79875">View/Reply Online (#79875)</a> |    |  <a target="_blank" href="https://groups.io/mt/84876596/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>