From: Yonghong Zhu Date: Wed, 28 Feb 2018 03:09:39 +0000 (+0800) Subject: BaseTools: Enhance FV info report file path to support absolute path X-Git-Tag: edk2-stable201903~2308 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=2157bc9c8b8be30ada11fe2e64454157d3ae528f BaseTools: Enhance FV info report file path to support absolute path When generate build report, Tool will get the info like size, Fv Name, etc from the xx.Fv.txt file and add these info into the build report. This patch support the xx.Fv.txt to use absolute file path format since user may provide specified FV path. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py index 58595d62b3..b2cc6eec0a 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1726,7 +1726,13 @@ class FdRegionReport(object): FvTotalSize = 0 FvTakenSize = 0 FvFreeSize = 0 - FvReportFileName = os.path.join(self._FvDir, FvName + ".Fv.txt") + if not os.path.isfile(FvName): + FvReportFileName = os.path.join(self._FvDir, FvName + ".Fv.txt") + else: + if FvName.upper().endswith('.FV'): + FvReportFileName = FvName + ".txt" + else: + FvReportFileName = FvName + ".Fv.txt" try: # # Collect size info in the firmware volume.