]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix the bug to search Fv.txt file relative to workspace
authorYonghong Zhu <yonghong.zhu@intel.com>
Fri, 2 Mar 2018 17:09:03 +0000 (01:09 +0800)
committerLiming Gao <liming.gao@intel.com>
Sat, 3 Mar 2018 04:40:51 +0000 (12:40 +0800)
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 <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/build/BuildReport.py

index f4d2c753430313866b327cab9fe9b11a1a0699db..89bdfa1d864288e69db0ccdbffc3e90db40f6222 100644 (file)
@@ -1677,6 +1677,7 @@ class FdRegionReport(object):
         self.FvInfo = {}\r
         self._GuidsDb = {}\r
         self._FvDir = Wa.FvDir\r
+        self._WorkspaceDir = Wa.WorkspaceDir\r
 \r
         #\r
         # If the input FdRegion is not a firmware volume,\r
@@ -1780,13 +1781,15 @@ class FdRegionReport(object):
             FvTotalSize = 0\r
             FvTakenSize = 0\r
             FvFreeSize  = 0\r
-            if not os.path.isfile(FvName):\r
-                FvReportFileName = os.path.join(self._FvDir, FvName + ".Fv.txt")\r
+            if FvName.upper().endswith('.FV'):\r
+                FileExt = FvName + ".txt"\r
             else:\r
-                if FvName.upper().endswith('.FV'):\r
-                    FvReportFileName = FvName + ".txt"\r
-                else:\r
-                    FvReportFileName = FvName + ".Fv.txt"\r
+                FileExt = FvName + ".Fv.txt"\r
+\r
+            if not os.path.isfile(FileExt):\r
+                FvReportFileName = mws.join(self._WorkspaceDir, FileExt)\r
+                if not os.path.isfile(FvReportFileName):\r
+                    FvReportFileName = os.path.join(self._FvDir, FileExt)\r
             try:\r
                 #\r
                 # Collect size info in the firmware volume.\r