From 33c3b9ff9460391b79d0319330c3e6abbeae5af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Lewi=C5=84ski?= Date: Tue, 17 Oct 2023 09:16:20 +0200 Subject: [PATCH 1/3] MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c: autoboot timeout fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip Lewiński --- .../BootMaintenance.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c index e3f375793e..1bf1334189 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c @@ -1084,7 +1084,8 @@ BootMaintCallback ( UINTN Index; EFI_DEVICE_PATH_PROTOCOL * File; - if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED && Action != EFI_BROWSER_ACTION_FORM_OPEN) { + + if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED && Action != EFI_BROWSER_ACTION_FORM_OPEN && Action != EFI_BROWSER_ACTION_RESET_TO_DEFAULT) { // // Do nothing for other UEFI Action. Only do call back when data is changed or the form is open. // @@ -1093,6 +1094,19 @@ BootMaintCallback ( Private = BMM_CALLBACK_DATA_FROM_THIS (This); + + + if (Action == EFI_BROWSER_ACTION_DEFAULT_FIRMWARE) { + //find something like Private->BmmDefaultValues.BootTimeOut + CurrentFakeNVMap->BootTimeOut = Private->BmmOldFakeNVData.BootTimeOut; + + HiiSetBrowserData(...); // Update the value in the HII database + + return EFI_SUCCESS; // Indicate that the operation was successful + } + + + if (Action == EFI_BROWSER_ACTION_FORM_OPEN) { if (QuestionId == KEY_VALUE_TRIGGER_FORM_OPEN_ACTION) { if (!mFirstEnterBMMForm) { From a1f53b74e0fcf338a989e295d95999f5558526e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Lewi=C5=84ski?= Date: Tue, 17 Oct 2023 09:17:21 +0200 Subject: [PATCH 2/3] autoboot timeout fixes WIP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip Lewiński --- .../BootMaintenance.c | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c index 1bf1334189..735bd1ae5a 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c @@ -1085,7 +1085,7 @@ BootMaintCallback ( EFI_DEVICE_PATH_PROTOCOL * File; - if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED && Action != EFI_BROWSER_ACTION_FORM_OPEN && Action != EFI_BROWSER_ACTION_RESET_TO_DEFAULT) { + if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED && Action != EFI_BROWSER_ACTION_FORM_OPEN && Action != EFI_BROWSER_ACTION_REQUEST_RESET) { // // Do nothing for other UEFI Action. Only do call back when data is changed or the form is open. // @@ -1094,19 +1094,17 @@ BootMaintCallback ( Private = BMM_CALLBACK_DATA_FROM_THIS (This); + if (Action == EFI_BROWSER_ACTION_REQUEST_RESET) { + if (QuestionId == FORM_TIME_OUT_ID){ + //Value->u16 = PcdGet16 (PcdPlatformBootTimeOut); + CurrentFakeNVMap->BootTimeOut = PcdGet16 (PcdPlatformBootTimeOut); //-- alt take + } + else { + return EFI_UNSUPPORTED; + } - - if (Action == EFI_BROWSER_ACTION_DEFAULT_FIRMWARE) { - //find something like Private->BmmDefaultValues.BootTimeOut - CurrentFakeNVMap->BootTimeOut = Private->BmmOldFakeNVData.BootTimeOut; - - HiiSetBrowserData(...); // Update the value in the HII database - - return EFI_SUCCESS; // Indicate that the operation was successful } - - if (Action == EFI_BROWSER_ACTION_FORM_OPEN) { if (QuestionId == KEY_VALUE_TRIGGER_FORM_OPEN_ACTION) { if (!mFirstEnterBMMForm) { From 8fac045db19df1195fbdc4db1572bd1beea0a7a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Lewi=C5=84ski?= Date: Tue, 17 Oct 2023 11:45:19 +0200 Subject: [PATCH 3/3] nosubmitif clause added MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip Lewiński --- .../BootMaintenanceManager.vfr | 9 +++++++++ .../BootMaintenanceManagerStrings.uni | 2 ++ 2 files changed, 11 insertions(+) diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.vfr b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.vfr index 69fb606324..c18eeb3406 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.vfr +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.vfr @@ -351,4 +351,13 @@ formset endform; + form formid = FORM_TIME_OUT_ID, + help = STRING_TOKEN(STR_HLP_AUTO_BOOT); + title = STRING_TOKEN(STR_FORM_STD_ERR_TITLE); + nosubmitif + prompt = STRING_TOKEN(AUTOBOOT_NOSUBMIT_IF_NEGATIVE), + //value < 0 + endif; + endform; + endformset; diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerStrings.uni b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerStrings.uni index 3d47473e6c..679b0b84ea 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerStrings.uni +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerStrings.uni @@ -31,6 +31,8 @@ #language fr-FR "Modify boot driver options" #string STR_FORM_BOOT_ADD_TITLE #language en-US "Add Boot Option" #language fr-FR "Add Boot Option" +#string AUTOBOOT_NOSUBMIT_IF_NEGATIVE #language en-US "Autoboot Timeout value cannot be negative!" + #language fr-FR "Autoboot Timeout value cannot be negative!" #string STR_FORM_BOOT_ADD_HELP #language en-US "Add EFI Application or Removable Fs as Boot Option" #language fr-FR "Add EFI Application or Removable Fs as Boot Option" #string STR_FORM_BOOT_DEL_TITLE #language en-US "Delete Boot Option"