## @file\r
# process VTF generation\r
#\r
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# Import Modules\r
#\r
from GenFdsGlobalVariable import GenFdsGlobalVariable\r
-import os\r
+import Common.LongFilePathOs as os\r
from CommonDataClass.FdfClass import VtfClassObject\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
T_CHAR_LF = '\n'\r
\r
## generate VTF\r
def GenBsfInf (self):\r
FvList = self.GetFvList()\r
self.BsfInfName = os.path.join(GenFdsGlobalVariable.FvDir, self.UiName + '.inf')\r
- BsfInf = open (self.BsfInfName, 'w+')\r
+ BsfInf = open(self.BsfInfName, 'w+')\r
+ if self.ResetBin != None:\r
+ BsfInf.writelines ("[OPTIONS]" + T_CHAR_LF)\r
+ BsfInf.writelines ("IA32_RST_BIN" + \\r
+ " = " + \\r
+ GenFdsGlobalVariable.MacroExtend(GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.ResetBin)) + \\r
+ T_CHAR_LF)\r
+ BsfInf.writelines (T_CHAR_LF)\r
+\r
BsfInf.writelines ("[COMPONENTS]" + T_CHAR_LF)\r
\r
for ComponentObj in self.ComponentStatementList :\r
- BsfInf.writelines ("COMP_NAME" + \\r
- " = " + \\r
+ BsfInf.writelines ("COMP_NAME" + \\r
+ " = " + \\r
ComponentObj.CompName + \\r
- T_CHAR_LF )\r
+ T_CHAR_LF)\r
if ComponentObj.CompLoc.upper() == 'NONE':\r
- BsfInf.writelines ("COMP_LOC" + \\r
- " = " + \\r
- 'N' + \\r
- T_CHAR_LF )\r
- \r
+ BsfInf.writelines ("COMP_LOC" + \\r
+ " = " + \\r
+ 'N' + \\r
+ T_CHAR_LF)\r
+\r
elif ComponentObj.FilePos != None:\r
- BsfInf.writelines ("COMP_LOC" + \\r
- " = " + \\r
+ BsfInf.writelines ("COMP_LOC" + \\r
+ " = " + \\r
ComponentObj.FilePos + \\r
- T_CHAR_LF )\r
+ T_CHAR_LF)\r
else:\r
Index = FvList.index(ComponentObj.CompLoc.upper())\r
if Index == 0:\r
- BsfInf.writelines ("COMP_LOC" + \\r
- " = " + \\r
- 'F' + \\r
- T_CHAR_LF )\r
+ BsfInf.writelines ("COMP_LOC" + \\r
+ " = " + \\r
+ 'F' + \\r
+ T_CHAR_LF)\r
elif Index == 1:\r
- BsfInf.writelines ("COMP_LOC" + \\r
- " = " + \\r
- 'S' + \\r
- T_CHAR_LF )\r
- \r
- BsfInf.writelines ("COMP_TYPE" + \\r
- " = " + \\r
+ BsfInf.writelines ("COMP_LOC" + \\r
+ " = " + \\r
+ 'S' + \\r
+ T_CHAR_LF)\r
+\r
+ BsfInf.writelines ("COMP_TYPE" + \\r
+ " = " + \\r
ComponentObj.CompType + \\r
- T_CHAR_LF )\r
- BsfInf.writelines ("COMP_VER" + \\r
- " = " + \\r
+ T_CHAR_LF)\r
+ BsfInf.writelines ("COMP_VER" + \\r
+ " = " + \\r
ComponentObj.CompVer + \\r
- T_CHAR_LF )\r
- BsfInf.writelines ("COMP_CS" + \\r
- " = " + \\r
+ T_CHAR_LF)\r
+ BsfInf.writelines ("COMP_CS" + \\r
+ " = " + \\r
ComponentObj.CompCs + \\r
- T_CHAR_LF )\r
- \r
+ T_CHAR_LF)\r
+\r
BinPath = ComponentObj.CompBin\r
if BinPath != '-':\r
BinPath = GenFdsGlobalVariable.MacroExtend(GenFdsGlobalVariable.ReplaceWorkspaceMacro(BinPath))\r
- BsfInf.writelines ("COMP_BIN" + \\r
- " = " + \\r
+ BsfInf.writelines ("COMP_BIN" + \\r
+ " = " + \\r
BinPath + \\r
- T_CHAR_LF )\r
- \r
+ T_CHAR_LF)\r
+\r
SymPath = ComponentObj.CompSym\r
if SymPath != '-':\r
SymPath = GenFdsGlobalVariable.MacroExtend(GenFdsGlobalVariable.ReplaceWorkspaceMacro(SymPath))\r
- BsfInf.writelines ("COMP_SYM" + \\r
- " = " + \\r
+ BsfInf.writelines ("COMP_SYM" + \\r
+ " = " + \\r
SymPath + \\r
- T_CHAR_LF )\r
- BsfInf.writelines ("COMP_SIZE" + \\r
- " = " + \\r
+ T_CHAR_LF)\r
+ BsfInf.writelines ("COMP_SIZE" + \\r
+ " = " + \\r
ComponentObj.CompSize + \\r
- T_CHAR_LF )\r
- BsfInf.writelines (T_CHAR_LF )\r
- \r
+ T_CHAR_LF)\r
+ BsfInf.writelines (T_CHAR_LF)\r
+\r
BsfInf.close()\r
\r
## GenFvList() method\r
(BaseAddress, Size) = FdAddressDict.get(i)\r
CmdStr += (\r
'-r', '0x%x' % BaseAddress,\r
- '-s', '0x%x' %Size,\r
+ '-s', '0x%x' % Size,\r
)\r
return CmdStr\r
\r