\r
if (options.filename):\r
fdfFilename = options.filename\r
+ fdfFilename = GenFdsGlobalVariable.ReplaceWorkspaceMarco(fdfFilename)\r
else:\r
GenFdsGlobalVariable.InfLogger("ERROR: E0001 - You must specify an input filename")\r
sys.exit(1)\r
\r
+ if fdfFilename[0:2] == '..':\r
+ fdfFilename = os.path.realpath(fdfFilename)\r
+ if fdfFilename[1] != ':':\r
+ fdfFilename = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, fdfFilename)\r
+ \r
if not os.path.exists(fdfFilename):\r
- GenFdsGlobalVariable.InfLogger ("ERROR: E1000: File %s not found" % (filename))\r
+ GenFdsGlobalVariable.InfLogger ("ERROR: E1000: File %s not found" % (fdfFilename))\r
sys.exit(1)\r
\r
if (options.activePlatform):\r
activePlatform = options.activePlatform\r
- activePlatform = os.path.realpath(activePlatform)\r
- \r
+ activePlatform = GenFdsGlobalVariable.ReplaceWorkspaceMarco(activePlatform)\r
+\r
+ if activePlatform[0:2] == '..':\r
+ activePlatform = os.path.realpath(activePlatform)\r
+\r
+ if activePlatform[1] != ':':\r
+ activePlatform = os.path.join(GenFdsGlobalVariable.WorkSpaceDir, activePlatform)\r
+\r
if not os.path.exists(activePlatform) :\r
raise Exception ("ActivePlatform doesn't exist!")\r
\r
\r
if (options.outputDir):\r
outputDir = options.outputDir\r
+ outputDir = GenFdsGlobalVariable.ReplaceWorkspaceMarco(outputDir)\r
else:\r
#print "ERROR: E0001 - You must specify an Output directory"\r
GenFdsGlobalVariable.InfLogger("ERROR: E0001 - You must specify an Output directory")\r
sys.exit(1)\r
+\r
+ if outputDir[0:2] == '..':\r
+ outputDir = os.path.realpath(outputDir)\r
\r
+ if outputDir[1] != ':':\r
+ outputDir = os.path.join (GenFdsGlobalVariable.WorkSpaceDir, outputDir)\r
+\r
+ if not os.path.exists(outputDir):\r
+ GenFdsGlobalVariable.InfLogger ("ERROR: E1000: Directory %s not found" % (outputDir))\r
+ sys.exit(1)\r
+\r
if (options.archList) :\r
archList = options.archList.split(',')\r
else:\r
Target = Common.TargetTxtClassObject.TargetTxtDict(GenFdsGlobalVariable.WorkSpaceDir)\r
archList = Target.TargetTxtDictionary['TARGET_ARCH']\r
+\r
+ if (options.uiFdName) :\r
+ GenFds.currentFd = options.uiFdName\r
+\r
+ if (options.uiFvName) :\r
+ GenFds.currentFv = options.uiFvName\r
\r
""" Parse Fdf file """\r
fdfParser = FdfParser.FdfParser(fdfFilename)\r
parser = OptionParser(usage=usage,description=__copyright__,version="%prog " + str(versionNumber))\r
parser.add_option("-f", "--file", dest="filename", help="Name of FDF file to convert")\r
parser.add_option("-a", "--arch", dest="archList", help="comma separated list containing one or more of: IA32, X64, IPF or EBC which should be built, overrides target.txt?s TARGET_ARCH")\r
- parser.add_option("-i", "--interactive", action="store_true", dest="interactive", default=False, help="Set Interactive mode, user must approve each change.")\r
parser.add_option("-q", "--quiet", action="store_true", type=None, help="Disable all messages except FATAL ERRORS.")\r
parser.add_option("-v", "--verbose", action="store_true", type=None, help="Turn on verbose output with informational messages printed.")\r
parser.add_option("-d", "--debug", action="store", type="int", help="Enable debug messages at specified level.")\r
parser.add_option("-p", "--platform", dest="activePlatform", help="Set the Active platform")\r
parser.add_option("-w", "--workspace", dest="workspace", default=str(os.environ.get('WORKSPACE')), help="Enable printing of debug messages.")\r
parser.add_option("-o", "--outputDir", dest="outputDir", help="Name of Output directory")\r
+ parser.add_option("-r", "--rom_image", dest="uiFdName", help="Build the image using the [FD] section named by FdUiName.")\r
+ parser.add_option("-i", "--FvImage", dest="uiFvName", help="Buld the FV image using the [FV] section named by UiFvName")\r
(options, args) = parser.parse_args()\r
return options\r
\r
class GenFds :\r
FdfParsef = None\r
FvBinDict = {} # FvName in Fdf, FvBinFile\r
+ currentFd = None\r
+ currentFv = None\r
\r
def GenFd (OutputDir, FdfParser, WorkSpace, ArchList):\r
GenFdsGlobalVariable.SetDir (OutputDir, FdfParser, WorkSpace, ArchList)\r
+ \r
"""Set Default Rule! Hard code here will be move"""\r
verSection1 = EfiSection()\r
verSection1.BuildNum = "$(BUILD_NUMBER)"\r
dataSection.Filename = "$(INF_OUTPUT)/$(MODULE_NAME).efi"\r
\r
ruleComplexFile1 = RuleComplexFile.RuleComplexFile()\r
- ruleComplexFile1.Alignment = 16\r
+ ruleComplexFile1.Alignment = 32\r
ruleComplexFile1.Arch = 'COMMON'\r
ruleComplexFile1.CheckSum = True\r
ruleComplexFile1.Fixed = True\r
GenFdsGlobalVariable.SetDefaultRule(ruleComplexFile1)\r
\r
GenFdsGlobalVariable.VerboseLogger(" Gen Fd !")\r
- for item in GenFdsGlobalVariable.FdfParser.profile.FdDict.keys():\r
- fd = GenFdsGlobalVariable.FdfParser.profile.FdDict[item]\r
- fd.GenFd(GenFds.FvBinDict)\r
+ if GenFds.currentFd != None:\r
+ fd = GenFdsGlobalVariable.FdfParser.profile.FdDict.get(GenFds.currentFd.upper())\r
+ if fd != None:\r
+ fd.GenFd(GenFds.FvBinDict)\r
+ else :\r
+ for item in GenFdsGlobalVariable.FdfParser.profile.FdDict.keys():\r
+ fd = GenFdsGlobalVariable.FdfParser.profile.FdDict[item]\r
+ fd.GenFd(GenFds.FvBinDict)\r
\r
GenFdsGlobalVariable.VerboseLogger(" Gen FV ! ")\r
- for FvName in GenFdsGlobalVariable.FdfParser.profile.FvDict.keys():\r
- if not FvName in GenFds.FvBinDict.keys():\r
+ if GenFds.currentFv != None:\r
+ fv = GenFdsGlobalVariable.FdfParser.profile.FvDict.get(GenFds.currentFv.upper())\r
+ if fv != None:\r
Buffer = StringIO.StringIO()\r
- fv = GenFdsGlobalVariable.FdfParser.profile.FvDict[FvName]\r
fv.AddToBuffer(Buffer)\r
Buffer.close()\r
+ \r
+ else:\r
+ for FvName in GenFdsGlobalVariable.FdfParser.profile.FvDict.keys():\r
+ if not FvName in GenFds.FvBinDict.keys():\r
+ Buffer = StringIO.StringIO()\r
+ fv = GenFdsGlobalVariable.FdfParser.profile.FvDict[FvName]\r
+ fv.AddToBuffer(Buffer)\r
+ Buffer.close()\r
\r
GenFdsGlobalVariable.VerboseLogger(" Gen Capsule !")\r
for capsule in GenFdsGlobalVariable.FdfParser.profile.CapsuleList:\r