mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-26 23:24:03 +02:00
MdeModulePkg UefiBootManagerLib: Update LoadFile boot description
Update boot description to support LoadFile protocol based on FV file. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
parent
2f01478894
commit
fa9f986cfb
@ -454,6 +454,52 @@ BmGetNetworkDescription (
|
|||||||
return Description;
|
return Description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Return the boot description for LoadFile
|
||||||
|
|
||||||
|
@param Handle Controller handle.
|
||||||
|
|
||||||
|
@return The description string.
|
||||||
|
**/
|
||||||
|
CHAR16 *
|
||||||
|
BmGetLoadFileDescription (
|
||||||
|
IN EFI_HANDLE Handle
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
EFI_DEVICE_PATH_PROTOCOL *FilePath;
|
||||||
|
EFI_DEVICE_PATH_PROTOCOL *DevicePathNode;
|
||||||
|
CHAR16 *Description;
|
||||||
|
EFI_LOAD_FILE_PROTOCOL *LoadFile;
|
||||||
|
|
||||||
|
Status = gBS->HandleProtocol (Handle, &gEfiLoadFileProtocolGuid, (VOID **)&LoadFile);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Get the file name
|
||||||
|
//
|
||||||
|
Description = NULL;
|
||||||
|
Status = gBS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, (VOID **)&FilePath);
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
|
DevicePathNode = FilePath;
|
||||||
|
while (!IsDevicePathEnd (DevicePathNode)) {
|
||||||
|
if (DevicePathNode->Type == MEDIA_DEVICE_PATH && DevicePathNode->SubType == MEDIA_FILEPATH_DP) {
|
||||||
|
Description = (CHAR16 *)(DevicePathNode + 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
DevicePathNode = NextDevicePathNode (DevicePathNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Description != NULL) {
|
||||||
|
return AllocateCopyPool (StrSize (Description), Description);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Return the boot description for the controller based on the type.
|
Return the boot description for the controller based on the type.
|
||||||
|
|
||||||
@ -559,6 +605,7 @@ BM_GET_BOOT_DESCRIPTION mBmBootDescriptionHandlers[] = {
|
|||||||
BmGetUsbDescription,
|
BmGetUsbDescription,
|
||||||
BmGetDescriptionFromDiskInfo,
|
BmGetDescriptionFromDiskInfo,
|
||||||
BmGetNetworkDescription,
|
BmGetNetworkDescription,
|
||||||
|
BmGetLoadFileDescription,
|
||||||
BmGetMiscDescription
|
BmGetMiscDescription
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user