public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] [PATCH v2][Edk2 Platform] UserAuthFeaturePkg: Add boot menu return status code to trigger function.
@ 2021-12-10  7:34 bo-changx.ke
  2021-12-14  5:26 ` Dandan Bi
  0 siblings, 1 reply; 3+ messages in thread
From: bo-changx.ke @ 2021-12-10  7:34 UTC (permalink / raw)
  To: devel; +Cc: Sai Chaganty, Liming Gao, Dandan Bi

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3764

BIOS password is not required when overriding boot device via F7 hotkey.
Add boot menu return status code in callback function
for ReportStatusCode() notification.

Signed-off-by: Bo Chang Ke <bo-changx.ke@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Bo Chang Ke <bo-changx.ke@intel.com>
---
 .../UserAuthenticationDxe.c                        | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.c b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.c
index bba2057a96..382d891711 100644
--- a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.c
+++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.c
@@ -13,6 +13,7 @@ EFI_EVENT                           mExitBootServicesEvent  = NULL;
 EFI_RSC_HANDLER_PROTOCOL           *mRscHandlerProtocol     = NULL;
 USER_AUTHENTICATION_PRIVATE_DATA   *mUserAuthenticationData = NULL;
 EFI_SMM_COMMUNICATION_PROTOCOL     *mSmmCommunication       = NULL;
+BOOLEAN       mHotKeyF7pressed = FALSE;
 
 EFI_GUID mUserAuthenticationVendorGuid = USER_AUTHENTICATION_FORMSET_GUID;
 HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath = {
@@ -352,10 +353,19 @@ CheckForPassword (
   IN EFI_STATUS_CODE_DATA     *Data      OPTIONAL
   )
 {
-  BOOLEAN   PasswordSet;
+  BOOLEAN       PasswordSet;
+  EFI_INPUT_KEY Key;
+  EFI_STATUS    Status          = EFI_SUCCESS;
 
+  Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
+
+  if (Key.ScanCode == SCAN_F7 && IsPasswordInstalled()) {
+    mHotKeyF7pressed = TRUE;
+  }
   if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) &&
-      (Value == (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_PC_USER_SETUP))) {
+     (((Value == (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT)) && mHotKeyF7pressed) ||
+     (Value == (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_PC_USER_SETUP)))) {
+    mHotKeyF7pressed = FALSE;
     //
     // Check whether enter setup page.
     //
-- 
2.32.0.windows.1


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

* [PATCH] [PATCH v2][Edk2 Platform] UserAuthFeaturePkg: Add boot menu return status code to trigger function.
@ 2021-12-10  8:45 Bo Chang Ke
  0 siblings, 0 replies; 3+ messages in thread
From: Bo Chang Ke @ 2021-12-10  8:45 UTC (permalink / raw)
  To: devel; +Cc: Sai Chaganty, Liming Gao, Dandan Bi, Dong, Eric, Ke, Bo-ChangX

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3764

BIOS password is not required when overriding boot device via F7 hotkey.
Add boot menu return status code in callback function
for ReportStatusCode() notification.

Signed-off-by: Bo Chang Ke <bo-changx.ke@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Dong, Eric <eric.dong@intel.com>
Cc: Ke, Bo-ChangX <bo-changx.ke@intel.com>
---
 .../UserAuthenticationDxe.c                        | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.c b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.c
index bba2057a96..382d891711 100644
--- a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.c
+++ b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDxeSmm/UserAuthenticationDxe.c
@@ -13,6 +13,7 @@ EFI_EVENT                           mExitBootServicesEvent  = NULL;
 EFI_RSC_HANDLER_PROTOCOL           *mRscHandlerProtocol     = NULL;
 USER_AUTHENTICATION_PRIVATE_DATA   *mUserAuthenticationData = NULL;
 EFI_SMM_COMMUNICATION_PROTOCOL     *mSmmCommunication       = NULL;
+BOOLEAN       mHotKeyF7pressed = FALSE;
 
 EFI_GUID mUserAuthenticationVendorGuid = USER_AUTHENTICATION_FORMSET_GUID;
 HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath = {
@@ -352,10 +353,19 @@ CheckForPassword (
   IN EFI_STATUS_CODE_DATA     *Data      OPTIONAL
   )
 {
-  BOOLEAN   PasswordSet;
+  BOOLEAN       PasswordSet;
+  EFI_INPUT_KEY Key;
+  EFI_STATUS    Status          = EFI_SUCCESS;
 
+  Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
+
+  if (Key.ScanCode == SCAN_F7 && IsPasswordInstalled()) {
+    mHotKeyF7pressed = TRUE;
+  }
   if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) &&
-      (Value == (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_PC_USER_SETUP))) {
+     (((Value == (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT)) && mHotKeyF7pressed) ||
+     (Value == (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_PC_USER_SETUP)))) {
+    mHotKeyF7pressed = FALSE;
     //
     // Check whether enter setup page.
     //
-- 
2.32.0.windows.1


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

* Re: [PATCH] [PATCH v2][Edk2 Platform] UserAuthFeaturePkg: Add boot menu return status code to trigger function.
  2021-12-10  7:34 bo-changx.ke
@ 2021-12-14  5:26 ` Dandan Bi
  0 siblings, 0 replies; 3+ messages in thread
From: Dandan Bi @ 2021-12-14  5:26 UTC (permalink / raw)
  To: Ke, Bo-ChangX, devel@edk2.groups.io, Dong, Eric
  Cc: Chaganty, Rangasai V, Gao, Liming

Hi,

1. Do you try to update PcdBootManagerMenuFile to point to BootManagerMenuApp.inf and the test again?
    I think following change may not meet above scenario as it will not report ready to boot status code in such case. 

2. I am wondering could we reuse EFI_SW_PC_USER_SETUP status code or add a new status code for BootManagerMenuApp.inf to do the HOOK.
    As the hot key may be different per platforms, hook different key pressed seems not very reasonable.


Thanks,
Dandan

> -----Original Message-----
> From: Ke, Bo-ChangX <bo-changx.ke@intel.com>
> Sent: Friday, December 10, 2021 3:34 PM
> To: devel@edk2.groups.io
> Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Bi, Dandan <dandan.bi@intel.com>
> Subject: [PATCH] [PATCH v2][Edk2 Platform] UserAuthFeaturePkg: Add boot
> menu return status code to trigger function.
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3764
> 
> BIOS password is not required when overriding boot device via F7 hotkey.
> Add boot menu return status code in callback function for ReportStatusCode()
> notification.
> 
> Signed-off-by: Bo Chang Ke <bo-changx.ke@intel.com>
> Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Bo Chang Ke <bo-changx.ke@intel.com>
> ---
>  .../UserAuthenticationDxe.c                        | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git
> a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDx
> eSmm/UserAuthenticationDxe.c
> b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDx
> eSmm/UserAuthenticationDxe.c
> index bba2057a96..382d891711 100644
> ---
> a/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthenticationDx
> eSmm/UserAuthenticationDxe.c
> +++
> b/Features/Intel/UserInterface/UserAuthFeaturePkg/UserAuthentication
> +++ DxeSmm/UserAuthenticationDxe.c
> @@ -13,6 +13,7 @@ EFI_EVENT                           mExitBootServicesEvent  =
> NULL;
>  EFI_RSC_HANDLER_PROTOCOL           *mRscHandlerProtocol     = NULL;
>  USER_AUTHENTICATION_PRIVATE_DATA   *mUserAuthenticationData =
> NULL;
>  EFI_SMM_COMMUNICATION_PROTOCOL     *mSmmCommunication       =
> NULL;
> +BOOLEAN       mHotKeyF7pressed = FALSE;
> 
>  EFI_GUID mUserAuthenticationVendorGuid =
> USER_AUTHENTICATION_FORMSET_GUID;  HII_VENDOR_DEVICE_PATH
> mHiiVendorDevicePath = { @@ -352,10 +353,19 @@ CheckForPassword (
>    IN EFI_STATUS_CODE_DATA     *Data      OPTIONAL
>    )
>  {
> -  BOOLEAN   PasswordSet;
> +  BOOLEAN       PasswordSet;
> +  EFI_INPUT_KEY Key;
> +  EFI_STATUS    Status          = EFI_SUCCESS;
> 
> +  Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
> +
> +  if (Key.ScanCode == SCAN_F7 && IsPasswordInstalled()) {
> +    mHotKeyF7pressed = TRUE;
> +  }
>    if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE)
> &&
> -      (Value == (EFI_SOFTWARE_DXE_BS_DRIVER |
> EFI_SW_PC_USER_SETUP))) {
> +     (((Value == (EFI_SOFTWARE_DXE_BS_DRIVER |
> EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT)) && mHotKeyF7pressed) ||
> +     (Value == (EFI_SOFTWARE_DXE_BS_DRIVER |
> EFI_SW_PC_USER_SETUP)))) {
> +    mHotKeyF7pressed = FALSE;
>      //
>      // Check whether enter setup page.
>      //
> --
> 2.32.0.windows.1


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

end of thread, other threads:[~2021-12-14  5:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-10  8:45 [PATCH] [PATCH v2][Edk2 Platform] UserAuthFeaturePkg: Add boot menu return status code to trigger function Bo Chang Ke
  -- strict thread matches above, loose matches on Subject: below --
2021-12-10  7:34 bo-changx.ke
2021-12-14  5:26 ` Dandan Bi

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