Skip to content

Dynamic bmm #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dasharo-stable202402
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c
Original file line number Diff line number Diff line change
Expand Up @@ -1109,9 +1109,7 @@ 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) && (Action != EFI_BROWSER_ACTION_DEFAULT_STANDARD) &&
(Action != EFI_BROWSER_ACTION_DEFAULT_MANUFACTURING)) {
if ((Action != EFI_BROWSER_ACTION_CHANGING) && (Action != EFI_BROWSER_ACTION_CHANGED) && (Action != EFI_BROWSER_ACTION_FORM_OPEN)) {
//
// Do nothing for other UEFI Action. Only do call back when data is changed or the form is open.
//
Expand All @@ -1132,7 +1130,7 @@ BootMaintCallback (
// 1. Update the menus (including legacy munu) show in BootMiantenanceManager page.
// 2. Re-scan the BootOption menus (including the legacy boot option).
//
CustomizeMenus ();
// CustomizeMenus ();
EfiBootManagerRefreshAllBootOption ();
BOpt_GetBootOptions (Private);
mFirstEnterBMMForm = TRUE;
Expand All @@ -1147,18 +1145,6 @@ BootMaintCallback (
OldFakeNVMap = &Private->BmmOldFakeNVData;
HiiGetBrowserData (&mBootMaintGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *)CurrentFakeNVMap);

if (Action == EFI_BROWSER_ACTION_DEFAULT_STANDARD || Action == EFI_BROWSER_ACTION_DEFAULT_MANUFACTURING) {
if (Value == NULL)
return EFI_INVALID_PARAMETER;

if (QuestionId == FORM_TIME_OUT_ID) {
CurrentFakeNVMap->BootTimeOut = PcdGet16 (PcdPlatformBootTimeOut);
Value->u16 = PcdGet16 (PcdPlatformBootTimeOut);
} else {
return EFI_UNSUPPORTED;
}
}

if (Action == EFI_BROWSER_ACTION_CHANGING) {
if (Value == NULL) {
return EFI_INVALID_PARAMETER;
Expand Down Expand Up @@ -1571,6 +1557,8 @@ InitializeBmmConfig (
GetConsoleErrCheck (CallbackData);
GetTerminalAttribute (CallbackData);

CustomizeMenus();

CallbackData->BmmFakeNvData.ForceReconnect = TRUE;

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ typedef enum _TYPE_OF_TERMINAL {
#define COM1_DATA_RATE_QUESTION_ID QUESTION_ID (COM1DataRate)
#define COM1_STOP_BITS_QUESTION_ID QUESTION_ID (COM1StopBits)
#define COM1_PARITY_QUESTION_ID QUESTION_ID (COM1Parity)
#define COM1_TERMINAL_QUESTION_ID QUESTION_ID (COM2TerminalType)
#define COM1_TERMINAL_QUESTION_ID QUESTION_ID (COM1TerminalType)
#define COM2_BAUD_RATE_QUESTION_ID QUESTION_ID (COM2BaudRate)
#define COM2_DATA_RATE_QUESTION_ID QUESTION_ID (COM2DataRate)
#define COM2_STOP_BITS_QUESTION_ID QUESTION_ID (COM2StopBits)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@ formset
//
label LABEL_FORM_MAIN_END;

numeric varid = BmmData.BootTimeOut,
questionid = FORM_TIME_OUT_ID,
prompt = STRING_TOKEN(STR_NUM_AUTO_BOOT),
help = STRING_TOKEN(STR_HLP_AUTO_BOOT),
flags = RESET_REQUIRED | INTERACTIVE | NUMERIC_SIZE_2 | DISPLAY_UINT_DEC,
key = FORM_TIME_OUT_ID,
minimum = 0,
maximum = 65535,
step = 0,
endnumeric;

endform;

form formid = FORM_BOOT_SETUP_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ UiCustomizeBMMPage (
//
// Create "Time Out" menu.
//
// BmmCreateTimeOutMenu (HiiHandle, StartOpCodeHandle);
BmmCreateTimeOutMenu (HiiHandle, StartOpCodeHandle);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,14 @@ BmmCreateTimeOutMenu (
DefaultOpCodeHandle = HiiAllocateOpCodeHandle ();
ASSERT (DefaultOpCodeHandle != NULL);

HiiCreateDefaultOpCode (
DefaultOpCodeHandle,
EFI_HII_DEFAULT_CLASS_STANDARD,
EFI_IFR_TYPE_NUM_SIZE_16,
PcdGet16 (PcdPlatformBootTimeOut)
);
if (DefaultOpCodeHandle != NULL ) {
HiiCreateDefaultOpCode (
DefaultOpCodeHandle,
EFI_HII_DEFAULT_CLASS_STANDARD,
EFI_IFR_TYPE_NUM_SIZE_16,
PcdGet16 (PcdPlatformBootTimeOut)
);
}

HiiCreateNumericOpCode (
StartOpCodeHandle,
Expand All @@ -144,10 +146,12 @@ BmmCreateTimeOutMenu (
0,
65535,
0,
DefaultOpCodeHandle
DefaultOpCodeHandle ? DefaultOpCodeHandle : NULL
);

HiiFreeOpCodeHandle (DefaultOpCodeHandle);
if (DefaultOpCodeHandle != NULL) {
HiiFreeOpCodeHandle (DefaultOpCodeHandle);
}
}

/**
Expand Down
Loading