From 6b17c11b6f45b4196adb8a9fcbdba5576a0d872b Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Wed, 20 Apr 2016 09:32:52 +0800 Subject: 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 Reviewed-by: Liming Gao --- BaseTools/Source/Python/GenFds/FfsInfStatement.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'BaseTools/Source/Python/GenFds/FfsInfStatement.py') 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.
+# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
# Copyright (c) 2014-2016 Hewlett-Packard Development Company, L.P.
# # 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*": -- cgit v1.2.3