From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.39313.1599229854505428947 for ; Fri, 04 Sep 2020 07:30:55 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: bob.c.feng@intel.com) IronPort-SDR: i4aEnejd/yYAQq6OMXRMOngHeUI9rihRwYjoGbII5Guwc8tywNnizlMoyNW+JUWafRVvUy9Nc3 z3ghGRx070Jw== X-IronPort-AV: E=McAfee;i="6000,8403,9734"; a="137268051" X-IronPort-AV: E=Sophos;i="5.76,389,1592895600"; d="scan'208";a="137268051" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 07:30:54 -0700 IronPort-SDR: FIbAgwG+ahZPsbpbomIAyyZj0Nxk28JOf1lNeMCfzJJvFJYfrFcARiFYndVbxW09yWAC5LX1C8 1+r4WD9oKUOA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,389,1592895600"; d="scan'208";a="502947157" Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.66]) by fmsmga006.fm.intel.com with ESMTP; 04 Sep 2020 07:30:52 -0700 From: "Bob Feng" To: devel@edk2.groups.io Cc: Liming Gao , Yuwei Chen Subject: [Patch] BaseTools: Sort the Pcd set when generating the VPD binary Date: Fri, 4 Sep 2020 22:30:28 +0800 Message-Id: <20200904143028.41796-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit If VPD PcdNvStoreDefaultValueBuffer is used, all DynamicHii and DynamicExHii PCD value will be generated into that VPD. In order to generate the same VPD binary file in every build, sort the Pcd set when generating VPD. Signed-off-by: Bob Feng Cc: Liming Gao Cc: Yuwei Chen --- BaseTools/Source/Python/AutoGen/PlatformAutoGen.py | 2 +- BaseTools/Source/Python/Workspace/DscBuildData.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py index af66c48c7d..26ab8e7f36 100644 --- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py @@ -251,11 +251,11 @@ class PlatformAutoGen(AutoGen): VariableInfo = VariableMgr(self.DscBuildDataObj._GetDefaultStores(), self.DscBuildDataObj.SkuIds) VariableInfo.SetVpdRegionMaxSize(VpdRegionSize) VariableInfo.SetVpdRegionOffset(VpdRegionBase) Index = 0 - for Pcd in DynamicPcdSet: + for Pcd in sorted(DynamicPcdSet): pcdname = ".".join((Pcd.TokenSpaceGuidCName, Pcd.TokenCName)) for SkuName in Pcd.SkuInfoList: Sku = Pcd.SkuInfoList[SkuName] SkuId = Sku.SkuId if SkuId is None or SkuId == '': diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py b/BaseTools/Source/Python/Workspace/DscBuildData.py index 1afbd3eefc..4a128c8a77 100644 --- a/BaseTools/Source/Python/Workspace/DscBuildData.py +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py @@ -2582,11 +2582,11 @@ class DscBuildData(PlatformBuildClassObject): IncludeFiles.add(IncludeFile) CApp = CApp + '#include <%s>\n' % (IncludeFile) CApp = CApp + '\n' for Pcd in StructuredPcds.values(): CApp = CApp + self.GenerateArrayAssignment(Pcd) - for PcdName in StructuredPcds: + for PcdName in sorted(StructuredPcds.keys()): Pcd = StructuredPcds[PcdName] CApp = CApp + self.GenerateSizeFunction(Pcd) CApp = CApp + self.GenerateDefaultValueAssignFunction(Pcd) CApp = CApp + self.GenerateFdfValue(Pcd) CApp = CApp + self.GenerateCommandLineValue(Pcd) -- 2.20.1.windows.1