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.20; helo=mga02.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 A4A8921A07A92 for ; Mon, 8 Oct 2018 20:42:49 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Oct 2018 20:42:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,359,1534834800"; d="scan'208";a="97691239" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga001.jf.intel.com with ESMTP; 08 Oct 2018 20:41:42 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Oct 2018 20:41:42 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 8 Oct 2018 20:41:41 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.111]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.183]) with mapi id 14.03.0319.002; Tue, 9 Oct 2018 11:41:40 +0800 From: "Zhu, Yonghong" To: "Chiu, Chasel" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" , "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [PATCH V2] IntelFsp2Pkg/GenCfgOpt.py: Support PCD input from command line Thread-Index: AQHUXt7yifoVXUZDgkSP81QTUMT+O6UWRilw Date: Tue, 9 Oct 2018 03:41:39 +0000 Message-ID: References: <20181008081058.10496-1-chasel.chiu@intel.com> In-Reply-To: <20181008081058.10496-1-chasel.chiu@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 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: Tue, 09 Oct 2018 03:42:49 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu =20 Best Regards, Zhu Yonghong -----Original Message----- From: Chiu, Chasel=20 Sent: Monday, October 08, 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 comma= nd line REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1231 Build system already support override PCD value by command line so add this= support to GenCfgOpt.py Also update revision to 0.53 Test: Verified UPD header files generated can reflect different PCD values from --pcd build command input 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(-) 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+(.+)", DscL= ine) 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