summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library
diff options
context:
space:
mode:
authorLiming Gao <liming.gao@intel.com>2015-07-02 04:27:54 +0000
committerlgao4 <lgao4@Edk2>2015-07-02 04:27:54 +0000
commitde6c0eff30a3f10637ec6295988ddc0f4dfdeb6e (patch)
tree59588578b0585fa2bb9e1a6d4f4906c16df96598 /MdeModulePkg/Library
parent2b75e8cd093afeb1377dbdaa80a24e96e49f099b (diff)
downloadedk2-platforms-de6c0eff30a3f10637ec6295988ddc0f4dfdeb6e.tar.xz
MdeModulePkg: UefiBootManagerLib to handle LoadFile DevicePath
UEFI Spec HTTP Boot Device Path, after retrieving the boot resource information, the BootURI device path node will be updated to include the BootURI information. It means the device path on the child handle will be updated after the LoadFile() service is called. To handle this case, UefiBootManagerLib BmGetLoadOptionBuffer API is updated as the below: 1) Get Device handle based on Device Path 2) Call LoadFile() service (GetFileBufferByFilePath() API) to get Load File Buffer. 3) Retrieve DevicePath from Device handle Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17798 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library')
-rw-r--r--MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
index 028edc35d5..3691c116a9 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
@@ -1501,9 +1501,18 @@ BmGetLoadOptionBuffer (
// Directly reads the load option when it doesn't reside in simple file system instance (LoadFile/LoadFile2),
// or it directly points to a file in simple file system instance.
//
+ Node = FilePath;
+ Status = gBS->LocateDevicePath (&gEfiLoadFileProtocolGuid, &Node, &Handle);
FileBuffer = GetFileBufferByFilePath (TRUE, FilePath, FileSize, &AuthenticationStatus);
if (FileBuffer != NULL) {
- *FullPath = DuplicateDevicePath (FilePath);
+ if (EFI_ERROR (Status)) {
+ *FullPath = DuplicateDevicePath (FilePath);
+ } else {
+ //
+ // LoadFile () may cause the device path of the Handle be updated.
+ //
+ *FullPath = AppendDevicePath (DevicePathFromHandle (Handle), Node);
+ }
}
return FileBuffer;