From 91de220b8d0e1c13911d917d417131e237516c73 Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Wed, 28 Feb 2018 11:09:39 +0800 Subject: [PATCH] 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 (cherry picked from commit 2157bc9c8b8be30ada11fe2e64454157d3ae528f) --- BaseTools/Source/Python/build/BuildReport.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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.