]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/GenFds/CapsuleData.py
4 # Copyright (c) 2007, Intel Corporation
6 # All rights reserved. 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
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.
19 from GenFdsGlobalVariable
import GenFdsGlobalVariable
22 ## base class for capsule data
28 # @param self The object pointer
32 ## generate capsule data
34 # @param self The object pointer
35 def GenCapsuleSubItem(self
):
38 ## FFS class for capsule data
41 class CapsuleFfs (CapsuleData
):
44 # @param self The object pointer
50 ## generate FFS capsule data
52 # @param self The object pointer
53 # @retval string Generated file name
55 def GenCapsuleSubItem(self
):
56 FfsFile
= self
.Ffs
.GenFfs()
59 ## FV class for capsule data
62 class CapsuleFv (CapsuleData
):
65 # @param self The object pointer
70 self
.CapsuleName
= None
72 ## generate FV capsule data
74 # @param self The object pointer
75 # @retval string Generated file name
77 def GenCapsuleSubItem(self
):
78 if self
.FvName
.find('.fv') == -1:
79 if self
.FvName
.upper() in GenFdsGlobalVariable
.FdfParser
.Profile
.FvDict
.keys():
80 FvObj
= GenFdsGlobalVariable
.FdfParser
.Profile
.FvDict
.get(self
.FvName
.upper())
81 FdBuffer
= StringIO
.StringIO('')
82 FvObj
.CapsuleName
= self
.CapsuleName
83 FvFile
= FvObj
.AddToBuffer(FdBuffer
)
84 FvObj
.CapsuleName
= None
88 FvFile
= GenFdsGlobalVariable
.ReplaceWorkspaceMacro(self
.FvName
)