From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E877B22402DF4 for ; Fri, 2 Mar 2018 09:02:57 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Mar 2018 09:09:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,413,1515484800"; d="scan'208";a="30983614" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by FMSMGA003.fm.intel.com with ESMTP; 02 Mar 2018 09:09:06 -0800 From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Sat, 3 Mar 2018 01:09:03 +0800 Message-Id: <1520010543-14416-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [Patch] BaseTools: Fix the bug to search Fv.txt file relative to workspace X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2018 17:02:58 -0000 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 --- 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 b2cc6ee..2fb6ad0 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1621,10 +1621,11 @@ class FdRegionReport(object): self.Size = FdRegion.Size self.FvList = [] self.FvInfo = {} self._GuidsDb = {} self._FvDir = Wa.FvDir + self._WorkspaceDir = Wa.WorkspaceDir # # If the input FdRegion is not a firmware volume, # we are done. # @@ -1724,17 +1725,19 @@ class FdRegionReport(object): if self.Type == "FV": 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. # FvReport = open(FvReportFileName).read() -- 2.6.1.windows.1