## @file\r
# process OptionROM generation\r
#\r
-# Copyright (c) 2007, Intel Corporation\r
+# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
#\r
-# All rights reserved. This program and the accompanying materials\r
+# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
# http://opensource.org/licenses/bsd-license.php\r
##\r
# Import Modules\r
#\r
-import os\r
-import shutil\r
+import Common.LongFilePathOs as os\r
import subprocess\r
import StringIO\r
\r
# @param Buffer The buffer generated OptROM data will be put\r
# @retval string Generated OptROM file path\r
#\r
- def AddToBuffer (self, Buffer) :\r
-\r
- GenFdsGlobalVariable.InfLogger( "\nGenerating %s Option ROM ..." %self.DriverName)\r
+ def AddToBuffer (self, Buffer, Flag=False) :\r
+ if not Flag:\r
+ GenFdsGlobalVariable.InfLogger( "\nGenerating %s Option ROM ..." %self.DriverName)\r
\r
EfiFileList = []\r
BinFileList = []\r
for FfsFile in self.FfsList :\r
\r
if isinstance(FfsFile, OptRomInfStatement.OptRomInfStatement):\r
- FilePathNameList = FfsFile.GenFfs()\r
+ FilePathNameList = FfsFile.GenFfs(IsMakefile=Flag)\r
if len(FilePathNameList) == 0:\r
EdkLogger.error("GenFds", GENFDS_ERROR, "Module %s not produce .efi files, so NO file could be put into option ROM." % (FfsFile.InfFileName))\r
- if FfsFile.OverrideAttribs == None:\r
+ if FfsFile.OverrideAttribs is None:\r
EfiFileList.extend(FilePathNameList)\r
else:\r
FileName = os.path.basename(FilePathNameList[0])\r
- TmpOutputDir = os.path.join(GenFdsGlobalVariable.FvDir, self.DriverName)\r
+ TmpOutputDir = os.path.join(GenFdsGlobalVariable.FvDir, self.DriverName, FfsFile.CurrentArch)\r
if not os.path.exists(TmpOutputDir) :\r
os.makedirs(TmpOutputDir)\r
TmpOutputFile = os.path.join(TmpOutputDir, FileName+'.tmp')\r
FfsFile.OverrideAttribs.PciClassCode, \r
FfsFile.OverrideAttribs.PciRevision, \r
FfsFile.OverrideAttribs.PciDeviceId, \r
- FfsFile.OverrideAttribs.PciVendorId)\r
+ FfsFile.OverrideAttribs.PciVendorId,\r
+ IsMakefile = Flag)\r
BinFileList.append(TmpOutputFile)\r
else:\r
- FilePathName = FfsFile.GenFfs()\r
- if FfsFile.OverrideAttribs != None:\r
+ FilePathName = FfsFile.GenFfs(IsMakefile=Flag)\r
+ if FfsFile.OverrideAttribs is not None:\r
FileName = os.path.basename(FilePathName)\r
- TmpOutputDir = os.path.join(GenFdsGlobalVariable.FvDir, self.DriverName)\r
+ TmpOutputDir = os.path.join(GenFdsGlobalVariable.FvDir, self.DriverName, FfsFile.CurrentArch)\r
if not os.path.exists(TmpOutputDir) :\r
os.makedirs(TmpOutputDir)\r
TmpOutputFile = os.path.join(TmpOutputDir, FileName+'.tmp')\r
FfsFile.OverrideAttribs.PciClassCode, \r
FfsFile.OverrideAttribs.PciRevision, \r
FfsFile.OverrideAttribs.PciDeviceId, \r
- FfsFile.OverrideAttribs.PciVendorId)\r
+ FfsFile.OverrideAttribs.PciVendorId,\r
+ IsMakefile=Flag)\r
BinFileList.append(TmpOutputFile)\r
else:\r
if FfsFile.FileType == 'EFI':\r
GenFdsGlobalVariable.GenerateOptionRom(\r
OutputFile,\r
EfiFileList,\r
- BinFileList\r
- )\r
+ BinFileList,\r
+ IsMakefile=Flag)\r
\r
- GenFdsGlobalVariable.InfLogger( "\nGenerate %s Option ROM Successfully" %self.DriverName)\r
+ if not Flag:\r
+ GenFdsGlobalVariable.InfLogger( "\nGenerate %s Option ROM Successfully" %self.DriverName)\r
GenFdsGlobalVariable.SharpCounter = 0\r
\r
return OutputFile\r