Skip to content

Commit

Permalink
Fix the system boot to a boot manager menu after priority boot option…
Browse files Browse the repository at this point in the history
… returns with a status of EFI_SUCCESS
  • Loading branch information
liushuai20 committed Dec 16, 2024
1 parent 184d495 commit d2af9c4
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions MsCorePkg/Library/PlatformBootManagerLib/MsPlatform.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ PlatformBootManagerPriorityBoot (
)
{
EFI_BOOT_MANAGER_LOAD_OPTION BootOption;
EFI_BOOT_MANAGER_LOAD_OPTION BootManagerMenu;
EFI_STATUS Status = EFI_SUCCESS;

Status = DeviceBootManagerPriorityBoot (&BootOption);
Expand All @@ -154,24 +153,12 @@ PlatformBootManagerPriorityBoot (
}

if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "[Bds] VOL/+ or VOL/- detected, and unable to boot. Code=%r\n", Status));
DEBUG ((DEBUG_ERROR, "[Bds] Boot priority override detected, and unable to boot. Code=%r\n", Status));
} else {
// Attempt the priority boot option.
EfiBootManagerBoot (&BootOption);
Status = BootOption.Status;
EfiBootManagerFreeLoadOption (&BootOption);

//
// If the priority boot option returns with a status of EFI_SUCCESS, and platform firmware supports boot manager
// menu the boot manager will stop processing boot options here and present a boot manager menu to the user.
//
if (Status == EFI_SUCCESS) {
Status = EfiBootManagerGetBootManagerMenu (&BootManagerMenu);
if (!EFI_ERROR (Status)) {
EfiBootManagerBoot (&BootManagerMenu);
EfiBootManagerFreeLoadOption (&BootManagerMenu);
}
}
}

return;
Expand Down

0 comments on commit d2af9c4

Please sign in to comment.