]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix a bug in the VPD report generation
authorYonghong Zhu <yonghong.zhu@intel.com>
Mon, 7 Dec 2015 09:03:35 +0000 (09:03 +0000)
committeryzhu52 <yzhu52@Edk2>
Mon, 7 Dec 2015 09:03:35 +0000 (09:03 +0000)
Changed the if condition to check whether current Region is FD VPD region
to fix a bug in the VPD report generation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19139 6f19259b-4bc3-4df7-8a09-765794883524

BaseTools/Source/Python/build/BuildReport.py

index 722d8b7f458cbec76d46412f57eda0944d191119..d459a0113acb089636f7e9547136f0e0c7c04aed 100644 (file)
@@ -1389,11 +1389,11 @@ class FdReport(object):
         self.FdRegionList = [FdRegionReport(FdRegion, Wa) for FdRegion in Fd.RegionList]\r
         self.FvPath = os.path.join(Wa.BuildDir, "FV")\r
         self.VpdFilePath = os.path.join(self.FvPath, "%s.map" % Wa.Platform.VpdToolGuid)\r
         self.FdRegionList = [FdRegionReport(FdRegion, Wa) for FdRegion in Fd.RegionList]\r
         self.FvPath = os.path.join(Wa.BuildDir, "FV")\r
         self.VpdFilePath = os.path.join(self.FvPath, "%s.map" % Wa.Platform.VpdToolGuid)\r
-        VpdPcdToken = 'gEfiMdeModulePkgTokenSpaceGuid'\r
-        VpdPcdName = 'PcdVpdBaseAddress'\r
+        self.VPDBaseAddress = 0\r
+        self.VPDSize = 0\r
         self.VPDInfoList = []\r
         for index, FdRegion in enumerate(Fd.RegionList):\r
         self.VPDInfoList = []\r
         for index, FdRegion in enumerate(Fd.RegionList):\r
-            if (VpdPcdName, VpdPcdToken) == FdRegion.PcdOffset:\r
+            if str(FdRegion.RegionType) is 'FILE' and Wa.Platform.VpdToolGuid in str(FdRegion.RegionDataList):\r
                 self.VPDBaseAddress = self.FdRegionList[index].BaseAddress\r
                 self.VPDSize = self.FdRegionList[index].Size\r
                 break\r
                 self.VPDBaseAddress = self.FdRegionList[index].BaseAddress\r
                 self.VPDSize = self.FdRegionList[index].Size\r
                 break\r