public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 43/43] UefiPayloadPkg: Make Boot Manager Key configurable
       [not found] <9dd14fc91c174eae87fd122c7ac70073a363527f.1643662304.git.sean@starlabs.systems>
@ 2022-01-31 20:52 ` Sean Rhodes
  2022-02-01 22:46   ` [edk2-devel] " Guo Dong
  0 siblings, 1 reply; 3+ messages in thread
From: Sean Rhodes @ 2022-01-31 20:52 UTC (permalink / raw)
  To: devel; +Cc: Sean Rhodes

Provide a build option to use [Esc] instead of [F2] for devices
such as Chromebooks that don't have F-keys.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
 .../PlatformBootManager.c                     | 43 +++++++++++++------
 .../PlatformBootManagerLib.inf                |  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec             |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc             |  8 ++++
 4 files changed, 42 insertions(+), 13 deletions(-)

diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..6163e776c4 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
@@ -164,7 +164,7 @@ PlatformBootManagerBeforeConsole (
   )
 {
   EFI_INPUT_KEY                 Enter;
-  EFI_INPUT_KEY                 F2;
+  EFI_INPUT_KEY                 CustomKey;
   EFI_INPUT_KEY                 Down;
   EFI_BOOT_MANAGER_LOAD_OPTION  BootOption;
   EFI_STATUS                    Status;
@@ -186,13 +186,21 @@ PlatformBootManagerBeforeConsole (
   Enter.UnicodeChar = CHAR_CARRIAGE_RETURN;
   EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL);
 
-  //
-  // Map F2 to Boot Manager Menu
-  //
-  F2.ScanCode    = SCAN_F2;
-  F2.UnicodeChar = CHAR_NULL;
+  if (FixedPcdGetBool (PcdBootManagerEscape) ) {
+    //
+    // Map Esc to Boot Manager Menu
+    //
+    CustomKey.ScanCode        = SCAN_ESC;
+    CustomKey.UnicodeChar     = CHAR_NULL;
+  } else {
+    //
+    // Map Esc to Boot Manager Menu
+    //
+    CustomKey.ScanCode    = SCAN_F2;
+    CustomKey.UnicodeChar = CHAR_NULL;
+  }
   EfiBootManagerGetBootManagerMenu (&BootOption);
-  EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumber, 0, &F2, NULL);
+  EfiBootManagerAddKeyOptionVariable (NULL, (UINT16) BootOption.OptionNumber, 0, &CustomKey, NULL);
 
   //
   // Also add Down key to Boot Manager Menu since some serial terminals don't support F2 key.
@@ -251,12 +259,21 @@ PlatformBootManagerAfterConsole (
   //
   PlatformRegisterFvBootOption (PcdGetPtr (PcdShellFile), L"UEFI Shell", LOAD_OPTION_ACTIVE);
 
-  Print (
-    L"\n"
-    L"F2 or Down      to enter Boot Manager Menu.\n"
-    L"ENTER           to boot directly.\n"
-    L"\n"
-    );
+  if (FixedPcdGetBool (PcdBootManagerEscape) ) {
+    Print (
+      L"\n"
+      L"Esc or Down      to enter Boot Manager Menu.\n"
+      L"ENTER           to boot directly.\n"
+      L"\n"
+      );
+  } else {
+    Print (
+      L"\n"
+      L"F2 or Down      to enter Boot Manager Menu.\n"
+      L"ENTER           to boot directly.\n"
+      L"\n"
+      );
+  }
 }
 
 /**
diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 9c4a9da943..80390e0d98 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
@@ -73,3 +73,4 @@
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits
   gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile
+  gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dec b/UefiPayloadPkg/UefiPayloadPkg.dec
index 551f0a4915..7246c3495b 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -83,6 +83,9 @@ gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x04000000|UINT32|0x
 
 gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 0xcf, 0x80, 0xab, 0x87, 0xf9, 0x47, 0xa3, 0xfe, 0xD5, 0x0B, 0x76, 0xd8, 0x95, 0x41 }|VOID*|0x00000018
 
+# Boot Manager Key
+gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|TRUE|BOOLEAN|0x00000020
+
 ## FFS filename to find the default variable initial data file.
 # @Prompt FFS Name of variable initial data file
  gUefiPayloadPkgTokenSpaceGuid.PcdNvsDataFile |{ 0x1a, 0xf1, 0xb1, 0xae, 0x42, 0xcc, 0xcf, 0x4e, 0xac, 0x60, 0xdb, 0xab, 0xf6, 0xca, 0x69, 0xe6 }|VOID*|0x00000025
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1ce96a51c1..3d7c7a6baf 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -33,6 +33,8 @@
   DEFINE UNIVERSAL_PAYLOAD            = FALSE
   DEFINE SECURITY_STUB_ENABLE         = TRUE
   DEFINE SMM_SUPPORT                  = FALSE
+  DEFINE BOOT_MANAGER_ESCAPE          = FALSE
+  DEFINE PLATFORM_BOOT_TIMEOUT        = 3
   #
   # SBL:      UEFI payload for Slim Bootloader
   # COREBOOT: UEFI payload for coreboot
@@ -399,6 +401,12 @@
   gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask       | 0x1
 !endif
 
+!if $(BOOT_MANAGER_ESCAPE) == TRUE
+  gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|TRUE
+!else
+  gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE
+!endif
+
 [PcdsPatchableInModule.X64]
   gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)
   gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister|$(RTC_TARGET_REGISTER)
-- 
2.32.0


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

* Re: [edk2-devel] [PATCH 43/43] UefiPayloadPkg: Make Boot Manager Key configurable
  2022-01-31 20:52 ` [PATCH 43/43] UefiPayloadPkg: Make Boot Manager Key configurable Sean Rhodes
@ 2022-02-01 22:46   ` Guo Dong
  2022-03-31  8:28     ` Sheng Lean Tan
  0 siblings, 1 reply; 3+ messages in thread
From: Guo Dong @ 2022-02-01 22:46 UTC (permalink / raw)
  To: devel@edk2.groups.io, Rhodes, Sean


Better change to:
gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)
for this change:
+!if $(BOOT_MANAGER_ESCAPE) == TRUE
+  gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|TRUE
+!else
+  gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE
+!endif
+

Thanks,
Guo

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Sean Rhodes
Sent: Monday, January 31, 2022 1:52 PM
To: devel@edk2.groups.io
Cc: Rhodes, Sean <sean@starlabs.systems>
Subject: [edk2-devel] [PATCH 43/43] UefiPayloadPkg: Make Boot Manager Key configurable

Provide a build option to use [Esc] instead of [F2] for devices such as Chromebooks that don't have F-keys.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
 .../PlatformBootManager.c                     | 43 +++++++++++++------
 .../PlatformBootManagerLib.inf                |  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec             |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc             |  8 ++++
 4 files changed, 42 insertions(+), 13 deletions(-)

diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..6163e776c4 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.
+++ c
@@ -164,7 +164,7 @@ PlatformBootManagerBeforeConsole (
   ) {   EFI_INPUT_KEY                 Enter;-  EFI_INPUT_KEY                 F2;+  EFI_INPUT_KEY                 CustomKey;   EFI_INPUT_KEY                 Down;   EFI_BOOT_MANAGER_LOAD_OPTION  BootOption;   EFI_STATUS                    Status;@@ -186,13 +186,21 @@ PlatformBootManagerBeforeConsole (
   Enter.UnicodeChar = CHAR_CARRIAGE_RETURN;   EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL); -  //-  // Map F2 to Boot Manager Menu-  //-  F2.ScanCode    = SCAN_F2;-  F2.UnicodeChar = CHAR_NULL;+  if (FixedPcdGetBool (PcdBootManagerEscape) ) {+    //+    // Map Esc to Boot Manager Menu+    //+    CustomKey.ScanCode        = SCAN_ESC;+    CustomKey.UnicodeChar     = CHAR_NULL;+  } else {+    //+    // Map Esc to Boot Manager Menu+    //+    CustomKey.ScanCode    = SCAN_F2;+    CustomKey.UnicodeChar = CHAR_NULL;+  }   EfiBootManagerGetBootManagerMenu (&BootOption);-  EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumber, 0, &F2, NULL);+  EfiBootManagerAddKeyOptionVariable (NULL, (UINT16) BootOption.OptionNumber, 0, &CustomKey, NULL);    //   // Also add Down key to Boot Manager Menu since some serial terminals don't support F2 key.@@ -251,12 +259,21 @@ PlatformBootManagerAfterConsole (
   //   PlatformRegisterFvBootOption (PcdGetPtr (PcdShellFile), L"UEFI Shell", LOAD_OPTION_ACTIVE); -  Print (-    L"\n"-    L"F2 or Down      to enter Boot Manager Menu.\n"-    L"ENTER           to boot directly.\n"-    L"\n"-    );+  if (FixedPcdGetBool (PcdBootManagerEscape) ) {+    Print (+      L"\n"+      L"Esc or Down      to enter Boot Manager Menu.\n"+      L"ENTER           to boot directly.\n"+      L"\n"+      );+  } else {+    Print (+      L"\n"+      L"F2 or Down      to enter Boot Manager Menu.\n"+      L"ENTER           to boot directly.\n"+      L"\n"+      );+  } }  /**diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
index 9c4a9da943..80390e0d98 100644
--- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerL
+++ ib.inf
@@ -73,3 +73,4 @@
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits   gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile+  gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscapediff --git a/UefiPayloadPkg/UefiPayloadPkg.dec b/UefiPayloadPkg/UefiPayloadPkg.dec
index 551f0a4915..7246c3495b 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -83,6 +83,9 @@ gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x04000000|UINT32|0x
  gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 0xcf, 0x80, 0xab, 0x87, 0xf9, 0x47, 0xa3, 0xfe, 0xD5, 0x0B, 0x76, 0xd8, 0x95, 0x41 }|VOID*|0x00000018 +# Boot Manager Key+gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|TRUE|BOOLEAN|0x00000020+ ## FFS filename to find the default variable initial data file. # @Prompt FFS Name of variable initial data file  gUefiPayloadPkgTokenSpaceGuid.PcdNvsDataFile |{ 0x1a, 0xf1, 0xb1, 0xae, 0x42, 0xcc, 0xcf, 0x4e, 0xac, 0x60, 0xdb, 0xab, 0xf6, 0xca, 0x69, 0xe6 }|VOID*|0x00000025diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1ce96a51c1..3d7c7a6baf 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -33,6 +33,8 @@
   DEFINE UNIVERSAL_PAYLOAD            = FALSE   DEFINE SECURITY_STUB_ENABLE         = TRUE   DEFINE SMM_SUPPORT                  = FALSE+  DEFINE BOOT_MANAGER_ESCAPE          = FALSE+  DEFINE PLATFORM_BOOT_TIMEOUT        = 3   #   # SBL:      UEFI payload for Slim Bootloader   # COREBOOT: UEFI payload for coreboot@@ -399,6 +401,12 @@
   gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask       | 0x1 !endif +!if $(BOOT_MANAGER_ESCAPE) == TRUE+  gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|TRUE+!else+  gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE+!endif+ [PcdsPatchableInModule.X64]   gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)   gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister|$(RTC_TARGET_REGISTER)-- 
2.32.0



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#86262): https://edk2.groups.io/g/devel/message/86262
Mute This Topic: https://groups.io/mt/88817968/1781375
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.dong@intel.com] -=-=-=-=-=-=



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

* Re: [edk2-devel] [PATCH 43/43] UefiPayloadPkg: Make Boot Manager Key configurable
  2022-02-01 22:46   ` [edk2-devel] " Guo Dong
@ 2022-03-31  8:28     ` Sheng Lean Tan
  0 siblings, 0 replies; 3+ messages in thread
From: Sheng Lean Tan @ 2022-03-31  8:28 UTC (permalink / raw)
  To: Guo Dong, devel

[-- Attachment #1: Type: text/plain, Size: 56 bytes --]

Merged:

https://github.com/tianocore/edk2/pull/2596

[-- Attachment #2: Type: text/html, Size: 68 bytes --]

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

end of thread, other threads:[~2022-03-31  8:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <9dd14fc91c174eae87fd122c7ac70073a363527f.1643662304.git.sean@starlabs.systems>
2022-01-31 20:52 ` [PATCH 43/43] UefiPayloadPkg: Make Boot Manager Key configurable Sean Rhodes
2022-02-01 22:46   ` [edk2-devel] " Guo Dong
2022-03-31  8:28     ` Sheng Lean Tan

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