diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-04-20 09:32:52 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-04-20 09:32:52 +0800 |
commit | 6b17c11b6f45b4196adb8a9fcbdba5576a0d872b (patch) | |
tree | 720ed5a1415d62bfb39be77463037adcffffd9a5 /BaseTools/Source/Python/GenFds/FfsInfStatement.py | |
parent | 2a29017e3e305a10ee1003354c0d0c037923341d (diff) | |
download | edk2-platforms-6b17c11b6f45b4196adb8a9fcbdba5576a0d872b.tar.xz |
BaseTools: add the support for --pcd feature to patch the binary efi
the original --pcd feature can override the Pcd value when build the
source driver, while it missed the binary driver. this patch add the
support to patch the binary efi for --pcd feature.
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/GenFds/FfsInfStatement.py')
-rw-r--r-- | BaseTools/Source/Python/GenFds/FfsInfStatement.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatement.py index 3c59f14aa8..bba42c7308 100644 --- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py @@ -1,7 +1,7 @@ ## @file
# process FFS generation from INF statement
#
-# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2014-2016 Hewlett-Packard Development Company, L.P.<BR>
#
# This program and the accompanying materials
@@ -43,6 +43,7 @@ from AutoGen.GenDepex import DependencyExpression from PatchPcdValue.PatchPcdValue import PatchBinaryFile
from Common.LongFilePathSupport import CopyLongFilePath
from Common.LongFilePathSupport import OpenLongFilePath as open
+import Common.GlobalData as GlobalData
## generate FFS from INF
#
@@ -260,7 +261,16 @@ class FfsInfStatement(FfsInfStatementClassObject): DefaultValue = FdfPcdDict[PcdKey]
FdfOverride = True
- if not DscOverride and not FdfOverride:
+ # Override Patchable PCD value by the value from Build Option
+ BuildOptionOverride = False
+ if GlobalData.BuildOptionPcd:
+ for pcd in GlobalData.BuildOptionPcd:
+ if PcdKey == (pcd[1], pcd[0]):
+ DefaultValue = pcd[2]
+ BuildOptionOverride = True
+ break
+
+ if not DscOverride and not FdfOverride and not BuildOptionOverride:
continue
# Check value, if value are equal, no need to patch
if Pcd.DatumType == "VOID*":
|