This commit is contained in:
Dongyan Qian 2026-08-26 23:20:46 +00:00 committed by GitHub
commit 6f7f94a357
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 15 deletions

View file

@ -2597,7 +2597,16 @@ EfiBootManagerRefreshAllBootOption (
//
for (Index = 0; Index < BootOptionCount; Index++) {
if (EfiBootManagerFindLoadOption (&BootOptions[Index], NvBootOptions, NvBootOptionCount) == -1) {
EfiBootManagerAddLoadOptionVariable (&BootOptions[Index], (UINTN)-1);
Status = EfiBootManagerAddLoadOptionVariable (&BootOptions[Index], (UINTN)-1);
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
"[Bds] Failed to add boot option for '%s': %r\n",
BootOptions[Index].Description,
Status
));
}
//
// Try best to add the boot options so continue upon failure.
//

View file

@ -267,13 +267,13 @@ structure.
VariableAttributes = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS;
}
Status = gRT->SetVariable (
OptionName,
&gEfiGlobalVariableGuid,
VariableAttributes,
VariableSize,
Variable
);
Status = BmSetVariableAndReportStatusCodeOnError (
OptionName,
&gEfiGlobalVariableGuid,
VariableAttributes,
VariableSize,
Variable
);
FreePool (Variable);
return Status;
@ -337,13 +337,13 @@ BmAddOptionNumberToOrderVariable (
NewOptionOrder[Position] = OptionNumber;
Status = gRT->SetVariable (
OptionOrderName,
&gEfiGlobalVariableGuid,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
OptionOrderSize + sizeof (UINT16),
NewOptionOrder
);
Status = BmSetVariableAndReportStatusCodeOnError (
OptionOrderName,
&gEfiGlobalVariableGuid,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
OptionOrderSize + sizeof (UINT16),
NewOptionOrder
);
FreePool (NewOptionOrder);
}