From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web12.11963.1595302796023671260 for ; Mon, 20 Jul 2020 20:39:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=cZ1A9Scs; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: bob.c.feng@intel.com) IronPort-SDR: 3m7pfvt6H0MSs/DpZSHADxAM19Vm9Vx1Dhb9BnFUvJEpFEKZ9EfFZAFeICZXJNUERM6dcpxXsL EZ0rxjun/81Q== X-IronPort-AV: E=McAfee;i="6000,8403,9688"; a="130132546" X-IronPort-AV: E=Sophos;i="5.75,377,1589266800"; d="scan'208";a="130132546" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2020 20:39:55 -0700 IronPort-SDR: zy4oCuAi+u81x8jo2n9I1KCFdNS/LBR6qsTkVvUWLk8DpqttaSURztYxKHXP/H1VMVwQNtyOh2 AVZUdvtNX9LQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,377,1589266800"; d="scan'208";a="283728543" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 20 Jul 2020 20:39:55 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Jul 2020 20:39:54 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.171) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 20 Jul 2020 20:39:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KQL+yFeDTetCWu0mU5FfoycycVkA/B/pfXPv0mSOLWPIB6v18FQ/H+mycTJCgsa5dX7D5YhYdM/IKl5xN5qcQwt3LRvKP2lhnhE3px0CPTMMPyIeThgAQqF7225JB22Bl+czuXRyrYglkSl38Dm0l8m906YrPOg8OhJ7KVp+eMwF6x/liK2BQt8aKbhXrJ3GOGOHKwvxf1pf/L3ZqcKwSBsnrvtsVIzWyrlwMs3PE5afGIUmpVO9uB/56SNux0nM+Bn/aJohkeTGCCITHAjgAbR1WsdjlnZ4JeftwcR0tgMWYcWg7uvgTFK2+wGPs8sjSbHQcMrcfJxagN2NMX7Vyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YFKg5yxwty5EhqZxwC3/C04xPx4/PUy0rjXfgf7aPGo=; b=fGGe2K8Q6rkfv5EkL313T7IhPZKajTRfZNzwx7MeYJ4rPjP9h73Rbnq6u0oJQuQMXQHsReG5TzklcgGWC3T5h/SOYGvWIYP11r8KjQgl8jRNGOIF2KTsd0ScMBYT2oRkX+oC9v+FU3zUcPyQUE3XFnWMxvFRJj/Wi/PV7Lt9/PEUyfSLOIaJkZZrczcrofmWf7uyUkL8EgzPnGeGuSIs8dGtBeuyqiZEB+d+1xIjnD/RbFhISw7G58m5YUHYl4C/Qhae0SiEksLSOphPG1ZRYAijgIcaZjz4YCjxsGJ5vWphJU1g7snmewyQCsK4JkkNq6gjjgUKKaha1QiGOOZnpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YFKg5yxwty5EhqZxwC3/C04xPx4/PUy0rjXfgf7aPGo=; b=cZ1A9ScsVgAkfC+URKQP9YVRq7JdQmUiNeEudbwFK2jqkmNuaG2nPACteJntIHwLXLeFv1ad66HQLkysVK4JnLx9c5rd1RLF6dxqStGj1sb9Dj8qC03sjOiY6+UAAArjOc6KIWIZIkopO2Ey5YIXDYNOYkYdkP8OGMgpEIqa5SM= Received: from BN6PR11MB0068.namprd11.prod.outlook.com (2603:10b6:405:69::17) by BN6PR11MB1828.namprd11.prod.outlook.com (2603:10b6:404:103::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.18; Tue, 21 Jul 2020 03:39:53 +0000 Received: from BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::f4b6:406b:26fc:c069]) by BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::f4b6:406b:26fc:c069%3]) with mapi id 15.20.3195.026; Tue, 21 Jul 2020 03:39:53 +0000 From: "Bob Feng" To: "devel@edk2.groups.io" , "Feng, Bob C" , "Chen, Christine" Subject: Re: [edk2-devel] [Patch v4] BaseTools: Add Guid name support in GenFfs. Thread-Topic: [edk2-devel] [Patch v4] BaseTools: Add Guid name support in GenFfs. Thread-Index: AQHWWZ/6iJSNCMgWRUCXaIepjV6JnqkH0UYggAmcg3A= Date: Tue, 21 Jul 2020 03:39:53 +0000 Message-ID: References: <20200714053040.1561-1-yuwei.chen@intel.com> <1621C6E7ED5B7C55.2845@groups.io> In-Reply-To: <1621C6E7ED5B7C55.2845@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.45] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f9cf4b22-e021-43be-e7b0-08d82d27baf0 x-ms-traffictypediagnostic: BN6PR11MB1828: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:813; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nRiGjzEogtjowUxSU61MACGwiZjwqCFDGgQ3dAhItCRmyUiP4QWmDSEDv9iAbOmtJbXI7A2oPAAcRKM7d2KfOQG+uZXS+/XqFE+bAv2XB2+nUrykQPGa9xaa8iRASjwDqJIFjhXOpADvfPRxwxleACpY5pUqYxSM81m6Im59r8VVERLpe8uAJPpVGw6vfA2dTIUI8BEA2DToai12WLgWzTbnqaRF7Qle2AIeyOahrvAhSaeP6kvZPizRlG9sAPUo7fXzWzHlkHtvp3dH4A1SpratUjBf3IR5A9EliLZebY8+5WPf86WnWMQunh1nJ4N0sdMcEcND22OlbCR/CnTLnMtp9y3xdbMYcB/HAj0aCF9duoA6u0vnWXhFWdglGP0pmVLC4h09JugM/5s0qbZzsQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN6PR11MB0068.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(136003)(376002)(346002)(366004)(396003)(39860400002)(966005)(478600001)(83380400001)(2906002)(9686003)(5660300002)(110136005)(8936002)(316002)(66476007)(66556008)(66946007)(66446008)(76116006)(8676002)(64756008)(55016002)(186003)(26005)(7696005)(33656002)(52536014)(6506007)(53546011)(71200400001)(6636002)(86362001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: KyicyXTj2Lx2hep5phNoZ/iNRrfDhTLv97O54zhAWwmB08mwJNArTei2Sn92wq7gKF6nXF9acTP5br/T5///j+3/ejBJ7nuWGdFVicmHWz5dxF3A8vO3IVrqUOfm0iTkjFWSVVAEOmjKMx41Sfu7WBfmU5Wze0N4zZ+ll9druE+N3bm89jJV9xRX2m/XyyGyvtGiQBSg8tJctnVz3NTrFxFKzRXAhM793iWlISz/uMNR9BerjXVxLWO1DZOgtG2rnjjG4BnpeMluD32DsPZ/uYN3dDREwDwI3eClzZXYsY0LGB89OOkuijlKoBoKlrmTwgElIRDwGSMrHMnIGcoel0dgelC1B8msUPTuzswGXkv3CBFL1kI2u18q39V0QwC1QvnwwyclPBCvAWR7v0SblUd+03NlCNA3YcGUcUEuoWUUHw40266ovZ7+p1nk1ij83ckXwCK/zaYAHN7951J81hyV0lPzZTYyGKuOd7fPmAq1x0bBj7iXWbJH2qe0Rp2/ MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB0068.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9cf4b22-e021-43be-e7b0-08d82d27baf0 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2020 03:39:53.4101 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gB1mMOOgj94CXOJmFtygDqpfu37N/uItTXl2fA3vCN1hb5/Wy6nQa7XaEyVC65wWxsrZVtip+9Z1gPMhZd2OQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1828 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Christine, Please update the Bugzilla 2762 status. Thanks, Bob -----Original Message----- From: devel@edk2.groups.io On Behalf Of Bob Feng Sent: Wednesday, July 15, 2020 8:54 AM To: devel@edk2.groups.io; Chen, Christine Subject: Re: [edk2-devel] [Patch v4] BaseTools: Add Guid name support in G= enFfs. Reviewed-by: Bob Feng=20 -----Original Message----- From: devel@edk2.groups.io On Behalf Of Yuwei Chen Sent: Tuesday, July 14, 2020 1:31 PM To: devel@edk2.groups.io Subject: [edk2-devel] [Patch v4] BaseTools: Add Guid name support in GenFf= s. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2762 The Fv Section in the FDF files use hard coding Guid values which is incon= venient to manage. This patch adds Guid name support in GenFfs to solve thi= s problem. Signed-off-by: Yuwei Chen --- .../Source/Python/AutoGen/WorkspaceAutoGen.py | 24 +++++++++++++++++++ B= aseTools/Source/Python/Common/GlobalData.py | 1 + BaseTools/Source/Python/GenFds/FdfParser.py | 14 ++++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py b/BaseToo= ls/Source/Python/AutoGen/WorkspaceAutoGen.py index 668126aaac..f86c749c08 100644 --- a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py @@ -108,6 +108,10 @@ class WorkspaceAutoGen(AutoGen): # # Mark now build in AutoGen Phase # + # + # Collect Platform Guids to support Guid name in Fdfparser. + # + self.CollectPlatformGuids() GlobalData.gAutoGenPhase =3D True self.ProcessModuleFromPdf() self.ProcessPcdType() @@ -153,6 +157,26 @@ class WorkspaceAutoGen(AutoGen): EdkLogger.error("build", PARAMETER_INVALID, ExtraData=3D"Build target [%s] is not support= ed by the platform. [Valid target: %s]" % (self.BuildTarget, " ".join(self.= Platform.BuildTargets))) + + def CollectPlatformGuids(self): + oriInfList =3D [] + oriPkgSet =3D set() + PlatformPkg =3D set() + for Arch in self.ArchList: + Platform =3D self.BuildDatabase[self.MetaFile, Arch, self.Bui= ldTarget, self.ToolChain] + oriInfList =3D Platform.Modules + for ModuleFile in oriInfList: + ModuleData =3D self.BuildDatabase[ModuleFile, Platform._A= rch, Platform._Target, Platform._Toolchain] + oriPkgSet.update(ModuleData.Packages) + for Pkg in oriPkgSet: + Guids =3D Pkg.Guids + GlobalData.gGuidDict.update(Guids) + if Platform.Packages: + PlatformPkg.update(Platform.Packages) + for Pkg in PlatformPkg: + Guids =3D Pkg.Guids + GlobalData.gGuidDict.update(Guids) + @cached_property def FdfProfile(self): if not self.FdfFile: diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Sour= ce/Python/Common/GlobalData.py index 8ac29eb7a6..61ab3f7e24 100755 --- a/BaseTools/Source/Python/Common/GlobalData.py +++ b/BaseTools/Source/Python/Common/GlobalData.py @@ -29,6 +29,7 @@ gProcessingFile =3D '' gBuildingModule =3D '' gSkuids =3D [] gDefaultStores =3D [] +gGuidDict =3D {} =20 # definition for a MACRO name. used to create regular expressions below. _MacroNamePattern =3D "[A-Z][A-Z0-9_]*" diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Sourc= e/Python/GenFds/FdfParser.py index 9b04a76af8..ea2401b0e4 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -18,7 +18,7 @@ from uuid import UUID =20 from Common.BuildToolError import * from Common import EdkLogger -from Common.Misc import PathClass, tdict, ProcessDuplicatedInf +from Common.Misc import PathClass, tdict, ProcessDuplicatedInf,=20 +GuidStructureStringToGuidString from Common.StringUtils import NormPath, ReplaceMacro from Common import= GlobalData from Common.Expression import * @@ -1087,6 +1087,8 @@ class Fd= fParser: return False if GlobalData.gGuidPattern.match(self._Token) is not None: return True + elif self._Token in GlobalData.gGuidDict: + return True else: self._UndoToken() return False @@ -2248,6 +2250,8 @@ class FdfParser: =20 if not self._GetNextGuid(): raise Warning.Expected("GUID value", self.FileName, self.Curr= entLineNumber) + if self._Token in GlobalData.gGuidDict: + self._Token =3D + GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upp + er() =20 FvObj.FvNameGuid =3D self._Token =20 @@ -2459,6 +2463,8 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentL= ineNumber) if not self._GetNextGuid(): raise Warning.Expected("GUID value", self.FileName, self.= CurrentLineNumber) + if self._Token in GlobalData.gGuidDict: + self._Token =3D + GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upp + er() FfsInfObj.OverrideGuid =3D self._Token =20 if self._IsKeyword("RuleOverride"): @@ -2550,6 +2556,8 @@ class FdfParser: raise Warning.Expected("')'", self.FileName, self.Cur= rentLineNumber) self._Token =3D 'PCD('+PcdPair[1]+TAB_SPLIT+PcdPair[0]+')= ' =20 + if self._Token in GlobalData.gGuidDict: + self._Token =3D + GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upp + er() FfsFileObj.NameGuid =3D self._Token =20 self._GetFilePart(FfsFileObj) @@ -2980,6 +2988,8 @@ class FdfParser: elif self._IsKeyword("GUIDED"): GuidValue =3D None if self._GetNextGuid(): + if self._Token in GlobalData.gGuidDict: + self._Token =3D + GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upp + er() GuidValue =3D self._Token =20 AttribDict =3D self._GetGuidAttrib() @@ -4049,6 +4059,8 @@ cl= ass FdfParser: elif self._IsKeyword("GUIDED"): GuidValue =3D None if self._GetNextGuid(): + if self._Token in GlobalData.gGuidDict: + self._Token =3D + GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upp + er() GuidValue =3D self._Token =20 if self._IsKeyword("$(NAMED_GUID)"): -- 2.27.0.windows.1