From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=jiewen.yao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 4DA9C21164C74 for ; Tue, 9 Oct 2018 23:15:41 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2018 23:15:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,363,1534834800"; d="scan'208";a="81350255" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga006.jf.intel.com with ESMTP; 09 Oct 2018 23:15:24 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 9 Oct 2018 23:15:24 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.217]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.245]) with mapi id 14.03.0319.002; Wed, 10 Oct 2018 14:15:22 +0800 From: "Yao, Jiewen" To: "Chiu, Chasel" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [PATCH V2] IntelFsp2Pkg/GenCfgOpt.py: Support PCD input from command line Thread-Index: AQHUXt7ygzYHaEXXwEemnNJcnCsG8qUYA2/Q Date: Wed, 10 Oct 2018 06:15:21 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503ADDB379@shsmsx102.ccr.corp.intel.com> References: <20181008081058.10496-1-chasel.chiu@intel.com> In-Reply-To: <20181008081058.10496-1-chasel.chiu@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjYyOWIyYjUtNGFjYi00YmZhLWJmYTQtNWNjNGQ3NjVmOTFiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZFNBUCtvT3N1WG9EZ1VYN0tTaU5OSXdCMjU5Wnl3WGpzblNQdDFMYVpRdWNcL3ZZdDczdmhQUEpIWTVUeXJ6K1IifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH V2] IntelFsp2Pkg/GenCfgOpt.py: Support PCD input from command line X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2018 06:15:41 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: Chiu, Chasel > Sent: Monday, October 8, 2018 4:11 PM > To: edk2-devel@lists.01.org > Cc: Yao, Jiewen ; Gao, Liming > ; Zhu, Yonghong ; Chiu, > Chasel > Subject: [PATCH V2] IntelFsp2Pkg/GenCfgOpt.py: Support PCD input from > command line >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1231 >=20 > Build system already support override PCD value by command > line so add this support to GenCfgOpt.py > Also update revision to 0.53 >=20 > Test: Verified UPD header files generated can reflect different > PCD values from --pcd build command input >=20 > Cc: Jiewen Yao > Cc: Gao Liming > Cc: Zhu Yonghong > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Chasel Chiu > --- > IntelFsp2Pkg/Tools/GenCfgOpt.py | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) >=20 > diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py > b/IntelFsp2Pkg/Tools/GenCfgOpt.py > index 059cfcb7e4..15d33582ef 100644 > --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py > +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py > @@ -88,6 +88,8 @@ are permitted provided that the following conditions > are met: > **/ > """ >=20 > +BuildOptionPcd =3D [] > + > class CLogicalExpression: > def __init__(self): > self.index =3D 0 > @@ -561,6 +563,12 @@ EndList > self._PcdsDict[Match.group(1)] =3D Match.group(2) > if self.Debug: > print "INFO : PCD %s =3D [ %s ]" % > (Match.group(1), Match.group(2)) > + i =3D 0 > + while i < len(BuildOptionPcd): > + Match =3D re.match("\s*([\w\.]+)\s*\=3D\s*(\w+)"= , > BuildOptionPcd[i]) > + if Match: > + self._PcdsDict[Match.group(1)] =3D > Match.group(2) > + i +=3D 1 > else: > Match =3D re.match("^\s*#\s+(!BSF|@Bsf|!HDR)\s+(.+)", > DscLine) > if Match: > @@ -1462,7 +1470,7 @@ EndList >=20 >=20 > def Usage(): > - print "GenCfgOpt Version 0.52" > + print "GenCfgOpt Version 0.53" > print "Usage:" > print " GenCfgOpt UPDTXT PlatformDscFile BuildFvDir > [-D Macros]" > print " GenCfgOpt HEADER PlatformDscFile BuildFvDir > InputHFile [-D Macros]" > @@ -1472,7 +1480,14 @@ def Main(): > # > # Parse the options and args > # > + i =3D 1 > + > GenCfgOpt =3D CGenCfgOpt() > + while i < len(sys.argv): > + if sys.argv[i].strip().lower() =3D=3D "--pcd": > + BuildOptionPcd.append(sys.argv[i+1]) > + i +=3D 1 > + i +=3D 1 > argc =3D len(sys.argv) > if argc < 4: > Usage() > -- > 2.13.3.windows.1