mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcBootManagementLib: Workaround setting Boot0000 causing ASUS FW issues
This commit is contained in:
parent
1f2982bf03
commit
cc6aa31ca0
@ -1053,7 +1053,12 @@ InternalRegisterBootstrapBootOption (
|
||||
// Find the lowest unused Boot#### index. In the absolutely unrealistic case
|
||||
// that all entries are occupied, always overwrite BootFFFF.
|
||||
//
|
||||
for (BootOptionIndex = 0; BootOptionIndex < 0xFFFF; ++BootOptionIndex) {
|
||||
// Boot0000 is reserved on ASUS boards and is treated like a deleted entry.
|
||||
// Setting Boot0000 will essentially cause entries to duplicate and eventual
|
||||
// BIOS brick as ASUS boards simply zero removed boot entries instead of
|
||||
// shrinking BootOrder size. Reproduced on ASUS ROG STRIX Z370-F GAMING.
|
||||
//
|
||||
for (BootOptionIndex = 1; BootOptionIndex < 0xFFFF; ++BootOptionIndex) {
|
||||
for (OrderIndex = 0; OrderIndex < BootOrderSize / sizeof (*BootOrder); ++OrderIndex) {
|
||||
if (BootOrder[OrderIndex + 1] == BootOptionIndex) {
|
||||
break;
|
||||
|
||||
@ -374,9 +374,9 @@ OcDeleteVariables (
|
||||
DeleteVariables ();
|
||||
|
||||
if ((BootProtect & OC_BOOT_PROTECT_VARIABLE_BOOTSTRAP) != 0) {
|
||||
BootOptionIndex = 0;
|
||||
BootOptionIndex = 1;
|
||||
Status = gRT->SetVariable (
|
||||
L"Boot0000",
|
||||
L"Boot0001",
|
||||
&gEfiGlobalVariableGuid,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||
BootOptionSize,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user