Skip to content

Commit dea47ed

Browse files
committed
Updating UefiBootManager to handle Fv Files and Files that are not valid
1 parent 76f3943 commit dea47ed

File tree

1 file changed

+28
-1
lines changed
  • MdeModulePkg/Library/UefiBootManagerLib

1 file changed

+28
-1
lines changed

MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1919,6 +1919,20 @@ EfiBootManagerBoot (
19191919
return;
19201920
}
19211921

1922+
// MU_CHANGE [BEGIN]
1923+
//
1924+
// 0. Determine if the file path exists. (I.E we can't load it if it doesnt)
1925+
//
1926+
FilePath = BootOption->FilePath;
1927+
Status = gBS->LocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid, &FilePath, &ImageHandle);
1928+
if (EFI_ERROR (Status)) {
1929+
DEBUG ((DEBUG_ERROR, "%a: LocateDevicePath Failed (%r)\n", __func__, Status));
1930+
BootOption->Status = Status;
1931+
return;
1932+
}
1933+
1934+
// MU_CHANGE [END]
1935+
19221936
//
19231937
// 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")
19241938
//
@@ -1962,7 +1976,16 @@ EfiBootManagerBoot (
19621976
if (BmIsBootManagerMenuFilePath (BootOption->FilePath)) {
19631977
DEBUG ((DEBUG_INFO, "[Bds] Booting Boot Manager Menu.\n"));
19641978
BmStopHotkeyService (NULL, NULL);
1965-
} else {
1979+
}
1980+
// MU_CHANGE [BEGIN]
1981+
else if (BmIsFvFilePath (BootOption->FilePath)) {
1982+
//
1983+
// Do nothing. This file originates from a measured FV and is an extension of the BDS environment
1984+
// We should not signal ready to boot.
1985+
// We will still need to load / start it.
1986+
}
1987+
// MU_CHANGE [END]
1988+
else {
19661989
PERF_EVENT_SIGNAL_BEGIN (&gEfiEventPreReadyToBootGuid); // MU_CHANGE
19671990
EfiEventGroupSignal (&gEfiEventPreReadyToBootGuid); // MU_CHANGE
19681991
PERF_EVENT_SIGNAL_END (&gEfiEventPreReadyToBootGuid); // MU_CHANGE
@@ -2044,6 +2067,10 @@ EfiBootManagerBoot (
20442067
);
20452068
}
20462069

2070+
// MU_CHANGE [BEGIN]
2071+
DEBUG ((DEBUG_ERROR, "%a: LoadImage returned %r\n", __func__, Status));
2072+
// MU CHANGE [END]
2073+
20472074
if (FileBuffer != NULL) {
20482075
FreePool (FileBuffer);
20492076
}

0 commit comments

Comments
 (0)