Skip to content
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

Autoboot timeout fix #94

Closed
wants to merge 3 commits into from
Closed

Autoboot timeout fix #94

wants to merge 3 commits into from

Conversation

filipleple
Copy link
Member

No description provided.

@filipleple filipleple self-assigned this Oct 17, 2023
@filipleple filipleple marked this pull request as draft October 17, 2023 07:23
@@ -1093,6 +1094,15 @@ BootMaintCallback (

Private = BMM_CALLBACK_DATA_FROM_THIS (This);

if (Action == EFI_BROWSER_ACTION_DEFAULT_FIRMWARE) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (Action == EFI_BROWSER_ACTION_DEFAULT_FIRMWARE) {
if (Action == EFI_BROWSER_ACTION_RESET_TO_DEFAULT) {

Copy link
Member Author

@filipleple filipleple Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miczyg1 It won't compile with EFI_BROWSER_ACTION_RESET_TO_DEFAULT. Does that mean I'm missing something or is EFI_BROWSER_ACTION_REQUEST_RESET, as suggested by the compiler, valid?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the proper define for that is EFI_BROWSER_ACTION_DEFAULT_STANDARD and EFI_BROWSER_ACTION_DEFAULT_MANUFACTURING

@@ -1093,6 +1094,15 @@ BootMaintCallback (

Private = BMM_CALLBACK_DATA_FROM_THIS (This);

if (Action == EFI_BROWSER_ACTION_DEFAULT_FIRMWARE) {
//gotta find something like Private.BmmDefaultValues.BootTimeOut;
CurrentFakeNVMap->BootTimeOut = defaultValue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to filter for Auto Boot TImeout QuestionID. For other it has to return EFI_UNSUPPORTED.

The value is being set using the IN EFI_IFR_TYPE_VALUE *Value, parameter. So you should probably do Value->u16 = PcdGet16 (PcdPlatformBootTimeOut); If this doesn't work, then CurrentFakeNVMap->BootTimeOut = PcdGet16 (PcdPlatformBootTimeOut); will probably be the way

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miczyg1 both Value->u16 = PcdGet16 (PcdPlatformBootTimeOut); and CurrentFakeNVMap->BootTimeOut = PcdGet16 (PcdPlatformBootTimeOut); still cause the timeout value to be restored to 0. Could the default value returned by PcdGet16 really be 0?

CurrentFakeNVMap->BootTimeOut = defaultValue

// Update the value in the HII database
HiiSetBrowserData (&mBootMaintGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap, NULL);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is called at the end of BootMaintCallback . The value will be saved when the save hotkey is pressed (also handled in separate action most likely).


// Update the value in the HII database
HiiSetBrowserData (&mBootMaintGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap, NULL);
return EFI_SUCCESS;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to return here as the other IF branches will protect fro executing any other code, i.e. if Action is EFI_BROWSER_ACTION_RESET_TO_DEFAULT, it will not have any other value in given call of BootMaintCallback unless you explicitly change it.

@filipleple filipleple force-pushed the autoboot-timeout-fix branch 2 times, most recently from 95ff59b to e9931ed Compare October 17, 2023 08:31
Signed-off-by: Filip Lewiński <[email protected]>
@filipleple filipleple force-pushed the autoboot-timeout-fix branch 2 times, most recently from 65e636c to 8487a62 Compare October 17, 2023 09:53
Signed-off-by: Filip Lewiński <[email protected]>
@miczyg1
Copy link
Contributor

miczyg1 commented Oct 18, 2023

I have prepared an alternative approach how to add default value support for dynamically generated IFR opcodes:
#96

It looks like the last parameter of HiiCreateNumericOpCode can take any Opcode which is appended to the primary opcode generated by HiiCreateNumericOpCode. In this case I have created a Default value opcode with HiiCreateDefaultOpCode

@miczyg1 miczyg1 mentioned this pull request Oct 18, 2023
@miczyg1
Copy link
Contributor

miczyg1 commented Oct 20, 2023

Merged the #96 so this PR is obsolete.

@miczyg1 miczyg1 closed this Oct 20, 2023
@miczyg1 miczyg1 deleted the autoboot-timeout-fix branch October 20, 2023 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants