diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-02-25 16:13:31 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-03-16 10:35:52 +0800 |
commit | 763e8edf610b2ccf422986c81ee36b4733560cdb (patch) | |
tree | a573ad5457838675c3ff681cdf2fdf39d458de66 /BaseTools/Source/Python/AutoGen/GenPcdDb.py | |
parent | db27e9f3d8f007bf26bcb8907ecab5b5f1fb8f24 (diff) | |
download | edk2-platforms-763e8edf610b2ccf422986c81ee36b4733560cdb.tar.xz |
BaseTools: add new command line option to support override PCD value
this patch add new feature to support override PCD value on the command
line. The value from the command line is the highest priority.
1.Add option(--pcd) to support both PcdName and TokenSpaceGuild.PcdName
2.For void* type PCD, use following format:
cstring PCD: --pcd PcdName="string"
unicodestring PCD: --pcd PcdName=L"string"
CArray PCD: --pcd PcdName=B"{0x1, 0x2}"
3.Build Report, use *B to show the PCD value was overridden in the
command line.
4.Error Condition:
Report error if the PCD is not found
Report error if the PcdName is found under multiple different TokenSpaceGuid
Report error if PCD value syntax is incorrect
Report error if void* type PCD value exceed its max size
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/GenPcdDb.py')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/GenPcdDb.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source/Python/AutoGen/GenPcdDb.py index 23865254d7..76d1254e72 100644 --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py @@ -1,7 +1,7 @@ ## @file
# Routines for generating Pcd Database
#
-# Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -1141,6 +1141,12 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase): CName = Pcd.TokenCName
TokenSpaceGuidCName = Pcd.TokenSpaceGuidCName
+ if GlobalData.BuildOptionPcd:
+ for PcdItem in GlobalData.BuildOptionPcd:
+ if (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) == (PcdItem[0], PcdItem[1]):
+ Pcd.DefaultValue = PcdItem[2]
+ break
+
EdkLogger.debug(EdkLogger.DEBUG_3, "PCD: %s %s (%s : %s)" % (CName, TokenSpaceGuidCName, Pcd.Phase, Phase))
if Pcd.Phase == 'PEI':
@@ -1455,6 +1461,11 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase): TokenSpaceGuidCName = Pcd.TokenSpaceGuidCName
if Pcd.Phase != Phase:
continue
+ if GlobalData.BuildOptionPcd:
+ for PcdItem in GlobalData.BuildOptionPcd:
+ if (Pcd.TokenSpaceGuidCName, Pcd.TokenCName) == (PcdItem[0], PcdItem[1]):
+ Pcd.DefaultValue = PcdItem[2]
+ break
TokenSpaceGuid = GuidStructureStringToGuidValueName(Pcd.TokenSpaceGuidValue) #(Platform.PackageList, TokenSpaceGuidCName))
GeneratedTokenNumber = Platform.PcdTokenNumber[CName, TokenSpaceGuidCName] - 1
|