5 from GenFdsGlobalVariable import GenFdsGlobalVariable
\r
6 from CommonDataClass.FdfClassObject import VerSectionClassObject
\r
8 class VerSection (VerSectionClassObject):
\r
10 ## self.Alignment = None
\r
11 ## self.BuildNum = None
\r
12 ## self.StringData = None
\r
13 ## self.FileName = None
\r
14 VerSectionClassObject.__init__(self)
\r
16 def GenSection(self,OutputPath, ModuleName, KeyStringList, FfsInf = None):
\r
18 # Prepare the parameter of GenSection
\r
21 self.Alignment = FfsInf.__ExtendMarco__(self.Alignment)
\r
22 self.BuildNum = FfsInf.__ExtendMarco__(self.BuildNum)
\r
23 self.StringData = FfsInf.__ExtendMarco__(self.StringData)
\r
24 self.FileName = FfsInf.__ExtendMarco__(self.FileName)
\r
26 OutputFile = os.path.join(OutputPath,
\r
27 ModuleName+Ffs.SectionSuffix.get('VERSION'))
\r
28 OutputFile = os.path.normpath(OutputFile)
\r
30 """Get Build Num """
\r
32 if not (self.BuildNum == None) :
\r
33 BuildNum = ' -j ' + '%d' %self.BuildNum;
\r
35 """Get String Data"""
\r
37 if self.StringData != None:
\r
38 StringData = self.StringData
\r
39 elif self.FileName != None:
\r
40 f = open (self.FileName, 'r')
\r
41 StringData = f.read()
\r
46 GenSectionCmd = 'GenSec -o ' + \
\r
48 ' -s EFI_SECTION_VERSION ' + \
\r
59 GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "Gensection Failed!")
\r
60 return OutputFile, self.Alignment
\r