# @param FvParentAddr Parent Fv base address\r
# @retval string Generated FFS file name\r
#\r
- def GenFfs(self, Dict = {}, FvChildAddr=[], FvParentAddr=None, IsMakefile=False):\r
+ def GenFfs(self, Dict = {}, FvChildAddr=[], FvParentAddr=None, IsMakefile=False, FvName=None):\r
\r
- if self.NameGuid != None and self.NameGuid.startswith('PCD('):\r
+ if self.NameGuid is not None and self.NameGuid.startswith('PCD('):\r
PcdValue = GenFdsGlobalVariable.GetPcdValue(self.NameGuid)\r
if len(PcdValue) == 0:\r
EdkLogger.error("GenFds", GENFDS_ERROR, '%s NOT defined.' \\r
% (self.NameGuid))\r
self.NameGuid = RegistryGuidStr\r
\r
- OutputDir = os.path.join(GenFdsGlobalVariable.FfsDir, self.NameGuid)\r
+ Str = self.NameGuid\r
+ if FvName:\r
+ Str += FvName\r
+ OutputDir = os.path.join(GenFdsGlobalVariable.FfsDir, Str)\r
if not os.path.exists(OutputDir):\r
os.makedirs(OutputDir)\r
\r
Dict.update(self.DefineVarDict)\r
SectionAlignments = None\r
- if self.FvName != None :\r
+ if self.FvName is not None :\r
Buffer = StringIO.StringIO('')\r
if self.FvName.upper() not in GenFdsGlobalVariable.FdfParser.Profile.FvDict.keys():\r
EdkLogger.error("GenFds", GENFDS_ERROR, "FV (%s) is NOT described in FDF file!" % (self.FvName))\r
FileName = Fv.AddToBuffer(Buffer)\r
SectionFiles = [FileName]\r
\r
- elif self.FdName != None:\r
+ elif self.FdName is not None:\r
if self.FdName.upper() not in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():\r
EdkLogger.error("GenFds", GENFDS_ERROR, "FD (%s) is NOT described in FDF file!" % (self.FdName))\r
Fd = GenFdsGlobalVariable.FdfParser.Profile.FdDict.get(self.FdName.upper())\r
FileName = Fd.GenFd()\r
SectionFiles = [FileName]\r
\r
- elif self.FileName != None:\r
+ elif self.FileName is not None:\r
if hasattr(self, 'FvFileType') and self.FvFileType == 'RAW':\r
if isinstance(self.FileName, list) and isinstance(self.SubAlignment, list) and len(self.FileName) == len(self.SubAlignment):\r
FileContent = ''\r
Content = f.read()\r
f.close()\r
AlignValue = 1\r
- if self.SubAlignment[Index] != None:\r
+ if self.SubAlignment[Index] is not None:\r
AlignValue = GenFdsGlobalVariable.GetAlignment(self.SubAlignment[Index])\r
if AlignValue > MaxAlignValue:\r
MaxAlignIndex = Index\r
section.FvAddr = FvChildAddr.pop(0)\r
elif isinstance(section, GuidSection):\r
section.FvAddr = FvChildAddr\r
- if FvParentAddr != None and isinstance(section, GuidSection):\r
+ if FvParentAddr is not None and isinstance(section, GuidSection):\r
section.FvParentAddr = FvParentAddr\r
\r
if self.KeepReloc == False:\r