From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.20393.1594650022672656363 for ; Mon, 13 Jul 2020 07:20:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=P42iP0eN; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: bob.c.feng@intel.com) IronPort-SDR: 5iCMPSq4KoEVWAiGWA+wKG+GVSIwUtYJtlqH6O0IMCRdgc4arKiiCUlhr2ihBqj5mRpXJvFT1E Upwe+H/iC0Vw== X-IronPort-AV: E=McAfee;i="6000,8403,9680"; a="148615104" X-IronPort-AV: E=Sophos;i="5.75,347,1589266800"; d="scan'208";a="148615104" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2020 07:20:21 -0700 IronPort-SDR: qCjI7FEultoQXwWhxJ0G48glInxTxYKVeDiXH68A8TC4eVMDvBKj77nE7Pc+0zsrJIW3f9PWlg 1oUgiNfNbXjA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,347,1589266800"; d="scan'208";a="317392053" Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by fmsmga002.fm.intel.com with ESMTP; 13 Jul 2020 07:20:20 -0700 Received: from orsmsx151.amr.corp.intel.com (10.22.226.38) by ORSMSX102.amr.corp.intel.com (10.22.225.129) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 13 Jul 2020 07:20:20 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX151.amr.corp.intel.com (10.22.226.38) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 13 Jul 2020 07:20:19 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.57) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 13 Jul 2020 07:20:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bjdhAuq6VhzIHN6GkdW2ajswVNEbi7tCWKx2cxUP7dIrAGLOG6/qFj64aPwi6CPJbH5U29f/h9LHd8guRI7IMAyil1xp0dyq00CGdYhO+DxRepq36kVra/o/Sbh07D1Q6R/TTxD8SSr+SSksV5emtxdXObq6DIDinhr6EFHTpstr6e7n13Y2MpHPTkhTHelSJQEFiiTwB6RRKuXWkfoKletIhvR42GmdUqd+HETGXICqAicjMApqXJRuxagiBYaE/vF5NiPDtiF+xRcsWSYvKW6+aDjKjRP5if91qJ/Z/AjxJoyAP5YU7VUR0sk2gXJXBSJ1kZdo3Ri4dgyKrvf7gg== 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=mcjcqh9nRM2mDxRd64cvb37CJ2EgykvVGrGP7FuAi7k=; b=TweGWP+HiyVl2p9cxa4Mpcdz6q+xLLHJLRpTjoIZntHMHZEoTGXkR/IP/mGYq7IPvdhWoSN7AKiomokmz83cxFpbovcqUQaLXNPjTElOlqrYnVa0xTmKlEAaJmmDwjMcPdSEpFF4KTLNYSKrkm/1+ZmL+WtUUTkQIcfyE51V27dN2fvzszYpZRecnzNXnRqpevlM/WWop9/O9QNhq9WCkFKqmb+es33QfDnG8ILVrOtArFvIiZgnG9Scidvyy0wZIyf3COARegzOjCyKmWnllUDrAv7/GcJXD4xMTR6LVTVyJdk9REB62XYKLEGvvHpSdfhBqXcjsBkj79YMpsa8Hg== 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=mcjcqh9nRM2mDxRd64cvb37CJ2EgykvVGrGP7FuAi7k=; b=P42iP0eND8ycFxrs6+hKgS6EjEGcJuKo737BhRN5I1F7eHG0P5sgcCVa6Y20POQeveOIFzC4dr57XkFiSl0ZxZFSlaTsOcKOhL7us1st4ktIRryHLMthK+Nj6UR3EIAABRM2cSuGhk2GKW+oHAqNmV1OVei6FKEI4473CvUhFqI= Received: from BN6PR11MB0068.namprd11.prod.outlook.com (2603:10b6:405:69::17) by BN6PR11MB1636.namprd11.prod.outlook.com (2603:10b6:405:10::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22; Mon, 13 Jul 2020 14:20:18 +0000 Received: from BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::6870:82d3:5bde:4153]) by BN6PR11MB0068.namprd11.prod.outlook.com ([fe80::6870:82d3:5bde:4153%6]) with mapi id 15.20.3174.025; Mon, 13 Jul 2020 14:20:18 +0000 From: "Bob Feng" To: "devel@edk2.groups.io" , "Chen, Yuwei" 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: AQHWWOjC1fZLbDhRek2j5cBzFNf+wKkFj3Yg Date: Mon, 13 Jul 2020 14:20:18 +0000 Message-ID: References: <20200713073913.1970-1-yuwei.chen@intel.com> In-Reply-To: <20200713073913.1970-1-yuwei.chen@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action 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.198.147.197] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 90e3be28-20b4-4c02-9d3f-08d82737deb2 x-ms-traffictypediagnostic: BN6PR11MB1636: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1824; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: cBzUJI9LhxqR7XQGyD66exoPfLzy8cEw3T2gG8nh0yb4l+G9+vsuIMa25rQOwj+Y1xGsWnEFpP6FYKFdrft1r0En5BQh5r2pwmu+NZrhZQ8p2hGh/rmT6ENxbwHHqf7V9EMK8Qe00kmzgQjgOawtm/q3Vmf6vOaWP6KK/R/vVyojUegvrt+QNNN4baf9FLcasKCrx+FlttCKvyL4Pr0qwKeLuw8bG7ccRrTErSRdVrDRngalNAzMNSNWonb4BU1QEkJipGGZoebdP9TTZZ/KjD/4i1bvPI8cF+q5oFFUz2zeFrITwJ+UqwPUo9lBhH16U7aiPmCSIFsGzt0ML0cbAgTfl/zhGtfHouFkDbLZHyfzP0qnwADcY09AHq16o9sgQ5xVH+R67jiDd5snFOFVOA== 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)(376002)(136003)(396003)(39860400002)(346002)(366004)(110136005)(316002)(86362001)(83380400001)(966005)(66946007)(64756008)(6636002)(66476007)(66556008)(66446008)(33656002)(5660300002)(186003)(26005)(52536014)(76116006)(478600001)(7696005)(2906002)(8676002)(53546011)(6506007)(71200400001)(9686003)(55016002)(8936002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: eUaTilbH6zD5fhlvkcSJGG30Qk/R/DeOBrRHC6xAmtBnWGia5lY9MmxWkNquVzwpmTxzgAQh/zmcgy77M+scXYAl1kLUdKWFf+6riFcuzlFsNRcIdOv+NkPBctgIBTy4VuZQ0DweEuYrVBjJDLokQbWknM3bM8nRj9ba8QhETU7CQQ1G83hcEusRiRTYFl6ec6yNftcMGoeAchUK36UoSAIrpxa623deySc8czZ8d64nLJeWCcjYC3PatrXzXDgKY9VTp5vCPtRe9nbIJFyhymVLKij1iTDA3ZJNjU1KUwJzrAoDJ3e4cQLxU08FCYJbGFOx8K2FAVHUinxYOOEAP5RmC07fzJYs7kSDL+FW8o5PlMJpTsLv4gTDrfFjMzEFx8bh+xcRa9XQIdCPLjVPAgAQs7gd/umvCidYDlj9ujEXTqvvI+XqEc1t4gV5HI4HFyXiq61I/LEhGWFFmPuSQod2YLdrjP6OYTlGDA8WO5ZleZwIaUheiFu87juWlfc6 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: 90e3be28-20b4-4c02-9d3f-08d82737deb2 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jul 2020 14:20:18.5367 (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: aLHjspe3i150Vavjoy6lBXI3oHFqGnxwROaxyoIK4yHDMi4WOB0ngzDLn185CvDQjPZxGrUKpj8HfIq+N8Hs4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1636 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 Yuwei, please remove Change-Id. -----Original Message----- From: devel@edk2.groups.io On Behalf Of Yuwei Chen Sent: Monday, July 13, 2020 3:39 PM To: devel@edk2.groups.io Cc: Feng, Bob C ; Gao, Liming Subject: [edk2-devel] [Patch v4] BaseTools: Add Guid name support in GenFfs= . REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2762 The Fv Section in the FDF files use hard coding Guid values which is inconv= enient to manage. This patch adds Guid name support in GenFfs to solve this= problem. v4 add comments for new function without functional modification. Change-Id: I29b52663613286c6210d99eaaa09338677a21b31 Signed-off-by: Yuwei Chen Cc: Bob Feng Cc: Liming Gao --- .../Source/Python/AutoGen/WorkspaceAutoGen.py | 24 +++++++++++++++++++ Ba= seTools/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/BaseTool= s/Source/Python/AutoGen/WorkspaceAutoGen.py index 668126aaac..d2e59ca34f 100644 --- a/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/WorkspaceAutoGen.py @@ -109,6 +109,10 @@ class WorkspaceAutoGen(AutoGen): # Mark now build in AutoGen Phase # GlobalData.gAu= toGenPhase =3D True+ #+ # Collect Platform Guids to support G= uid name in Fdfparser.+ #+ self.CollectPlatformGuids() = self.ProcessModuleFromPdf() self.ProcessPcdType() self.Pr= ocessMixedPcd()@@ -153,6 +157,26 @@ class WorkspaceAutoGen(AutoGen): EdkLogger.error("build", PARAMETER_INVALID, = ExtraData=3D"Build target [%s] is not supported by the platform. = [Valid target: %s]" % (self.BuildTarg= et, " ".join(self.Platform.BuildTargets)))++ def CollectPlatformGuids(se= lf):+ oriInfList =3D []+ oriPkgSet =3D set()+ Platform= Pkg =3D set()+ for Arch in self.ArchList:+ Platform =3D s= elf.BuildDatabase[self.MetaFile, Arch, self.BuildTarget, self.ToolChain]+ = oriInfList =3D Platform.Modules+ for ModuleFile in ori= InfList:+ ModuleData =3D self.BuildDatabase[ModuleFile, Plat= form._Arch, Platform._Target, Platform._Toolchain]+ oriPkgSe= t.update(ModuleData.Packages)+ for Pkg in oriPkgSet:+ = Guids =3D Pkg.Guids+ GlobalData.gGuidDict.u= pdate(Guids)+ if Platform.Packages:+ PlatformPkg.= update(Platform.Packages)+ for Pkg in PlatformPkg:+ = Guids =3D Pkg.Guids+ GlobalData.gGuidDict.upd= ate(Guids)+ @cached_property def FdfProfile(self): if not s= elf.FdfFile:diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/Bas= eTools/Source/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 = {} # definition for a MACRO name. used to create regular expressions belo= w. _MacroNamePattern =3D "[A-Z][A-Z0-9_]*"diff --git a/BaseTools/Source/Pyt= hon/GenFds/FdfParser.py b/BaseTools/Source/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 from Common.BuildToolError import * from Common import EdkLogger-from Com= mon.Misc import PathClass, tdict, ProcessDuplicatedInf+from Common.Misc imp= ort PathClass, tdict, ProcessDuplicatedInf, GuidStructureStringToGuidString= from Common.StringUtils import NormPath, ReplaceMacro from Common import G= lobalData from Common.Expression import *@@ -1087,6 +1087,8 @@ class FdfPar= ser: return False if GlobalData.gGuidPattern.match(self._To= ken) is not None: return True+ elif self._Token in Globa= lData.gGuidDict:+ return True else: self._Un= doToken() return False@@ -2248,6 +2250,8 @@ class FdfParser: if not self._GetNextGuid(): raise Warning.Expected("G= UID value", self.FileName, self.CurrentLineNumber)+ if self._Token i= n GlobalData.gGuidDict:+ self._Token =3D GuidStructureStringToGu= idString(GlobalData.gGuidDict[self._Token]).upper() FvObj.FvNameGu= id =3D self._Token @@ -2459,6 +2463,8 @@ class FdfParser: raise Warning.ExpectedEquals(self.FileName, self.CurrentLi= neNumber) if not self._GetNextGuid(): raise War= ning.Expected("GUID value", self.FileName, self.CurrentLineNumber)+ = if self._Token in GlobalData.gGuidDict:+ self._Token =3D= GuidStructureStringToGuidString(GlobalData.gGuidDict[self._Token]).upper()= FfsInfObj.OverrideGuid =3D self._Token if self._IsKey= word("RuleOverride"):@@ -2550,6 +2556,8 @@ class FdfParser: raise Warning.Expected("')'", self.FileName, self.Curr= entLineNumber) self._Token =3D 'PCD('+PcdPair[1]+TAB_SPLIT+= PcdPair[0]+')' + if self._Token in GlobalData.gGuidDict:+ = self._Token =3D GuidStructureStringToGuidString(GlobalData.gGuidDict[self.= _Token]).upper() FfsFileObj.NameGuid =3D self._Token self.= _GetFilePart(FfsFileObj)@@ -2980,6 +2988,8 @@ class FdfParser: elif self._IsKeyword("GUIDED"): GuidValue =3D None = if self._GetNextGuid():+ if self._Token in GlobalDa= ta.gGuidDict:+ self._Token =3D GuidStructureStringToGuid= String(GlobalData.gGuidDict[self._Token]).upper() GuidValue= =3D self._Token AttribDict =3D self._GetGuidAttrib()@@ -4049,= 6 +4059,8 @@ class FdfParser: elif self._IsKeyword("GUIDED"): GuidValue =3D None = if self._GetNextGuid():+ if self._Token in GlobalDa= ta.gGuidDict:+ self._Token =3D GuidStructureStringToGuid= String(GlobalData.gGuidDict[self._Token]).upper() GuidValue= =3D self._Token if self._IsKeyword("$(NAMED_GUID)"):--=20 2.27.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62399): https://edk2.groups.io/g/devel/message/62399 Mute This Topic: https://groups.io/mt/75472556/1768742 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [bob.c.feng@intel.com] -= =3D-=3D-=3D-=3D-=3D-=3D