From 859e09523d66844d81f5f4a3d53f3cd96523c221 Mon Sep 17 00:00:00 2001 From: Bob Feng Date: Fri, 4 Sep 2020 22:30:28 +0800 Subject: [PATCH] BaseTools: Sort the Pcd set when generating the VPD binary 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 Reviewed-by: Liming Gao Reviewed-by: Philippe Mathieu-Daude --- 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 @@ -253,7 +253,7 @@ class PlatformAutoGen(AutoGen): 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] 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 @@ -2584,7 +2584,7 @@ class DscBuildData(PlatformBuildClassObject): 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) -- 2.39.2