5 from GenFdsGlobalVariable import GenFdsGlobalVariable
\r
7 class FvImageSection(Section.Section):
\r
9 self.Aligenment = None
\r
12 def GenSection(self, OutputPath, ModuleName, KeyStringList, FfsInf = None):
\r
13 Buffer = StringIO.StringIO('')
\r
17 if self.FvName != None:
\r
18 Fv = GenFdsGlobalVariable.FdfParser.profile.FvDict.get(self.FvName)
\r
22 raise Exception("FvImageSection Failed! Can't describe the \
\r
23 FvImageSection both in FvUiName and \
\r
26 self.Fv.AddToBuffer(Buffer)
\r
28 FvFileName = OutputPath + \
\r
31 FvFile = open ( FvFileName, 'w+')
\r
32 FvFile.write(Buffer.getvalue())
\r
35 # Prepare the parameter of GenSection
\r
37 OutputFile = OutputPath + \
\r
39 Ffs.SectionSuffix.get("FV_IMAGE")
\r
41 GenSectionCmd = 'GenSec -o ' + \
\r
44 'EFI_SECTION_FIRMWARE_VOLUME_IMAGE ' + \
\r
48 GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed!")
\r
49 return OutputFile, self.Aligenment
\r