summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c')
-rw-r--r--MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index bef41ae102..95d185b639 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -2405,13 +2405,9 @@ BmRegisterBootManagerMenu (
CHAR16 *Description;
UINTN DescriptionLength;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
- MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FileNode;
UINTN HandleCount;
EFI_HANDLE *Handles;
UINTN Index;
- VOID *Data;
- UINTN DataSize;
DevicePath = NULL;
Description = NULL;
@@ -2437,22 +2433,17 @@ BmRegisterBootManagerMenu (
}
if (DevicePath == NULL) {
- Data = NULL;
- Status = GetSectionFromAnyFv (
+ Status = GetFileDevicePathFromAnyFv (
PcdGetPtr (PcdBootManagerMenuFile),
EFI_SECTION_PE32,
0,
- (VOID **) &Data,
- &DataSize
+ &DevicePath
);
- if (Data != NULL) {
- FreePool (Data);
- }
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_WARN, "[Bds]BootManagerMenu FFS section can not be found, skip its boot option registration\n"));
return EFI_NOT_FOUND;
}
-
+ ASSERT (DevicePath != NULL);
//
// Get BootManagerMenu application's description from EFI User Interface Section.
//
@@ -2466,19 +2457,6 @@ BmRegisterBootManagerMenu (
if (EFI_ERROR (Status)) {
Description = NULL;
}
-
- EfiInitializeFwVolDevicepathNode (&FileNode, PcdGetPtr (PcdBootManagerMenuFile));
- Status = gBS->HandleProtocol (
- gImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID **) &LoadedImage
- );
- ASSERT_EFI_ERROR (Status);
- DevicePath = AppendDevicePathNode (
- DevicePathFromHandle (LoadedImage->DeviceHandle),
- (EFI_DEVICE_PATH_PROTOCOL *) &FileNode
- );
- ASSERT (DevicePath != NULL);
}
Status = EfiBootManagerInitializeLoadOption (