]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/Python/CommonDataClass/PlatformClass.py
Fix a bug in secure boot configuration driver: Enroll DB/KEK will disable Attempt...
[mirror_edk2.git] / BaseTools / Source / Python / CommonDataClass / PlatformClass.py
CommitLineData
30fdf114
LG
1## @file\r
2# This file is used to define a class object to describe a platform\r
3#\r
40d841f6
LG
4# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
5# This program and the accompanying materials\r
30fdf114
LG
6# are licensed and made available under the terms and conditions of the BSD License\r
7# which accompanies this distribution. The full text of the license may be found at\r
8# http://opensource.org/licenses/bsd-license.php\r
9#\r
10# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13##\r
14# Import Modules\r
15#\r
16from CommonClass import *\r
17\r
18## SkuInfoListClass\r
19#\r
20# This class defined sku info list item used in platform file\r
21# \r
22# @param IncludeStatementClass: Inherited from IncludeStatementClass class\r
23#\r
24# @var SkuInfoList: To store value for SkuInfoList, it is a set structure as\r
25# { SkuName : SkuId }\r
26#\r
27class SkuInfoListClass(IncludeStatementClass):\r
28 def __init__(self):\r
29 IncludeStatementClass.__init__(self)\r
30 self.SkuInfoList = {}\r
31\r
32## PlatformHeaderClass\r
33#\r
34# This class defined header items used in Platform file\r
35# \r
36# @param IdentificationClass: Inherited from IdentificationClass class\r
37# @param CommonHeaderClass: Inherited from CommonHeaderClass class\r
38# @param DefineClass: Inherited from DefineClass class\r
39#\r
40# @var DscSpecification: To store value for DscSpecification\r
41# @var SupArchList: To store value for SupArchList, selection scope is in below list\r
42# EBC | IA32 | X64 | IPF | ARM | PPC\r
43# @var BuildTargets: To store value for BuildTargets, selection scope is in below list\r
44# RELEASE | DEBUG\r
45# @var IntermediateDirectories: To store value for IntermediateDirectories, selection scope is in below list\r
46# MODULE | UNIFIED\r
47# @var OutputDirectory: To store value for OutputDirectory\r
48# @var ForceDebugTarget: To store value for ForceDebugTarget\r
49# @var SkuIdName: To store value for SkuIdName\r
50# @var BuildNumber: To store value for BuildNumber\r
51# @var MakefileName: To store value for MakefileName\r
52# @var ClonedFrom: To store value for ClonedFrom, it is a list structure as\r
53# [ ClonedRecordClass, ... ]\r
54#\r
55class PlatformHeaderClass(IdentificationClass, CommonHeaderClass, DefineClass):\r
56 def __init__(self):\r
57 IdentificationClass.__init__(self)\r
58 CommonHeaderClass.__init__(self)\r
59 DefineClass.__init__(self)\r
60 self.DscSpecification = ''\r
61 self.SupArchList = []\r
62 self.BuildTargets = []\r
63 self.IntermediateDirectories = ''\r
64 self.OutputDirectory = '' \r
65 self.ForceDebugTarget = ''\r
66 self.SkuIdName = []\r
67 self.BuildNumber = ''\r
68 self.MakefileName = ''\r
69 self.ClonedFrom = []\r
70\r
71## PlatformFlashDefinitionFileClass\r
72#\r
73# This class defined FlashDefinitionFile item used in platform file\r
74# \r
75# @param object: Inherited from object class\r
76#\r
77# @var Id: To store value for Id\r
78# @var UiName: To store value for UiName\r
79# @var Preferred: To store value for Preferred\r
80# @var FilePath: To store value for FilePath\r
81#\r
82class PlatformFlashDefinitionFileClass(object):\r
83 def __init__(self):\r
84 self.Id = ''\r
85 self.UiName = ''\r
86 self.Preferred = False\r
87 self.FilePath = ''\r
88\r
89## PlatformFvImageOptionClass\r
90#\r
91# This class defined FvImageOption item used in platform file\r
92# \r
93# @param object: Inherited from object class\r
94#\r
95# @var FvImageOptionName: To store value for FvImageOptionName\r
96# @var FvImageOptionValues: To store value for FvImageOptionValues\r
97#\r
98class PlatformFvImageOptionClass(object):\r
99 def __init__(self):\r
100 self.FvImageOptionName = ''\r
101 self.FvImageOptionValues = []\r
102\r
103## PlatformFvImageClass\r
104#\r
105# This class defined FvImage item used in platform file\r
106# \r
107# @param object: Inherited from object class\r
108#\r
109# @var Name: To store value for Name\r
110# @var Value: To store value for Value\r
111# @var Type: To store value for Type, selection scope is in below list\r
112# Attributes | Options | Components | ImageName \r
113# @var FvImageNames: To store value for FvImageNames\r
114# @var FvImageOptions: To store value for FvImageOptions, it is a list structure as\r
115# [ PlatformFvImageOption, ...]\r
116#\r
117class PlatformFvImageClass(object):\r
118 def __init__(self):\r
119 self.Name = ''\r
120 self.Value = ''\r
121 self.Type = ''\r
122 self.FvImageNames = []\r
123 self.FvImageOptions = []\r
124\r
125## PlatformFvImageNameClass\r
126#\r
127# This class defined FvImageName item used in platform file\r
128# \r
129# @param object: Inherited from object class\r
130#\r
131# @var Name: To store value for Name\r
132# @var Type: To store value for Type, selection scope is in below list\r
133# FV_MAIN | FV_MAIN_COMPACT | NV_STORAGE | FV_RECOVERY | FV_RECOVERY_FLOPPY | FV_FILE | CAPSULE_CARGO | NULL | USER_DEFINED \r
134# @var FvImageOptions: To store value for FvImageOptions, it is a list structure as\r
135# [ PlatformFvImageOption, ...]\r
136#\r
137class PlatformFvImageNameClass(object):\r
138 def __init__(self):\r
139 self.Name = ''\r
140 self.Type = ''\r
141 self.FvImageOptions = []\r
142\r
143## PlatformFvImagesClass\r
144#\r
145# This class defined FvImages item used in platform file\r
146# \r
147# @param object: Inherited from object class\r
148#\r
149# @var FvImages: To store value for FvImages\r
150#\r
151class PlatformFvImagesClass(object):\r
152 def __init__(self):\r
153 self.FvImages = []\r
154\r
155## PlatformAntTaskClass\r
156#\r
157# This class defined AntTask item used in platform file\r
158# \r
159# @param object: Inherited from object class\r
160#\r
161# @var Id: To store value for Id\r
162# @var AntCmdOptions: To store value for AntCmdOptions\r
163# @var FilePath: To store value for FilePath\r
164#\r
165class PlatformAntTaskClass(object):\r
166 def __init__(self):\r
167 self.Id = ''\r
168 self.AntCmdOptions = ''\r
169 self.FilePath = ''\r
170\r
171## PlatformFfsSectionClass\r
172#\r
173# This class defined FfsSection item used in platform file\r
174# \r
175# @param CommonClass: Inherited from CommonClass class\r
176#\r
177# @var BindingOrder: To store value for BindingOrder\r
178# @var Compressible: To store value for Compressible\r
179# @var SectionType: To store value for SectionType\r
180# @var EncapsulationType: To store value for EncapsulationType\r
181# @var ToolName: To store value for ToolName\r
182# @var Filenames: To store value for Filenames\r
183# @var Args: To store value for Args\r
184# @var OutFile: To store value for OutFile\r
185# @var OutputFileExtension: To store value for OutputFileExtension\r
186# @var ToolNameElement: To store value for ToolNameElement\r
187#\r
188class PlatformFfsSectionClass(CommonClass):\r
189 def __init__(self):\r
190 CommonClass.__init__(self)\r
191 self.BindingOrder = ''\r
192 self.Compressible = ''\r
193 self.SectionType = ''\r
194 self.EncapsulationType = ''\r
195 self.ToolName = ''\r
196 self.Filenames = []\r
197 self.Args = ''\r
198 self.OutFile = ''\r
199 self.OutputFileExtension = ''\r
200 self.ToolNameElement = ''\r
201\r
202## PlatformFfsSectionsClass\r
203#\r
204# This class defined FfsSections item used in platform file\r
205# \r
206# @param CommonClass: Inherited from CommonClass class\r
207#\r
208# @var BindingOrder: To store value for BindingOrder\r
209# @var Compressible: To store value for Compressible\r
210# @var SectionType: To store value for SectionType\r
211# @var EncapsulationType: To store value for EncapsulationType\r
212# @var ToolName: To store value for ToolName\r
213# @var Section: To store value for Section, it is a list structure as\r
214# [ PlatformFfsSectionClass, ... ]\r
215# @var Sections: To store value for Sections, it is a list structure as\r
216# [ PlatformFfsSectionsClass, ...]\r
217#\r
218class PlatformFfsSectionsClass(CommonClass):\r
219 def __init__(self):\r
220 CommonClass.__init__(self)\r
221 self.BindingOrder = ''\r
222 self.Compressible = ''\r
223 self.SectionType = ''\r
224 self.EncapsulationType = ''\r
225 self.ToolName = ''\r
226 self.Section = []\r
227 self.Sections = []\r
228\r
229## PlatformFfsClass\r
230#\r
231# This class defined Ffs item used in platform file\r
232# \r
233# @param object: Inherited from object class\r
234#\r
235# @var Attribute: To store value for Attribute, it is a set structure as\r
236# { [(Name, PlatformFfsSectionsClass)] : Value}\r
237# @var Sections: To store value for Sections, it is a list structure as\r
238# [ PlatformFfsSectionsClass]\r
239# @var ToolName: To store value for ToolName\r
240#\r
241class PlatformFfsClass(object):\r
242 def __init__(self):\r
243 self.Attribute = {}\r
244 self.Sections = []\r
245 self.Key = ''\r
246\r
247## PlatformBuildOptionClass\r
248#\r
249# This class defined BuildOption item used in platform file\r
250# \r
251# @param object: Inherited from object class\r
252#\r
253# @var UserDefinedAntTasks: To store value for UserDefinedAntTasks, it is a set structure as\r
254# { [Id] : PlatformAntTaskClass, ...}\r
255# @var Options: To store value for Options, it is a list structure as\r
256# [ BuildOptionClass, ...]\r
257# @var UserExtensions: To store value for UserExtensions, it is a set structure as\r
258# { [(UserID, Identifier)] : UserExtensionsClass, ...}\r
259# @var FfsKeyList: To store value for FfsKeyList, it is a set structure as\r
260# { [FfsKey]: PlatformFfsClass, ...} \r
261#\r
262class PlatformBuildOptionClass(object):\r
263 def __init__(self):\r
264 self.UserDefinedAntTasks = {}\r
265 self.Options = []\r
266 self.UserExtensions = {}\r
267 self.FfsKeyList = {}\r
268\r
269## PlatformBuildOptionClasses\r
270#\r
271# This class defined BuildOption item list used in platform file\r
272# \r
273# @param IncludeStatementClass: Inherited from IncludeStatementClass class\r
274#\r
275# @var FvBinding: To store value for FvBinding\r
276# @var FfsFileNameGuid: To store value for FfsFileNameGuid\r
277# @var FfsFormatKey: To store value for FfsFormatKey\r
278# @var BuildOptionList: To store value for BuildOptionList, it is a list structure as\r
279# [ BuildOptionClass, ... ]\r
280#\r
281class PlatformBuildOptionClasses(IncludeStatementClass):\r
282 def __init__(self):\r
283 IncludeStatementClass.__init__(self)\r
284 self.FvBinding = ''\r
285 self.FfsFileNameGuid = ''\r
286 self.FfsFormatKey = ''\r
287 self.BuildOptionList = []\r
288\r
289## PlatformLibraryClass\r
290#\r
291# This class defined Library item used in platform file\r
292# \r
293# @param CommonClass: Inherited from CommonClass class\r
294# @param DefineClass: Inherited from DefineClass class\r
295# @param Name: Input value for Name, default is ''\r
296# @param FilePath: Input value for FilePath, default is ''\r
297#\r
298# @var Name: To store value for Name\r
299# @var FilePath: To store value for FilePath\r
300# @var ModuleType: To store value for ModuleType\r
301# @var SupModuleList: To store value for SupModuleList\r
302# @var ModuleGuid: To store value for ModuleGuid\r
303# @var ModuleVersion: To store value for ModuleVersion\r
304# @var PackageGuid: To store value for PackageGuid\r
305# @var PackageVersion: To store value for PackageVersion\r
306#\r
307class PlatformLibraryClass(CommonClass, DefineClass):\r
308 def __init__(self, Name = '', FilePath = ''):\r
309 CommonClass.__init__(self)\r
310 DefineClass.__init__(self)\r
311 self.Name = Name\r
312 self.FilePath = FilePath\r
313 self.ModuleType = []\r
314 self.SupModuleList = []\r
315 self.ModuleGuid = ''\r
316 self.ModuleVersion = ''\r
317 self.PackageGuid = ''\r
318 self.PackageVersion = ''\r
319\r
320## PlatformLibraryClasses\r
321#\r
322# This class defined Library item list used in platform file\r
323# \r
324# @param IncludeStatementClass: Inherited from IncludeStatementClass class\r
325#\r
326# @var LibraryList: To store value for LibraryList, it is a list structure as\r
327# [ PlatformLibraryClass, ... ]\r
328#\r
329class PlatformLibraryClasses(IncludeStatementClass):\r
330 def __init__(self):\r
331 IncludeStatementClass.__init__(self)\r
332 self.LibraryList = []\r
333\r
334## PlatformModuleClass\r
335#\r
336# This class defined Module item used in platform file\r
337# \r
338# @param CommonClass: Inherited from CommonClass class\r
339# @param DefineClass: Inherited from DefineClass class\r
340# @param IncludeStatementClass: Inherited from IncludeStatementClass class\r
341#\r
342# @var Name: To store value for Name (Library name or libraryclass name or module name)\r
343# @var FilePath: To store value for FilePath\r
344# @var Type: To store value for Type, selection scope is in below list\r
345# LIBRARY | LIBRARY_CLASS | MODULE\r
346# @var ModuleType: To store value for ModuleType\r
347# @var ExecFilePath: To store value for ExecFilePath\r
348# @var LibraryClasses: To store value for LibraryClasses, it is a structure as\r
349# PlatformLibraryClasses\r
350# @var PcdBuildDefinitions: To store value for PcdBuildDefinitions, it is a list structure as\r
351# [ PcdClass, ...]\r
352# @var ModuleSaBuildOption: To store value for ModuleSaBuildOption, it is a structure as\r
353# PlatformBuildOptionClasses\r
354# @var Specifications: To store value for Specifications, it is a list structure as\r
355# [ '', '', ...]\r
356#\r
357class PlatformModuleClass(CommonClass, DefineClass, IncludeStatementClass):\r
358 def __init__(self):\r
359 CommonClass.__init__(self)\r
360 DefineClass.__init__(self)\r
361 self.Name = ''\r
362 self.FilePath = ''\r
363 self.Type = ''\r
364 self.ModuleType = ''\r
365 self.ExecFilePath = ''\r
366 self.LibraryClasses = PlatformLibraryClasses()\r
367 self.PcdBuildDefinitions = []\r
368 self.ModuleSaBuildOption = PlatformBuildOptionClasses()\r
369 self.Specifications = []\r
370 self.SourceOverridePath = ''\r
371\r
372## PlatformModuleClasses\r
373#\r
374# This class defined Module item list used in platform file\r
375# \r
376# @param IncludeStatementClass: Inherited from IncludeStatementClass class\r
377#\r
378# @var ModuleList: To store value for ModuleList, it is a list structure as\r
379# [ PlatformModuleClass, ... ]\r
380#\r
381class PlatformModuleClasses(IncludeStatementClass):\r
382 def __init__(self):\r
383 IncludeStatementClass.__init__(self)\r
384 self.ModuleList = []\r
385\r
386## PlatformClass\r
387#\r
388# This class defined a complete platform item\r
389# \r
390# @param object: Inherited from object class\r
391#\r
392# @var Header: To store value for Header, it is a structure as\r
393# {Arch : PlatformHeaderClass()}\r
394# @var SkuInfos: To store value for SkuInfos, it is a structure as\r
395# SkuInfoListClass\r
396# @var Libraries: To store value for Libraries, it is a structure as\r
397# PlatformLibraryClasses\r
398# @var LibraryClasses: To store value for LibraryClasses, it is a structure as\r
399# PlatformLibraryClasses\r
400# @var Modules: To store value for Modules, it is a structure as\r
401# PlatformModuleClasses\r
402# @var FlashDefinitionFile: To store value for FlashDefinitionFile, it is a structure as\r
403# PlatformFlashDefinitionFileClass\r
404# @var BuildOptions: To store value for BuildOptions, it is a structure as\r
405# PlatformBuildOptionClasses\r
406# @var DynamicPcdBuildDefinitions: To store value for DynamicPcdBuildDefinitions, it is a list structure as\r
407# [ PcdClass, ...]\r
408# @var Fdf: To store value for Fdf, it is a list structure as\r
409# [ FdfClass, ...]\r
410# @var UserExtensions: To store value for UserExtensions, it is a list structure as\r
411# [ UserExtensionsClass, ...]\r
412#\r
413class PlatformClass(object):\r
414 def __init__(self):\r
415 self.Header = {}\r
416 self.SkuInfos = SkuInfoListClass()\r
417 self.Libraries = PlatformLibraryClasses()\r
418 self.LibraryClasses = PlatformLibraryClasses()\r
419 self.Modules = PlatformModuleClasses()\r
420 self.FlashDefinitionFile = PlatformFlashDefinitionFileClass()\r
421 self.BuildOptions = PlatformBuildOptionClasses()\r
422 self.DynamicPcdBuildDefinitions = []\r
423 self.Fdf = []\r
424 self.UserExtensions = []\r
425\r
426##\r
427#\r
428# This acts like the main() function for the script, unless it is 'import'ed into another\r
429# script.\r
430#\r
431if __name__ == '__main__':\r
432 P = PlatformClass()\r