From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 0474C2233376C for ; Mon, 22 Jan 2018 23:55:35 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jan 2018 00:01:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,400,1511856000"; d="scan'208";a="12462141" Received: from shwdeopenpsi105.ccr.corp.intel.com ([10.239.9.129]) by fmsmga008.fm.intel.com with ESMTP; 23 Jan 2018 00:01:01 -0800 From: BobCF To: edk2-devel@lists.01.org Date: Tue, 23 Jan 2018 16:00:59 +0800 Message-Id: <20180123080059.14692-1-bob.c.feng@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 Subject: [Patch] BaseTools: Fixed incorrect VPD size. 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: Tue, 23 Jan 2018 07:55:36 -0000 The VPD size is incorrect if that VPD is not used in Module. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Feng Bob C Reviewed-by: Liming Gao --- BaseTools/Source/Python/AutoGen/AutoGen.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index ce8bc64ca5..848378f3d4 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -1744,18 +1744,16 @@ class PlatformAutoGen(AutoGen): # Not found, it should be signature if not FoundFlag : # just pick the a value to determine whether is unicode string type SkuValueMap = {} + SkuObjList = DscPcdEntry.SkuInfoList.items() DefaultSku = DscPcdEntry.SkuInfoList.get('DEFAULT') if DefaultSku: - PcdValue = DefaultSku.DefaultValue - if PcdValue not in SkuValueMap: - SkuValueMap[PcdValue] = [] - VpdFile.Add(DscPcdEntry, 'DEFAULT',DefaultSku.VpdOffset) - SkuValueMap[PcdValue].append(DefaultSku) - for (SkuName,Sku) in DscPcdEntry.SkuInfoList.items(): + defaultindex = SkuObjList.index(('DEFAULT',DefaultSku)) + SkuObjList[0],SkuObjList[defaultindex] = SkuObjList[defaultindex],SkuObjList[0] + for (SkuName,Sku) in SkuObjList: Sku.VpdOffset = Sku.VpdOffset.strip() # Need to iterate DEC pcd information to get the value & datumtype for eachDec in self.PackageList: for DecPcd in eachDec.Pcds: -- 2.14.3.windows.1