[edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

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

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sean Rhodes 
---
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  2 +
 4 files changed, 37 insertions(+), 13 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 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_STATUSStatus;
@@ -186,13 +186,22 @@ 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 +260,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 e9204d1168..4051172caf 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -86,6 +86,9 @@ gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 
0xcf, 0x80, 0xab, 0
 # Above 4G Memory
 
gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|TRUE|BOOLEAN|0x0019
 
+# Boot Manager Key
+gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x0020
+
 ## 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*|0x0025
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 4fe81a61d6..558513baf1 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -34,6 +34,7 @@
   DEFINE SECURITY_STUB_ENABLE = TRUE
   DEFINE SMM_SUPPORT  = FALSE
   DEFINE ABOVE_4G_MEMORY  = TRUE
+  DEFINE BOOT_MANAGER_ESCAPE  = FALSE
   #
   # SBL:  UEFI payload for Slim Bootloader
   # COREBOOT: UEFI payload for coreboot
@@ -401,6 +402,7 @@
 !endif
 
   
gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|$(ABOVE_4G_MEMORY)
+  gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)
 
 [PcdsPatchableInModule.X64]
   gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)
-- 
2.32.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You recei

[edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-02-01 Thread 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 
---
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  4 ++
 4 files changed, 39 insertions(+), 13 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 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_STATUSStatus;
@@ -186,13 +186,22 @@ 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 +260,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..f2fcdf6a74 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -83,6 +83,9 @@ 
gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x0400|UINT32|0x
 
 gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 0xcf, 0x80, 0xab, 
0x87, 0xf9, 0x47, 0xa3, 0xfe, 0xD5, 0x0B, 0x76, 0xd8, 0x95, 0x41 
}|VOID*|0x0018
 
+# Boot Manager Key
+gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x0020
+
 ## 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*|0x0025
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1ce96a51c1..5e1892458e 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,8 @@
   gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask   | 0x1
 !endif
 
+  gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)
+
 [PcdsPatchableInModule.X64]
   gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)
   gPcAtChipsetPkgTokenSpac

[edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-02-03 Thread 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 
---
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  3 ++
 4 files changed, 38 insertions(+), 13 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 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_STATUSStatus;
@@ -186,13 +186,22 @@ 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 +260,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..f2fcdf6a74 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -83,6 +83,9 @@ 
gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x0400|UINT32|0x
 
 gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 0xcf, 0x80, 0xab, 
0x87, 0xf9, 0x47, 0xa3, 0xfe, 0xD5, 0x0B, 0x76, 0xd8, 0x95, 0x41 
}|VOID*|0x0018
 
+# Boot Manager Key
+gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x0020
+
 ## 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*|0x0025
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1ce96a51c1..ee9680a2b7 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -33,6 +33,7 @@
   DEFINE UNIVERSAL_PAYLOAD= FALSE
   DEFINE SECURITY_STUB_ENABLE = TRUE
   DEFINE SMM_SUPPORT  = FALSE
+  DEFINE BOOT_MANAGER_ESCAPE  = FALSE
   #
   # SBL:  UEFI payload for Slim Bootloader
   # COREBOOT: UEFI payload for coreboot
@@ -399,6 +400,8 @@
   gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask   | 0x1
 !endif
 
+  gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|$(BOOT_MANAGER_ESCAPE)
+
 [PcdsPatchableInModule.X64]
   gPcAtChipsetPkgTokenSpaceGuid.PcdRtcIndexRegister|$(RTC_INDEX_REGISTER)
   gPcAtChipsetPkgTokenSpaceGuid.PcdRtcTargetRegister|$(RTC_TARGET_REG

[edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

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

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sean Rhodes 
---
 .../Library/BrotliCustomDecompressLib/brotli  |  2 +-
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  3 ++
 5 files changed, 39 insertions(+), 14 deletions(-)

diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
index f4153a09f8..666c3280cc 16
--- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
+++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
@@ -1 +1 @@
-Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea
+Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 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_STATUSStatus;
@@ -186,13 +186,22 @@ 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 +260,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..f2fcdf6a74 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -83,6 +83,9 @@ 
gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x0400|UINT32|0x
 
 gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 0xcf, 0x80, 0xab, 
0x87, 0xf9, 0x47, 0xa3, 0xfe, 0xD5, 0x0B, 0x76, 0xd8, 0x95, 0x41 
}|VOID*|0x0018
 
+# Boot Manager Key
+gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x0020
+
 ## 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*|0x0025
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1ce96a51c1..ee9680a2b7 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -33,6 +33,7 @@
   DEFINE UNIVERSAL_PAYLOAD= FALSE
   DEFINE SECURITY_STUB_ENABLE = TRUE
   DEFINE SMM_SUPP

[edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

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

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sean Rhodes 
---
 .../Library/BrotliCustomDecompressLib/brotli  |  2 +-
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  3 ++
 5 files changed, 39 insertions(+), 14 deletions(-)

diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
index f4153a09f8..666c3280cc 16
--- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
+++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
@@ -1 +1 @@
-Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea
+Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 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_STATUSStatus;
@@ -186,13 +186,22 @@ 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 +260,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..f2fcdf6a74 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -83,6 +83,9 @@ 
gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x0400|UINT32|0x
 
 gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 0xcf, 0x80, 0xab, 
0x87, 0xf9, 0x47, 0xa3, 0xfe, 0xD5, 0x0B, 0x76, 0xd8, 0x95, 0x41 
}|VOID*|0x0018
 
+# Boot Manager Key
+gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x0020
+
 ## 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*|0x0025
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1ce96a51c1..ee9680a2b7 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -33,6 +33,7 @@
   DEFINE UNIVERSAL_PAYLOAD= FALSE
   DEFINE SECURITY_STUB_ENABLE = TRUE
   DEFINE SMM_SUPP

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-03-04 Thread Guo Dong

Could you re-send the patch without  
.../Library/BrotliCustomDecompressLib/brotli?

Thanks,
Guo

From: Ni, Ray 
Sent: Monday, February 28, 2022 6:28 PM
To: Rhodes, Sean 
Cc: devel@edk2.groups.io; Dong, Guo ; Ma, Maurice 
; You, Benjamin 
Subject: RE: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

Reviewed-by: Ray Ni mailto:ray...@intel.com>>

From: Sean Rhodes mailto:sean@starlabs.systems>>
Sent: Wednesday, February 23, 2022 3:22 AM
To: Ni, Ray mailto:ray...@intel.com>>
Cc: devel@edk2.groups.io; Dong, Guo 
mailto:guo.d...@intel.com>>; Ma, Maurice 
mailto:maurice...@intel.com>>; You, Benjamin 
mailto:benjamin@intel.com>>
Subject: Re: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

True - but the experience is better with F2 (on "normal" 
computers/non-Chromebooks).

We've got a lot of feedback, and for most, people turn on their computers and 
start tapping Escape when they want Grub. If it's mapped, this gets intercepted 
by UiApp. Even if they exit, with BGRT in the equation, it requires fairly 
precise timing to access Grub.

On Tue, 22 Feb 2022 at 04:59, Ni, Ray 
mailto:ray...@intel.com>> wrote:
Grub runs later. Then what does “conflict” mean?

From: Sean Rhodes mailto:sean@starlabs.systems>>
Sent: Monday, February 21, 2022 3:48 PM
To: Ni, Ray mailto:ray...@intel.com>>
Cc: devel@edk2.groups.io; Dong, Guo 
mailto:guo.d...@intel.com>>; Ma, Maurice 
mailto:maurice...@intel.com>>; You, Benjamin 
mailto:benjamin@intel.com>>
Subject: Re: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

We would prefer to keep PCD, as Esc can conflict with Grub on normal (not 
Chromebook) devices

Thank you

On Mon, 21 Feb 2022 at 05:26, Ni, Ray 
mailto:ray...@intel.com>> wrote:
Can you just map both ESC and F2 to the UI? So that PCD is not needed.

Thanks,
Ray

-Original Message-
From: Sean Rhodes mailto:sean@starlabs.systems>>
Sent: Monday, February 21, 2022 5:39 AM
To: devel@edk2.groups.io
Cc: Dong, Guo mailto:guo.d...@intel.com>>; Rhodes, Sean 
mailto:sean@starlabs.systems>>; Ni, Ray 
mailto:ray...@intel.com>>; Ma, Maurice 
mailto:maurice...@intel.com>>; You, Benjamin 
mailto:benjamin@intel.com>>
Subject: [PATCH] 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.

Cc: Guo Dong mailto:guo.d...@intel.com>>
Cc: Ray Ni mailto:ray...@intel.com>>
Cc: Maurice Ma mailto:maurice...@intel.com>>
Cc: Benjamin You mailto:benjamin@intel.com>>
Signed-off-by: Sean Rhodes mailto:sean@starlabs.systems>>
---
 .../Library/BrotliCustomDecompressLib/brotli  |  2 +-
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  3 ++
 5 files changed, 39 insertions(+), 14 deletions(-)

diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
index f4153a09f8..666c3280cc 16
--- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
+++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
@@ -1 +1 @@
-Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea
+Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 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_STATUSStatus;

@@ -186,13 +186,22 @@ 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 M

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-03-07 Thread Guo Dong


Reviewed-by: Guo Dong 

-Original Message-
From: Sean Rhodes  
Sent: Saturday, March 5, 2022 3:15 AM
To: devel@edk2.groups.io
Cc: Rhodes, Sean ; Dong, Guo ; Ni, 
Ray ; Ma, Maurice ; You, Benjamin 

Subject: [PATCH] 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.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sean Rhodes 
---
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  2 +
 4 files changed, 37 insertions(+), 13 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 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,22 @@ 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 +260,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 e9204d1168..4051172caf 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -86,6 +86,9 @@ gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 
0xcf, 0x80, 0xab, 0  # Above 4G Memory 
gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|TRUE|BOOLEAN|0x0019
 +# Boot Manager 
Key+gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x0020+
 ## 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*|0x0025diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 4fe81a61d6..558513baf1 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -34,6 +34,7 @@
   DEFINE SECURITY_STUB_ENABLE = TRUE   DEFINE SMM_SUPPORT  
= FALSE   DEFINE ABOVE_4G_MEMORY  = TRUE+  DEFINE 
BOOT_MANAGER_ESCAPE  = FALSE   #   # SBL:  UEFI payload for Slim 
Bootloader   # COREBOOT: UEFI payload for coreboot@@ -401,6 +402,7 @@
 !endif
gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|$(ABOVE_4G_MEMORY)+
  gUefiPayloa

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-03-07 Thread Guo Dong


It was merged @https://github.com/tianocore/edk2/pull/2596
https://github.com/tianocore/edk2/commit/af74efe494c5920c7992b543fada1af2b186bd8c

Thanks,
Guo

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Guo Dong
Sent: Monday, March 7, 2022 1:23 PM
To: Rhodes, Sean ; devel@edk2.groups.io
Cc: Rhodes, Sean ; Ni, Ray ; Ma, 
Maurice ; You, Benjamin 
Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key 
configurable


Reviewed-by: Guo Dong 

-Original Message-
From: Sean Rhodes  
Sent: Saturday, March 5, 2022 3:15 AM
To: devel@edk2.groups.io
Cc: Rhodes, Sean ; Dong, Guo ; Ni, 
Ray ; Ma, Maurice ; You, Benjamin 

Subject: [PATCH] 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.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sean Rhodes 
---
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  2 +
 4 files changed, 37 insertions(+), 13 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 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,22 @@ 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 +260,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 e9204d1168..4051172caf 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -86,6 +86,9 @@ gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 
0xcf, 0x80, 0xab, 0  # Above 4G Memory 
gUefiPayloadPkgTokenSpaceGuid.PcdDispatchModuleAbove4GMemory|TRUE|BOOLEAN|0x0019
 +# Boot Manager 
Key+gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x0020+
 ## 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*|0x0025dif

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-03-31 Thread Sheng Lean Tan
Merged:

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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88303): https://edk2.groups.io/g/devel/message/88303
Mute This Topic: https://groups.io/mt/88853648/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-02-02 Thread Guo Dong


+  DEFINE PLATFORM_BOOT_TIMEOUT= 3
It looks you missed the change to gEfiMdePkgTokenSpaceGuid using 
PLATFORM_BOOT_TIMEOUT.

Thanks,
Guo
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sean Rhodes
Sent: Wednesday, February 2, 2022 12:16 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Rhodes, Sean 
Subject: [edk2-devel] [PATCH] 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 
---
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  4 ++
 4 files changed, 39 insertions(+), 13 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 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,22 @@ 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 +260,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..f2fcdf6a74 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -83,6 +83,9 @@ 
gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x0400|UINT32|0x
  gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 0xcf, 0x80, 
0xab, 0x87, 0xf9, 0x47, 0xa3, 0xfe, 0xD5, 0x0B, 0x76, 0xd8, 0x95, 0x41 
}|VOID*|0x0018 +# Boot Manager 
Key+gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x0020+
 ## 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*|0x0025diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc 
b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 1ce96a51c1..5e1892458e 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -33,6 +33,8 @@
   DEFINE UNIVERSAL_PAYLOAD= FALSE   DEFINE SECURITY_STUB_ENABLE
 = TRUE   DEFINE SMM_SUPPOR

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-02-02 Thread Guo Dong


I mean missing gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut |$ 
(PLATFORM_BOOT_TIMEOUT)

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Guo Dong
Sent: Wednesday, February 2, 2022 4:07 PM
To: devel@edk2.groups.io; Rhodes, Sean 
Subject: Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key 
configurable


+  DEFINE PLATFORM_BOOT_TIMEOUT= 3
It looks you missed the change to gEfiMdePkgTokenSpaceGuid using 
PLATFORM_BOOT_TIMEOUT.

Thanks,
Guo
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sean Rhodes
Sent: Wednesday, February 2, 2022 12:16 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Rhodes, Sean 
Subject: [edk2-devel] [PATCH] 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 
---
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  4 ++
 4 files changed, 39 insertions(+), 13 deletions(-)

diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 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,22 @@ 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 +260,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..f2fcdf6a74 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -83,6 +83,9 @@ 
gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x0400|UINT32|0x
  gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 0xcf, 0x80, 
0xab, 0x87, 0xf9, 0x47, 0xa3, 0xfe, 0xD5, 0x0B, 0x76, 0xd8, 0x95, 0x41 
}|VOID*|0x0018 +# Boot Manager 
Key+gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x0020+
 ## 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 
}|

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-02-20 Thread Ni, Ray
Can you just map both ESC and F2 to the UI? So that PCD is not needed.

Thanks,
Ray

-Original Message-
From: Sean Rhodes  
Sent: Monday, February 21, 2022 5:39 AM
To: devel@edk2.groups.io
Cc: Dong, Guo ; Rhodes, Sean ; Ni, 
Ray ; Ma, Maurice ; You, Benjamin 

Subject: [PATCH] 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.

Cc: Guo Dong 
Cc: Ray Ni 
Cc: Maurice Ma 
Cc: Benjamin You 
Signed-off-by: Sean Rhodes 
---
 .../Library/BrotliCustomDecompressLib/brotli  |  2 +-
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  3 ++
 5 files changed, 39 insertions(+), 14 deletions(-)

diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
index f4153a09f8..666c3280cc 16
--- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
+++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
@@ -1 +1 @@
-Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea
+Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 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_STATUSStatus;

@@ -186,13 +186,22 @@ 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 +260,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..f2fcdf6a74 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -83,6 +83,9 @@ 
gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x0400|UINT32|0x
 

 gUefiPayloadPkgTokenSpaceGuid.PcdPcdDriverFile|{ 0x57, 0x72, 0xcf, 0x80, 0xab, 
0x87, 0xf9, 0x47, 0xa3, 0xfe, 0xD5, 0x0B, 0x76, 0xd8, 0x95, 0x41 
}|VOID*|0x0018

 

+# Boot Manager Key

+gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x0020

+

 ## 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, 
0

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-02-20 Thread Sean Rhodes
We would prefer to keep PCD, as Esc can conflict with Grub on normal (not
Chromebook) devices

Thank you

On Mon, 21 Feb 2022 at 05:26, Ni, Ray  wrote:

> Can you just map both ESC and F2 to the UI? So that PCD is not needed.
>
> Thanks,
> Ray
>
> -Original Message-
> From: Sean Rhodes 
> Sent: Monday, February 21, 2022 5:39 AM
> To: devel@edk2.groups.io
> Cc: Dong, Guo ; Rhodes, Sean ;
> Ni, Ray ; Ma, Maurice ; You,
> Benjamin 
> Subject: [PATCH] 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.
>
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> Signed-off-by: Sean Rhodes 
> ---
>  .../Library/BrotliCustomDecompressLib/brotli  |  2 +-
>  .../PlatformBootManager.c | 44 +--
>  .../PlatformBootManagerLib.inf|  1 +
>  UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
>  UefiPayloadPkg/UefiPayloadPkg.dsc |  3 ++
>  5 files changed, 39 insertions(+), 14 deletions(-)
>
> diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> index f4153a09f8..666c3280cc 16
> --- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> +++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> @@ -1 +1 @@
> -Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea
> +Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
> diff --git
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> index a8ead775ea..0eb577313a 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_STATUSStatus;
>
> @@ -186,13 +186,22 @@ 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 +260,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..f2fcdf6a74 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dec
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dec
> @@ -83,6 +83,9 @@
> gUefiPayloadPkgTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x0400|UINT32|0x
>
>
>  gUefiP

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-02-21 Thread Ni, Ray
Grub runs later. Then what does “conflict” mean?

From: Sean Rhodes 
Sent: Monday, February 21, 2022 3:48 PM
To: Ni, Ray 
Cc: devel@edk2.groups.io; Dong, Guo ; Ma, Maurice 
; You, Benjamin 
Subject: Re: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

We would prefer to keep PCD, as Esc can conflict with Grub on normal (not 
Chromebook) devices

Thank you

On Mon, 21 Feb 2022 at 05:26, Ni, Ray 
mailto:ray...@intel.com>> wrote:
Can you just map both ESC and F2 to the UI? So that PCD is not needed.

Thanks,
Ray

-Original Message-
From: Sean Rhodes mailto:sean@starlabs.systems>>
Sent: Monday, February 21, 2022 5:39 AM
To: devel@edk2.groups.io
Cc: Dong, Guo mailto:guo.d...@intel.com>>; Rhodes, Sean 
mailto:sean@starlabs.systems>>; Ni, Ray 
mailto:ray...@intel.com>>; Ma, Maurice 
mailto:maurice...@intel.com>>; You, Benjamin 
mailto:benjamin@intel.com>>
Subject: [PATCH] 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.

Cc: Guo Dong mailto:guo.d...@intel.com>>
Cc: Ray Ni mailto:ray...@intel.com>>
Cc: Maurice Ma mailto:maurice...@intel.com>>
Cc: Benjamin You mailto:benjamin@intel.com>>
Signed-off-by: Sean Rhodes mailto:sean@starlabs.systems>>
---
 .../Library/BrotliCustomDecompressLib/brotli  |  2 +-
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  3 ++
 5 files changed, 39 insertions(+), 14 deletions(-)

diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
index f4153a09f8..666c3280cc 16
--- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
+++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
@@ -1 +1 @@
-Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea
+Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 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_STATUSStatus;

@@ -186,13 +186,22 @@ 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 +260,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.PcdBootManager

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-02-22 Thread Sean Rhodes
True - but the experience is better with F2 (on
"normal" computers/non-Chromebooks).

We've got a lot of feedback, and for most, people turn on their computers
and start tapping Escape when they want Grub. If it's mapped, this gets
intercepted by UiApp. Even if they exit, with BGRT in the equation, it
requires fairly precise timing to access Grub.

On Tue, 22 Feb 2022 at 04:59, Ni, Ray  wrote:

> Grub runs later. Then what does “conflict” mean?
>
>
>
> *From:* Sean Rhodes 
> *Sent:* Monday, February 21, 2022 3:48 PM
> *To:* Ni, Ray 
> *Cc:* devel@edk2.groups.io; Dong, Guo ; Ma, Maurice <
> maurice...@intel.com>; You, Benjamin 
> *Subject:* Re: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable
>
>
>
> We would prefer to keep PCD, as Esc can conflict with Grub on normal (not
> Chromebook) devices
>
>
>
> Thank you
>
>
>
> On Mon, 21 Feb 2022 at 05:26, Ni, Ray  wrote:
>
> Can you just map both ESC and F2 to the UI? So that PCD is not needed.
>
> Thanks,
> Ray
>
> -Original Message-
> From: Sean Rhodes 
> Sent: Monday, February 21, 2022 5:39 AM
> To: devel@edk2.groups.io
> Cc: Dong, Guo ; Rhodes, Sean ;
> Ni, Ray ; Ma, Maurice ; You,
> Benjamin 
> Subject: [PATCH] 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.
>
> Cc: Guo Dong 
> Cc: Ray Ni 
> Cc: Maurice Ma 
> Cc: Benjamin You 
> Signed-off-by: Sean Rhodes 
> ---
>  .../Library/BrotliCustomDecompressLib/brotli  |  2 +-
>  .../PlatformBootManager.c | 44 +--
>  .../PlatformBootManagerLib.inf|  1 +
>  UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
>  UefiPayloadPkg/UefiPayloadPkg.dsc |  3 ++
>  5 files changed, 39 insertions(+), 14 deletions(-)
>
> diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> index f4153a09f8..666c3280cc 16
> --- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> +++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
> @@ -1 +1 @@
> -Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea
> +Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
> diff --git
> a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
> index a8ead775ea..0eb577313a 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_STATUSStatus;
>
> @@ -186,13 +186,22 @@ 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 +260,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
> 

Re: [edk2-devel] [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

2022-02-28 Thread Ni, Ray
Reviewed-by: Ray Ni 

From: Sean Rhodes 
Sent: Wednesday, February 23, 2022 3:22 AM
To: Ni, Ray 
Cc: devel@edk2.groups.io; Dong, Guo ; Ma, Maurice 
; You, Benjamin 
Subject: Re: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

True - but the experience is better with F2 (on "normal" 
computers/non-Chromebooks).

We've got a lot of feedback, and for most, people turn on their computers and 
start tapping Escape when they want Grub. If it's mapped, this gets intercepted 
by UiApp. Even if they exit, with BGRT in the equation, it requires fairly 
precise timing to access Grub.

On Tue, 22 Feb 2022 at 04:59, Ni, Ray 
mailto:ray...@intel.com>> wrote:
Grub runs later. Then what does “conflict” mean?

From: Sean Rhodes mailto:sean@starlabs.systems>>
Sent: Monday, February 21, 2022 3:48 PM
To: Ni, Ray mailto:ray...@intel.com>>
Cc: devel@edk2.groups.io; Dong, Guo 
mailto:guo.d...@intel.com>>; Ma, Maurice 
mailto:maurice...@intel.com>>; You, Benjamin 
mailto:benjamin@intel.com>>
Subject: Re: [PATCH] UefiPayloadPkg: Make Boot Manager Key configurable

We would prefer to keep PCD, as Esc can conflict with Grub on normal (not 
Chromebook) devices

Thank you

On Mon, 21 Feb 2022 at 05:26, Ni, Ray 
mailto:ray...@intel.com>> wrote:
Can you just map both ESC and F2 to the UI? So that PCD is not needed.

Thanks,
Ray

-Original Message-
From: Sean Rhodes mailto:sean@starlabs.systems>>
Sent: Monday, February 21, 2022 5:39 AM
To: devel@edk2.groups.io
Cc: Dong, Guo mailto:guo.d...@intel.com>>; Rhodes, Sean 
mailto:sean@starlabs.systems>>; Ni, Ray 
mailto:ray...@intel.com>>; Ma, Maurice 
mailto:maurice...@intel.com>>; You, Benjamin 
mailto:benjamin@intel.com>>
Subject: [PATCH] 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.

Cc: Guo Dong mailto:guo.d...@intel.com>>
Cc: Ray Ni mailto:ray...@intel.com>>
Cc: Maurice Ma mailto:maurice...@intel.com>>
Cc: Benjamin You mailto:benjamin@intel.com>>
Signed-off-by: Sean Rhodes mailto:sean@starlabs.systems>>
---
 .../Library/BrotliCustomDecompressLib/brotli  |  2 +-
 .../PlatformBootManager.c | 44 +--
 .../PlatformBootManagerLib.inf|  1 +
 UefiPayloadPkg/UefiPayloadPkg.dec |  3 ++
 UefiPayloadPkg/UefiPayloadPkg.dsc |  3 ++
 5 files changed, 39 insertions(+), 14 deletions(-)

diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli 
b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
index f4153a09f8..666c3280cc 16
--- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
+++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
@@ -1 +1 @@
-Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea
+Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
diff --git 
a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c 
b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c
index a8ead775ea..0eb577313a 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_STATUSStatus;

@@ -186,13 +186,22 @@ 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 +260,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"

+