BaseTools: Supported FMP capsule image.
[mirror_edk2.git] / BaseTools / Source / Python / CommonDataClass / FdfClass.py
1 ## @file
2 # classes represent data in FDF
3 #
4 # Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
5 #
6 # This program and the accompanying materials
7 # are licensed and made available under the terms and conditions of the BSD License
8 # which accompanies this distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
10 #
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 #
14
15 ## FD data in FDF
16 #
17 #
18 class FDClassObject:
19 ## The constructor
20 #
21 # @param self The object pointer
22 #
23 def __init__(self):
24 self.FdUiName = ''
25 self.CreateFileName = None
26 self.BaseAddress = None
27 self.BaseAddressPcd = None
28 self.Size = None
29 self.SizePcd = None
30 self.ErasePolarity = None
31 # 3-tuple list (blockSize, numBlocks, pcd)
32 self.BlockSizeList = []
33 # DefineVarDict[var] = value
34 self.DefineVarDict = {}
35 # SetVarDict[var] = value
36 self.SetVarDict = {}
37 self.RegionList = []
38 self.vtfRawDict = {}
39
40 ## FV data in FDF
41 #
42 #
43 class FvClassObject:
44 ## The constructor
45 #
46 # @param self The object pointer
47 #
48 def __init__(self):
49 self.UiFvName = None
50 self.CreateFileName = None
51 # 3-tuple list (blockSize, numBlocks, pcd)
52 self.BlockSizeList = []
53 # DefineVarDict[var] = value
54 self.DefineVarDict = {}
55 # SetVarDict[var] = value
56 self.SetVarDict = {}
57 self.FvAlignment = None
58 # FvAttributeDict[attribute] = TRUE/FALSE (1/0)
59 self.FvAttributeDict = {}
60 self.FvNameGuid = None
61 self.AprioriSectionList = []
62 self.FfsList = []
63 self.BsBaseAddress = None
64 self.RtBaseAddress = None
65
66 ## Region data in FDF
67 #
68 #
69 class RegionClassObject:
70 ## The constructor
71 #
72 # @param self The object pointer
73 #
74 def __init__(self):
75 self.Offset = None # The begin position of the Region
76 self.Size = None # The Size of the Region
77 self.PcdOffset = None
78 self.PcdSize = None
79 self.SetVarDict = {}
80 self.RegionType = None
81 self.RegionDataList = []
82
83 ## FFS data in FDF
84 #
85 #
86 class FfsClassObject:
87 ## The constructor
88 #
89 # @param self The object pointer
90 #
91 def __init__(self):
92 self.NameGuid = None
93 self.Fixed = False
94 self.CheckSum = False
95 self.Alignment = None
96 self.SectionList = []
97
98 ## FILE statement data in FDF
99 #
100 #
101 class FileStatementClassObject (FfsClassObject) :
102 ## The constructor
103 #
104 # @param self The object pointer
105 #
106 def __init__(self):
107 FfsClassObject.__init__(self)
108 self.FvFileType = None
109 self.FileName = None
110 self.KeyStringList = []
111 self.FvName = None
112 self.FdName = None
113 self.DefineVarDict = {}
114 self.AprioriSection = None
115 self.KeepReloc = None
116
117 ## INF statement data in FDF
118 #
119 #
120 class FfsInfStatementClassObject(FfsClassObject):
121 ## The constructor
122 #
123 # @param self The object pointer
124 #
125 def __init__(self):
126 FfsClassObject.__init__(self)
127 self.Rule = None
128 self.Version = None
129 self.Ui = None
130 self.InfFileName = None
131 self.BuildNum = ''
132 self.KeyStringList = []
133 self.KeepReloc = None
134 self.UseArch = None
135
136 ## APRIORI section data in FDF
137 #
138 #
139 class AprioriSectionClassObject:
140 ## The constructor
141 #
142 # @param self The object pointer
143 #
144 def __init__(self):
145 # DefineVarDict[var] = value
146 self.DefineVarDict = {}
147 self.FfsList = []
148
149 ## section data in FDF
150 #
151 #
152 class SectionClassObject:
153 ## The constructor
154 #
155 # @param self The object pointer
156 #
157 def __init__(self):
158 self.Alignment = None
159
160 ## Depex expression section in FDF
161 #
162 #
163 class DepexSectionClassObject (SectionClassObject):
164 ## The constructor
165 #
166 # @param self The object pointer
167 #
168 def __init__(self):
169 self.DepexType = None
170 self.Expression = None
171 self.ExpressionProcessed = False
172
173 ## Compress section data in FDF
174 #
175 #
176 class CompressSectionClassObject (SectionClassObject) :
177 ## The constructor
178 #
179 # @param self The object pointer
180 #
181 def __init__(self):
182 SectionClassObject.__init__(self)
183 self.CompType = None
184 self.SectionList = []
185
186 ## Data section data in FDF
187 #
188 #
189 class DataSectionClassObject (SectionClassObject):
190 ## The constructor
191 #
192 # @param self The object pointer
193 #
194 def __init__(self):
195 SectionClassObject.__init__(self)
196 self.SecType = None
197 self.SectFileName = None
198 self.SectionList = []
199 self.KeepReloc = True
200
201 ## Rule section data in FDF
202 #
203 #
204 class EfiSectionClassObject (SectionClassObject):
205 ## The constructor
206 #
207 # @param self The object pointer
208 #
209 def __init__(self):
210 SectionClassObject.__init__(self)
211 self.SectionType = None
212 self.Optional = False
213 self.FileType = None
214 self.StringData = None
215 self.FileName = None
216 self.FileExtension = None
217 self.BuildNum = None
218 self.KeepReloc = None
219
220 ## FV image section data in FDF
221 #
222 #
223 class FvImageSectionClassObject (SectionClassObject):
224 ## The constructor
225 #
226 # @param self The object pointer
227 #
228 def __init__(self):
229 SectionClassObject.__init__(self)
230 self.Fv = None
231 self.FvName = None
232 self.FvFileType = None
233 self.FvFileName = None
234 self.FvFileExtension = None
235 self.FvAddr = None
236
237 ## GUIDed section data in FDF
238 #
239 #
240 class GuidSectionClassObject (SectionClassObject) :
241 ## The constructor
242 #
243 # @param self The object pointer
244 #
245 def __init__(self):
246 SectionClassObject.__init__(self)
247 self.NameGuid = None
248 self.SectionList = []
249 self.SectionType = None
250 self.ProcessRequired = False
251 self.AuthStatusValid = False
252 self.ExtraHeaderSize = -1
253 self.FvAddr = []
254 self.FvParentAddr = None
255 self.IncludeFvSection = False
256
257 ## UI section data in FDF
258 #
259 #
260 class UiSectionClassObject (SectionClassObject):
261 ## The constructor
262 #
263 # @param self The object pointer
264 #
265 def __init__(self):
266 SectionClassObject.__init__(self)
267 self.StringData = None
268 self.FileName = None
269
270 ## Version section data in FDF
271 #
272 #
273 class VerSectionClassObject (SectionClassObject):
274 ## The constructor
275 #
276 # @param self The object pointer
277 #
278 def __init__(self):
279 SectionClassObject.__init__(self)
280 self.BuildNum = None
281 self.StringData = None
282 self.FileName = None
283
284 ## Rule data in FDF
285 #
286 #
287 class RuleClassObject :
288 ## The constructor
289 #
290 # @param self The object pointer
291 #
292 def __init__(self):
293 self.Arch = None
294 self.ModuleType = None # For Module Type
295 self.TemplateName = None
296 self.NameGuid = None
297 self.Fixed = False
298 self.Alignment = None
299 self.SectAlignment = None
300 self.CheckSum = False
301 self.FvFileType = None # for Ffs File Type
302 self.KeyStringList = []
303 self.KeepReloc = None
304
305 ## Complex rule data in FDF
306 #
307 #
308 class RuleComplexFileClassObject(RuleClassObject) :
309 ## The constructor
310 #
311 # @param self The object pointer
312 #
313 def __init__(self):
314 RuleClassObject.__init__(self)
315 self.SectionList = []
316
317 ## Simple rule data in FDF
318 #
319 #
320 class RuleSimpleFileClassObject(RuleClassObject) :
321 ## The constructor
322 #
323 # @param self The object pointer
324 #
325 def __init__(self):
326 RuleClassObject.__init__(self)
327 self.FileName = None
328 self.SectionType = ''
329 self.FileExtension = None
330
331 ## File extension rule data in FDF
332 #
333 #
334 class RuleFileExtensionClassObject(RuleClassObject):
335 ## The constructor
336 #
337 # @param self The object pointer
338 #
339 def __init__(self):
340 RuleClassObject.__init__(self)
341 self.FileExtension = None
342
343 ## Capsule data in FDF
344 #
345 #
346 class CapsuleClassObject :
347 ## The constructor
348 #
349 # @param self The object pointer
350 #
351 def __init__(self):
352 self.SpecName = None
353 self.UiCapsuleName = None
354 self.CreateFile = None
355 self.GroupIdNumber = None
356 # DefineVarDict[var] = value
357 self.DefineVarDict = {}
358 # SetVarDict[var] = value
359 self.SetVarDict = {}
360 # TokensDict[var] = value
361 self.TokensDict = {}
362 self.CapsuleDataList = []
363 self.FmpPayloadList = []
364
365 ## VTF data in FDF
366 #
367 #
368 class VtfClassObject :
369 ## The constructor
370 #
371 # @param self The object pointer
372 #
373 def __init__(self):
374 self.KeyArch = None
375 self.ArchList = None
376 self.UiName = None
377 self.ResetBin = None
378 self.ComponentStatementList = []
379
380 ## VTF component data in FDF
381 #
382 #
383 class ComponentStatementClassObject :
384 ## The constructor
385 #
386 # @param self The object pointer
387 #
388 def __init__(self):
389 self.CompName = None
390 self.CompLoc = None
391 self.CompType = None
392 self.CompVer = None
393 self.CompCs = None
394 self.CompBin = None
395 self.CompSym = None
396 self.CompSize = None
397 self.FilePos = None
398
399 ## OptionROM data in FDF
400 #
401 #
402 class OptionRomClassObject:
403 ## The constructor
404 #
405 # @param self The object pointer
406 #
407 def __init__(self):
408 self.DriverName = None
409 self.FfsList = []
410