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=liming.gao@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 A596B222275A3 for ; Sun, 7 Jan 2018 19:28:43 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jan 2018 19:33:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,329,1511856000"; d="scan'208";a="19060389" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 07 Jan 2018 19:33:52 -0800 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 7 Jan 2018 19:33:52 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 7 Jan 2018 19:33:52 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Mon, 8 Jan 2018 11:33:50 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: Fix Sku inherit issue. Thread-Index: AQHTfth2n8j6EimAVkm4cIQBRSPVfKNpZUqw Date: Mon, 8 Jan 2018 03:33:49 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1A0176@SHSMSX104.ccr.corp.intel.com> References: <20171227060335.1744-1-bob.c.feng@intel.com> In-Reply-To: <20171227060335.1744-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: Fix Sku inherit issue. 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: Mon, 08 Jan 2018 03:28:44 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of >BobCF >Sent: Wednesday, December 27, 2017 2:04 PM >To: edk2-devel@lists.01.org >Subject: [edk2] [Patch] BaseTools: Fix Sku inherit issue. > >The final Pcd value should only be override by its parents. > >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Feng Bob C >Reviewed-by: Liming Gao >--- > BaseTools/Source/Python/Common/Misc.py | 2 ++ > BaseTools/Source/Python/Workspace/DscBuildData.py | 4 ++-- > 2 files changed, 4 insertions(+), 2 deletions(-) > >diff --git a/BaseTools/Source/Python/Common/Misc.py >b/BaseTools/Source/Python/Common/Misc.py >index 0374be0631..dc214dbfa8 100644 >--- a/BaseTools/Source/Python/Common/Misc.py >+++ b/BaseTools/Source/Python/Common/Misc.py >@@ -2198,10 +2198,12 @@ class SkuClass(): > for item in self.SkuData.values(): > self.__SkuInherit[item[1]]=3Ditem[2] if item[2] else "DEF= AULT" > return self.__SkuInherit.get(skuname,"DEFAULT") > > def GetSkuChain(self,sku): >+ if sku =3D=3D "DEFAULT": >+ return ["DEFAULT"] > skulist =3D [sku] > nextsku =3D sku > while 1: > nextsku =3D self.GetNextSkuId(nextsku) > skulist.append(nextsku) >diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py >b/BaseTools/Source/Python/Workspace/DscBuildData.py >index 929c317957..5e052eca7c 100644 >--- a/BaseTools/Source/Python/Workspace/DscBuildData.py >+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py >@@ -1319,11 +1319,11 @@ class DscBuildData(PlatformBuildClassObject): > FieldName =3D FieldName.split(']', 1)[1] > FieldName =3D NewFieldName + FieldName > while '[' in FieldName: > FieldName =3D FieldName.rsplit('[', 1)[0] > CApp =3D CApp + ' __FLEXIBLE_SIZE(Size, %s, = %s, %d);\n' % >(Pcd.DatumType, FieldName.strip("."), ArrayIndex + 1) >- for skuname in self.SkuIdMgr.SkuOverrideOrder(): >+ for skuname in self.SkuIdMgr.GetSkuChain(SkuName): > inherit_OverrideValues =3D Pcd.SkuOverrideValues[skuname] > for FieldList in [inherit_OverrideValues.get(DefaultStore= Name)]: > if not FieldList: > continue > for FieldName in FieldList: >@@ -1383,11 +1383,11 @@ class DscBuildData(PlatformBuildClassObject): > else: > if ValueSize > 4: > CApp =3D CApp + ' Pcd->%s =3D %dULL; // From= %s Line %d >Value %s\n' % (FieldName, Value, FieldList[FieldName][1], >FieldList[FieldName][2], FieldList[FieldName][0]) > else: > CApp =3D CApp + ' Pcd->%s =3D %d; // From %s= Line %d >Value %s\n' % (FieldName, Value, FieldList[FieldName][1], >FieldList[FieldName][2], FieldList[FieldName][0]) >- for skuname in self.SkuIdMgr.SkuOverrideOrder(): >+ for skuname in self.SkuIdMgr.GetSkuChain(SkuName): > inherit_OverrideValues =3D Pcd.SkuOverrideValues[skuname] > for FieldList in >[Pcd.DefaultFromDSC,inherit_OverrideValues.get(DefaultStoreName)]: > if not FieldList: > continue > if Pcd.DefaultFromDSC and FieldList =3D=3D Pcd.Defaul= tFromDSC: >-- >2.14.3.windows.1 > >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel