From aebe5a36b6e960896671d3134c6b26f6735b7f53 Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Sat, 3 Mar 2018 01:09:03 +0800 Subject: [PATCH] BaseTools: Fix the bug to search Fv.txt file relative to workspace when the SECTION FV_IMAGE = $(XX)/XX.Fv, the Fv file should relative to WORKSPACE, so when we search the XX.Fv.txt file, we should search the path relative to workspace first. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/build/BuildReport.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py index f4d2c75343..89bdfa1d86 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1677,6 +1677,7 @@ class FdRegionReport(object): self.FvInfo = {} self._GuidsDb = {} self._FvDir = Wa.FvDir + self._WorkspaceDir = Wa.WorkspaceDir # # If the input FdRegion is not a firmware volume, @@ -1780,13 +1781,15 @@ class FdRegionReport(object): FvTotalSize = 0 FvTakenSize = 0 FvFreeSize = 0 - if not os.path.isfile(FvName): - FvReportFileName = os.path.join(self._FvDir, FvName + ".Fv.txt") + if FvName.upper().endswith('.FV'): + FileExt = FvName + ".txt" else: - if FvName.upper().endswith('.FV'): - FvReportFileName = FvName + ".txt" - else: - FvReportFileName = FvName + ".Fv.txt" + FileExt = FvName + ".Fv.txt" + + if not os.path.isfile(FileExt): + FvReportFileName = mws.join(self._WorkspaceDir, FileExt) + if not os.path.isfile(FvReportFileName): + FvReportFileName = os.path.join(self._FvDir, FileExt) try: # # Collect size info in the firmware volume. -- 2.39.2