diff options
author | Chasel, Chiu <chasel.chiu@intel.com> | 2018-10-08 15:44:45 +0800 |
---|---|---|
committer | Chasel, Chiu <chasel.chiu@intel.com> | 2018-10-11 07:54:08 +0800 |
commit | b9c055f72b9dbc9cef3a65b9a4932ad6e4f403e0 (patch) | |
tree | 7416af843b244f6f11bfe921ac4f235feaa8e9a0 /IntelFsp2Pkg | |
parent | 1a3bee20820c9f68a235a31ccc92db1f299266c9 (diff) | |
download | edk2-b9c055f72b9dbc9cef3a65b9a4932ad6e4f403e0.tar.gz edk2-b9c055f72b9dbc9cef3a65b9a4932ad6e4f403e0.tar.bz2 edk2-b9c055f72b9dbc9cef3a65b9a4932ad6e4f403e0.zip |
IntelFsp2Pkg/GenCfgOpt.py: Support PCD input from command line
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1231
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 <Jiewen.yao@intel.com>
Cc: Gao Liming <liming.gao@intel.com>
Cc: Zhu Yonghong <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed-by: Zhu Yonghong <yonghong.zhu@intel.com>
Diffstat (limited to 'IntelFsp2Pkg')
-rw-r--r-- | IntelFsp2Pkg/Tools/GenCfgOpt.py | 17 |
1 files changed, 16 insertions, 1 deletions
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: **/
"""
+BuildOptionPcd = []
+
class CLogicalExpression:
def __init__(self):
self.index = 0
@@ -561,6 +563,12 @@ EndList self._PcdsDict[Match.group(1)] = Match.group(2)
if self.Debug:
print "INFO : PCD %s = [ %s ]" % (Match.group(1), Match.group(2))
+ i = 0
+ while i < len(BuildOptionPcd):
+ Match = re.match("\s*([\w\.]+)\s*\=\s*(\w+)", BuildOptionPcd[i])
+ if Match:
+ self._PcdsDict[Match.group(1)] = Match.group(2)
+ i += 1
else:
Match = re.match("^\s*#\s+(!BSF|@Bsf|!HDR)\s+(.+)", DscLine)
if Match:
@@ -1462,7 +1470,7 @@ EndList 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 = 1
+
GenCfgOpt = CGenCfgOpt()
+ while i < len(sys.argv):
+ if sys.argv[i].strip().lower() == "--pcd":
+ BuildOptionPcd.append(sys.argv[i+1])
+ i += 1
+ i += 1
argc = len(sys.argv)
if argc < 4:
Usage()
|