Skip to content

Commit

Permalink
Updating UefiBootManager to handle Fv Files and Files that are not valid
Browse files Browse the repository at this point in the history
  • Loading branch information
Flickdm committed Feb 4, 2025
1 parent 76f3943 commit dea47ed
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1919,6 +1919,20 @@ EfiBootManagerBoot (
return;
}

// MU_CHANGE [BEGIN]
//
// 0. Determine if the file path exists. (I.E we can't load it if it doesnt)
//
FilePath = BootOption->FilePath;
Status = gBS->LocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid, &FilePath, &ImageHandle);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: LocateDevicePath Failed (%r)\n", __func__, Status));
BootOption->Status = Status;
return;
}

// MU_CHANGE [END]

//
// 1. Create Boot#### for a temporary boot if there is no match Boot#### (i.e. a boot by selected a EFI Shell using "Boot From File")
//
Expand Down Expand Up @@ -1962,7 +1976,16 @@ EfiBootManagerBoot (
if (BmIsBootManagerMenuFilePath (BootOption->FilePath)) {
DEBUG ((DEBUG_INFO, "[Bds] Booting Boot Manager Menu.\n"));
BmStopHotkeyService (NULL, NULL);
} else {
}
// MU_CHANGE [BEGIN]
else if (BmIsFvFilePath (BootOption->FilePath)) {
//
// Do nothing. This file originates from a measured FV and is an extension of the BDS environment
// We should not signal ready to boot.
// We will still need to load / start it.
}
// MU_CHANGE [END]
else {
PERF_EVENT_SIGNAL_BEGIN (&gEfiEventPreReadyToBootGuid); // MU_CHANGE
EfiEventGroupSignal (&gEfiEventPreReadyToBootGuid); // MU_CHANGE
PERF_EVENT_SIGNAL_END (&gEfiEventPreReadyToBootGuid); // MU_CHANGE
Expand Down Expand Up @@ -2044,6 +2067,10 @@ EfiBootManagerBoot (
);
}

// MU_CHANGE [BEGIN]
DEBUG ((DEBUG_ERROR, "%a: LoadImage returned %r\n", __func__, Status));
// MU CHANGE [END]

if (FileBuffer != NULL) {
FreePool (FileBuffer);
}
Expand Down

0 comments on commit dea47ed

Please sign in to comment.