diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2017-12-29 01:40:54 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2017-12-29 11:07:50 +0800 |
commit | a743986df89b60ae49e970cdb81fac4575e87342 (patch) | |
tree | 1f0a7230e435d103596f72118b95c4d114ab63cf /BaseTools/Source/Python/GenFds | |
parent | f0e60d266166d834c9905b7d44de510cf4e8f3ea (diff) | |
download | edk2-a743986df89b60ae49e970cdb81fac4575e87342.tar.gz edk2-a743986df89b60ae49e970cdb81fac4575e87342.tar.bz2 edk2-a743986df89b60ae49e970cdb81fac4575e87342.zip |
BaseTools: Fix a bug for different FV use same FILE statement Guid
We meet a case that different FV use same FILE statement Guid, but the
FILE content is different. current we use the Guid value as Ffs file
dir which cause the ffs file will be override. This patch use Guid
value and Fv name as ffs dir for FILE statement.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/GenFds')
-rw-r--r-- | BaseTools/Source/Python/GenFds/FfsFileStatement.py | 7 | ||||
-rw-r--r-- | BaseTools/Source/Python/GenFds/FfsInfStatement.py | 2 | ||||
-rw-r--r-- | BaseTools/Source/Python/GenFds/Fv.py | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/GenFds/FfsFileStatement.py b/BaseTools/Source/Python/GenFds/FfsFileStatement.py index edb131266d..12ec95b565 100644 --- a/BaseTools/Source/Python/GenFds/FfsFileStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsFileStatement.py @@ -57,7 +57,7 @@ class FileStatement (FileStatementClassObject) : # @param FvParentAddr Parent Fv base address
# @retval string Generated FFS file name
#
- def GenFfs(self, Dict = {}, FvChildAddr=[], FvParentAddr=None, IsMakefile=False):
+ def GenFfs(self, Dict = {}, FvChildAddr=[], FvParentAddr=None, IsMakefile=False, FvName=None):
if self.NameGuid != None and self.NameGuid.startswith('PCD('):
PcdValue = GenFdsGlobalVariable.GetPcdValue(self.NameGuid)
@@ -72,7 +72,10 @@ class FileStatement (FileStatementClassObject) : % (self.NameGuid))
self.NameGuid = RegistryGuidStr
- OutputDir = os.path.join(GenFdsGlobalVariable.FfsDir, self.NameGuid)
+ Str = self.NameGuid
+ if FvName:
+ Str += FvName
+ OutputDir = os.path.join(GenFdsGlobalVariable.FfsDir, Str)
if not os.path.exists(OutputDir):
os.makedirs(OutputDir)
diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatement.py index 4b4781755d..baee543698 100644 --- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py @@ -422,7 +422,7 @@ class FfsInfStatement(FfsInfStatementClassObject): # @param FvParentAddr Parent Fv base address
# @retval string Generated FFS file name
#
- def GenFfs(self, Dict = {}, FvChildAddr = [], FvParentAddr=None, IsMakefile=False):
+ def GenFfs(self, Dict = {}, FvChildAddr = [], FvParentAddr=None, IsMakefile=False, FvName=None):
#
# Parse Inf file get Module related information
#
diff --git a/BaseTools/Source/Python/GenFds/Fv.py b/BaseTools/Source/Python/GenFds/Fv.py index d5922c040c..a69abb300c 100644 --- a/BaseTools/Source/Python/GenFds/Fv.py +++ b/BaseTools/Source/Python/GenFds/Fv.py @@ -121,7 +121,7 @@ class FV (FvClassObject): continue
if GenFdsGlobalVariable.EnableGenfdsMultiThread and GenFdsGlobalVariable.ModuleFile and GenFdsGlobalVariable.ModuleFile.Path.find(os.path.normpath(FfsFile.InfFileName)) == -1:
continue
- FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress, IsMakefile=Flag)
+ FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress, IsMakefile=Flag, FvName=self.UiFvName)
FfsFileList.append(FileName)
if not Flag:
self.FvInfFile.writelines("EFI_FILE_NAME = " + \
|