]>
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
49 ## generate FFS capsule data
51 # @param self The object pointer
52 # @retval string Generated file name
54 def GenCapsuleSubItem(self
):
55 FfsFile
= self
.Ffs
.GenFfs()
58 ## FV class for capsule data
61 class CapsuleFv (CapsuleData
):
64 # @param self The object pointer
69 ## generate FV capsule data
71 # @param self The object pointer
72 # @retval string Generated file name
74 def GenCapsuleSubItem(self
):
75 if self
.FvName
.find('.fv') == -1:
76 if self
.FvName
.upper() in GenFdsGlobalVariable
.FdfParser
.Profile
.FvDict
.keys():
77 FvObj
= GenFdsGlobalVariable
.FdfParser
.Profile
.FvDict
.get(self
.FvName
.upper())
78 FdBuffer
= StringIO
.StringIO('')
79 FvFile
= FvObj
.AddToBuffer(FdBuffer
)
83 FvFile
= GenFdsGlobalVariable
.ReplaceWorkspaceMacro(self
.FvName
)