diff options
author | BobCF <bob.c.feng@intel.com> | 2018-03-23 10:24:03 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2018-03-23 11:31:55 +0800 |
commit | d5bc5f1368a0f452589b1633b0586dfe557327e6 (patch) | |
tree | ed141ac37ea545e5e282346b994c309777c78854 | |
parent | c91229c9b9eaf51c01b9e547828cc9ac5049e05a (diff) | |
download | edk2-d5bc5f1368a0f452589b1633b0586dfe557327e6.tar.gz edk2-d5bc5f1368a0f452589b1633b0586dfe557327e6.tar.bz2 edk2-d5bc5f1368a0f452589b1633b0586dfe557327e6.zip |
BaseTool: Fixed the issue of empty PcdDB.
If there is no dynamic pcds, there should be DB header
in the Pcd DataBase.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
(cherry picked from commit 0a4f2d48696f094cec73e28a4402775dc6262eef)
-rw-r--r-- | BaseTools/Source/Python/AutoGen/GenPcdDb.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source/Python/AutoGen/GenPcdDb.py index e2848e7aaf..e4d7f3b759 100644 --- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py +++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py @@ -980,8 +980,6 @@ def CreatePcdDatabaseCode (Info, AutoGenC, AutoGenH): def CreatePcdDataBase(PcdDBData):
delta = {}
basedata = {}
- if not PcdDBData:
- return ""
for skuname,skuid in PcdDBData:
if len(PcdDBData[(skuname,skuid)][1]) != len(PcdDBData[("DEFAULT","0")][1]):
EdkLogger.ERROR("The size of each sku in one pcd are not same")
@@ -1061,9 +1059,12 @@ def NewCreatePcdDatabasePhaseSpecificAutoGen(Platform,Phase): AdditionalAutoGenH, AdditionalAutoGenC = CreateAutoGen(PcdDriverAutoGenData)
else:
AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer,VarCheckTab = CreatePcdDatabasePhaseSpecificAutoGen (Platform,{}, Phase)
+ final_data = ()
+ for item in PcdDbBuffer:
+ final_data += unpack("B",item)
+ PcdDBData[("DEFAULT","0")] = (PcdDbBuffer, final_data)
- PcdDbBuffer = CreatePcdDataBase(PcdDBData)
- return AdditionalAutoGenH, AdditionalAutoGenC, PcdDbBuffer
+ return AdditionalAutoGenH, AdditionalAutoGenC, CreatePcdDataBase(PcdDBData)
## Create PCD database in DXE or PEI phase
#
# @param Platform The platform object
|