modified BaseTools/Source/Python/GenFds/AprioriSection.py
authorjljusten <jljusten@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 14 Dec 2007 00:41:39 +0000 (00:41 +0000)
committerjljusten <jljusten@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 14 Dec 2007 00:41:39 +0000 (00:41 +0000)
modified   BaseTools/Source/Python/GenFds/Capsule.py
modified   BaseTools/Source/Python/GenFds/CompressSection.py
modified   BaseTools/Source/Python/GenFds/DataSection.py
modified   BaseTools/Source/Python/GenFds/EfiSection.py
modified   BaseTools/Source/Python/GenFds/FfsFileStatement.py
modified   BaseTools/Source/Python/GenFds/FfsInfStatement.py
modified   BaseTools/Source/Python/GenFds/Fv.py
modified   BaseTools/Source/Python/GenFds/FvImageSection.py
modified   BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
modified   BaseTools/Source/Python/GenFds/GuidSection.py
modified   BaseTools/Source/Python/GenFds/UiSection.py
modified   BaseTools/Source/Python/GenFds/VerSection.py
modified   BaseTools/Source/Python/GenFds/Vtf.py
  Similar to change in r858.
  Changes for python on unix-like systems.  On these systems
  subprocess.Popen requires a tuple to send parameters to
  the command.

git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@924 7335b38e-4728-0410-8992-fb3ffe349368

14 files changed:
Source/Python/GenFds/AprioriSection.py
Source/Python/GenFds/Capsule.py
Source/Python/GenFds/CompressSection.py
Source/Python/GenFds/DataSection.py
Source/Python/GenFds/EfiSection.py
Source/Python/GenFds/FfsFileStatement.py
Source/Python/GenFds/FfsInfStatement.py
Source/Python/GenFds/Fv.py
Source/Python/GenFds/FvImageSection.py
Source/Python/GenFds/GenFdsGlobalVariable.py
Source/Python/GenFds/GuidSection.py
Source/Python/GenFds/UiSection.py
Source/Python/GenFds/VerSection.py
Source/Python/GenFds/Vtf.py

index 03b6a7f..7d58d8a 100755 (executable)
@@ -114,19 +114,22 @@ class AprioriSection (AprioriSectionClassObject):
         RawSectionFileName = os.path.join( OutputAprFilePath, \\r
                                        AprioriFileGuid + FvName + '.raw' )\r
         \r
-        GenSectionCmd = 'GenSec -o '                                     + \\r
-                         RawSectionFileName                              + \\r
-                         ' -s EFI_SECTION_RAW '                          + \\r
-                         OutputAprFileName\r
+        GenSectionCmd = (\r
+            'GenSec',\r
+            '-o', RawSectionFileName,\r
+            '-s', 'EFI_SECTION_RAW',\r
+            OutputAprFileName,\r
+            )\r
         \r
         GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed!")\r
         \r
-        GenFfsCmd = 'GenFfs -t EFI_FV_FILETYPE_FREEFORM -g '         + \\r
-                     AprioriFileGuid                                            + \\r
-                     ' -o '                                          + \\r
-                     AprFfsFileName                                  + \\r
-                     ' -i ' + RawSectionFileName\r
-        \r
+        GenFfsCmd = (\r
+            'GenFfs',\r
+            '-t', 'EFI_FV_FILETYPE_FREEFORM',\r
+            '-g', AprioriFileGuid,\r
+            '-o', AprFfsFileName,\r
+            '-i', RawSectionFileName,\r
+            )\r
         \r
         GenFdsGlobalVariable.CallExternalTool(GenFfsCmd,"GenFfs Failed !")\r
         return AprFfsFileName\r
index 3fc7d92..5383db3 100755 (executable)
@@ -56,11 +56,12 @@ class Capsule (CapsuleClassObject) :
         #\r
         CapOutputFile = os.path.join(GenFdsGlobalVariable.FvDir, self.UiCapsuleName)\r
         CapOutputFile = CapOutputFile + '.Cap'\r
-        Cmd = 'GenFv -i '          + \\r
-               self.CapInfFileName + \\r
-               ' -o '              + \\r
-               CapOutputFile       + \\r
-               ' -c '\r
+        Cmd = (\r
+            'GenFv',\r
+            '-i', self.CapInfFileName,\r
+            '-o', CapOutputFile,\r
+            '-c',\r
+            )\r
         GenFdsGlobalVariable.CallExternalTool(Cmd, "GefFv GenCapsule Failed!")\r
         GenFdsGlobalVariable.SharpCounter = 0\r
 \r
index e9bd947..7e2cbaf 100755 (executable)
@@ -29,8 +29,8 @@ class CompressSection (CompressSectionClassObject) :
     \r
     ## compress types: PI standard and non PI standard    \r
     CompTypeDict = {\r
-        'PI_STD'     : ' -c PI_STD ',\r
-        'NON_PI_STD' : ' -c NON_PI_STD '\r
+        'PI_STD'     : 'PI_STD',\r
+        'NON_PI_STD' : 'NON_PI_STD'\r
     }\r
     \r
     ## The constructor\r
@@ -59,7 +59,7 @@ class CompressSection (CompressSectionClassObject) :
             self.CompType = FfsInf.__ExtendMacro__(self.CompType)\r
             self.Alignment = FfsInf.__ExtendMacro__(self.Alignment)\r
             \r
-        SectFiles = ''\r
+        SectFiles = tuple()\r
         Index = 0\r
         for Sect in self.SectionList:\r
             Index = Index + 1\r
@@ -67,9 +67,7 @@ class CompressSection (CompressSectionClassObject) :
             ReturnSectList, AlignValue = Sect.GenSection(OutputPath, ModuleName, SecIndex, KeyStringList, FfsInf, Dict)\r
             if ReturnSectList != []:\r
                 for FileData in ReturnSectList:\r
-                   SectFiles = SectFiles + \\r
-                               ' '       + \\r
-                               FileData\r
+                   SectFiles += (FileData,)\r
                         \r
 \r
         OutputFile = OutputPath + \\r
@@ -80,12 +78,12 @@ class CompressSection (CompressSectionClassObject) :
                      Ffs.SectionSuffix['COMPRESS']\r
         OutputFile = os.path.normpath(OutputFile)\r
         \r
-        GenSectionCmd = 'GenSec -o '                                  + \\r
-                         OutputFile                                   + \\r
-                         ' -s '                                       + \\r
-                         Section.Section.SectionType['COMPRESS']      + \\r
-                         self.CompTypeDict[self.CompType]             + \\r
-                         SectFiles\r
+        GenSectionCmd = (\r
+            'GenSec',\r
+             '-o', OutputFile,\r
+             '-s', Section.Section.SectionType['COMPRESS'],\r
+             '-c', self.CompTypeDict[self.CompType],\r
+            ) + SectFiles\r
         #\r
         # Call GenSection\r
         #\r
index 3832396..8f5b4dd 100644 (file)
@@ -84,33 +84,35 @@ class DataSection (DataSectionClassObject):
             FileBeforeStrip = os.path.join(OutputPath, ModuleName + '.efi')\r
             shutil.copyfile(self.SectFileName, FileBeforeStrip)\r
             StrippedFile = os.path.join(OutputPath, ModuleName + '.stripped')\r
-            StripCmd = 'GenFw -l '    + \\r
-                       ' -o '         + \\r
-                        StrippedFile        + \\r
-                        ' '           + \\r
-                        GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)\r
+            StripCmd = (\r
+                'GenFw',\r
+                '-l',\r
+                '-o', StrippedFile,\r
+                GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict),\r
+                )\r
             GenFdsGlobalVariable.CallExternalTool(StripCmd, "Strip Failed !")\r
             self.SectFileName = StrippedFile\r
         \r
         if self.SecType == 'TE':\r
             TeFile = os.path.join( OutputPath, ModuleName + 'Te.raw')\r
-            GenTeCmd = 'GenFW -t '    + \\r
-                       ' -o '         + \\r
-                        TeFile        + \\r
-                        ' '           + \\r
-                       GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict)\r
+            GenTeCmd = (\r
+                'GenFw',\r
+                '-t',\r
+                '-o', TeFile,\r
+                GenFdsGlobalVariable.MacroExtend(self.SectFileName, Dict),\r
+                )\r
             GenFdsGlobalVariable.CallExternalTool(GenTeCmd, "GenFw Failed !")\r
             self.SectFileName = TeFile    \r
                  \r
         OutputFile = os.path.join (OutputPath, ModuleName + 'SEC' + SecNum + Ffs.SectionSuffix.get(self.SecType))\r
         OutputFile = os.path.normpath(OutputFile)\r
-        \r
-        GenSectionCmd = 'GenSec -o '                                     + \\r
-                         OutputFile                                      + \\r
-                         ' -s '                                          + \\r
-                         Section.Section.SectionType.get (self.SecType)  + \\r
-                         ' '                                             + \\r
-                         self.SectFileName\r
+\r
+        GenSectionCmd = (\r
+            'GenSec',\r
+             '-o', OutputFile,\r
+             '-s', Section.Section.SectionType.get (self.SecType),\r
+             self.SectFileName,\r
+            )\r
                          \r
         #\r
         # Call GenSection\r
index ac9097c..50d1b95 100644 (file)
@@ -94,23 +94,19 @@ class EfiSection (EfiSectionClassObject):
                 InfOverrideVerString = True\r
             \r
             if InfOverrideVerString:\r
-                VerString = ' -n '          + \\r
-                                '\"'            + \\r
-                                StringData      + \\r
-                                '\"'\r
+                VerTuple = ('-n', '"' + StringData + '"')\r
                 if BuildNum != None and BuildNum != '':\r
-                        BuildNumString = ' -j ' + \\r
-                                         BuildNum\r
+                    BuildNumTuple = ('-j', BuildNum)\r
                 else:\r
-                    BuildNumString = ''\r
-                    \r
+                    BuildNumTuple = tuple()\r
+\r
                 Num = SecNum\r
                 OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + str(Num) + Ffs.SectionSuffix.get(SectionType))\r
-                GenSectionCmd = 'GenSec -o '                + \\r
-                                     OutputFile                 + \\r
-                                     ' -s EFI_SECTION_VERSION'  + \\r
-                                     VerString                  + \\r
-                                     BuildNumString\r
+                GenSectionCmd = (\r
+                    'GenSec',\r
+                    '-o', OutputFile,\r
+                    '-s', 'EFI_SECTION_VERSION',\r
+                    ) + VerTuple + BuildNumTuple\r
                 GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed !")\r
                 OutputFileList.append(OutputFile)    \r
                 \r
@@ -118,39 +114,34 @@ class EfiSection (EfiSectionClassObject):
                 for File in FileList:\r
                     Index = Index + 1\r
                     Num = '%s.%d' %(SecNum , Index)\r
-                    OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + Num + Ffs.SectionSuffix.get(SectionType))\r
-                    f = open (File, 'r')\r
+                    OutputFile = os.path.join(OutputPath, ModuleName + 'SEC' + Num + Ffs.SectionSuffix.get(SectionType))\r
+                    f = open(File, 'r')\r
                     VerString = f.read()\r
-                    VerString = ' -n '          + \\r
-                                ' \"'           + \\r
-                                VerString       + \\r
-                                ' \"'\r
+                    f.close()\r
+                    VerTuple = ('-n', '"' + VerString + '"')\r
                     if BuildNum != None and BuildNum != '':\r
-                        BuildNumString = ' -j ' + \\r
-                                         BuildNum\r
-                    GenSectionCmd = 'GenSec -o '                + \\r
-                                     OutputFile                 + \\r
-                                     ' -s EFI_SECTION_VERSION'  + \\r
-                                     VerString                  + \\r
-                                     BuildNumString\r
+                        BuildNumTuple = ('-j', BuildNum)\r
+                    GenSectionCmd = (\r
+                        'GenSec',\r
+                        '-o', OutputFile,\r
+                        '-s', 'EFI_SECTION_VERSION',\r
+                        ) + VerTuple + BuildNumTuple\r
                     GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed !")\r
                     OutputFileList.append(OutputFile)\r
                     \r
             else:\r
                 if StringData != None and len(StringData) > 0:\r
-                    VerString = ' -n '          + \\r
-                                '\"'            + \\r
-                                StringData      + \\r
-                                '\"'\r
+                    VerTuple = ('-n', '"' + StringData + '"')\r
                 else:\r
-                    VerString = ''\r
+                    VerTuple = tuple()\r
+                VerString = ' ' + ' '.join(VerTuple)\r
 \r
                 if BuildNum != None and BuildNum != '':\r
-                        BuildNumString = ' -j ' + \\r
-                                         BuildNum\r
+                    BuildNumTuple = ('-j', BuildNum)\r
                 else:\r
-                    BuildNumString = ''\r
-                    \r
+                    BuildNumTuple = tuple()\r
+                BuildNumString = ' ' + ' '.join(BuildNumTuple)\r
+\r
                 if VerString == '' and BuildNumString == '':\r
                     if self.Optional == True :\r
                         GenFdsGlobalVariable.VerboseLogger( "Optional Section don't exist!")\r
@@ -159,11 +150,11 @@ class EfiSection (EfiSectionClassObject):
                         raise Exception ("File: %s miss Version Section value" %InfFileName)\r
                 Num = SecNum\r
                 OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + str(Num) + Ffs.SectionSuffix.get(SectionType))\r
-                GenSectionCmd = 'GenSec -o '                + \\r
-                                     OutputFile                 + \\r
-                                     ' -s EFI_SECTION_VERSION'  + \\r
-                                     VerString                  + \\r
-                                     BuildNumString\r
+                GenSectionCmd = (\r
+                    'GenSec',\r
+                    '-o', OutputFile,\r
+                    '-s', 'EFI_SECTION_VERSION',\r
+                    ) + VerTuple + BuildNumTuple\r
                 GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed !")\r
                 OutputFileList.append(OutputFile)\r
 \r
@@ -178,16 +169,14 @@ class EfiSection (EfiSectionClassObject):
                 InfOverrideUiString = True\r
             \r
             if InfOverrideUiString:\r
-                UiString = ' -n '        + \\r
-                               '\"'          + \\r
-                               StringData    + \\r
-                               '\"'\r
                 Num = SecNum\r
                 OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + str(Num) + Ffs.SectionSuffix.get(SectionType))\r
-                GenSectionCmd = 'GenSec -o '                       + \\r
-                                 OutputFile                        + \\r
-                                 ' -s EFI_SECTION_USER_INTERFACE'  + \\r
-                                 UiString\r
+                GenSectionCmd = (\r
+                    'GenSec',\r
+                    '-o', OutputFile,\r
+                    '-s', 'EFI_SECTION_USER_INTERFACE',\r
+                    '-n', '"' + StringData + '"',\r
+                    )\r
 \r
                 GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed !")\r
                 OutputFileList.append(OutputFile)\r
@@ -196,41 +185,38 @@ class EfiSection (EfiSectionClassObject):
                 for File in FileList:\r
                     Index = Index + 1\r
                     Num = '%s.%d' %(SecNum , Index)\r
-                    OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + Num + Ffs.SectionSuffix.get(SectionType))\r
-                    f = open (File, 'r')\r
+                    OutputFile = os.path.join(OutputPath, ModuleName + 'SEC' + Num + Ffs.SectionSuffix.get(SectionType))\r
+                    f = open(File, 'r')\r
                     UiString = f.read()\r
-                    UiString = ' -n '         + \\r
-                                '\"'          + \\r
-                                UiString      + \\r
-                                '\"'\r
-                    GenSectionCmd = 'GenSec -o '                       + \\r
-                                 OutputFile                        + \\r
-                                 ' -s EFI_SECTION_USER_INTERFACE'  + \\r
-                                 UiString\r
+                    f.close()\r
+                    GenSectionCmd = (\r
+                        'GenSec',\r
+                        '-o', OutputFile,\r
+                        '-s', 'EFI_SECTION_USER_INTERFACE',\r
+                        '-n', '"' + UiString + '"',\r
+                        )\r
                                  \r
                     GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed !")\r
                     OutputFileList.append(OutputFile)\r
             else:\r
                 if StringData != None and len(StringData) > 0:\r
-                    UiString = ' -n '        + \\r
-                               '\"'          + \\r
-                               StringData    + \\r
-                               '\"'\r
+                    UiTuple = ('-n', '"' + StringData + '"')\r
                 else:\r
-                    UiString = ''\r
+                    UiTuple = tuple()\r
 \r
-                if UiString == '':\r
                     if self.Optional == True :\r
                         GenFdsGlobalVariable.VerboseLogger( "Optional Section don't exist!")\r
                         return '', None\r
                     else:\r
                         raise Exception ("File: %s miss UI Section value" %InfFileName)\r
+\r
                 Num = SecNum\r
                 OutputFile = os.path.join( OutputPath, ModuleName + 'SEC' + str(Num) + Ffs.SectionSuffix.get(SectionType))\r
-                GenSectionCmd = 'GenSec -o '                       + \\r
-                                 OutputFile                        + \\r
-                                 ' -s EFI_SECTION_USER_INTERFACE'  + \\r
-                                 UiString\r
+                GenSectionCmd = (\r
+                    'GenSec',\r
+                    '-o', OutputFile,\r
+                    '-s', 'EFI_SECTION_USER_INTERFACE',\r
+                    ) + UiTuple\r
 \r
                 GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed !")\r
                 OutputFileList.append(OutputFile)\r
@@ -263,32 +249,34 @@ class EfiSection (EfiSectionClassObject):
                         FileBeforeStrip = os.path.join(OutputPath, ModuleName + '.efi')\r
                         shutil.copyfile(File, FileBeforeStrip)\r
                         StrippedFile = os.path.join(OutputPath, ModuleName + '.stripped')\r
-                        StripCmd = 'GenFw -l '    + \\r
-                                   ' -o '         + \\r
-                                    StrippedFile        + \\r
-                                    ' '           + \\r
-                                    GenFdsGlobalVariable.MacroExtend(File, Dict)\r
+                        StripCmd = (\r
+                            'GenFw',\r
+                            '-l',\r
+                            '-o', StrippedFile,\r
+                            GenFdsGlobalVariable.MacroExtend(File, Dict),\r
+                            )\r
                         GenFdsGlobalVariable.CallExternalTool(StripCmd, "Strip Failed !")\r
                         File = StrippedFile\r
                     """For TE Section call GenFw to generate TE image"""\r
 \r
                     if SectionType == 'TE':\r
                         TeFile = os.path.join( OutputPath, ModuleName + 'Te.raw')\r
-                        GenTeCmd = 'GenFw -t '    + \\r
-                                   ' -o '         + \\r
-                                    TeFile        + \\r
-                                    ' '           + \\r
-                                   GenFdsGlobalVariable.MacroExtend(File, Dict)\r
+                        GenTeCmd = (\r
+                            'GenFw',\r
+                            '-t',\r
+                            '-o', TeFile,\r
+                            GenFdsGlobalVariable.MacroExtend(File, Dict),\r
+                            )\r
                         GenFdsGlobalVariable.CallExternalTool(GenTeCmd, "GenFw Failed !")\r
                         File = TeFile\r
 \r
                     """Call GenSection"""\r
-                    GenSectionCmd = 'GenSec -o '                                         + \\r
-                                         OutputFile                                      + \\r
-                                         ' -s '                                          + \\r
-                                         Section.Section.SectionType.get (SectionType)   + \\r
-                                         ' '                                             + \\r
-                                         GenFdsGlobalVariable.MacroExtend(File)\r
+                    GenSectionCmd = (\r
+                        'GenSec',\r
+                        '-o', OutputFile,\r
+                        '-s', Section.Section.SectionType.get (SectionType),\r
+                        GenFdsGlobalVariable.MacroExtend(File)\r
+                        )\r
                         \r
                     GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed !")\r
                     OutputFileList.append(OutputFile)\r
index 5b417fb..16e6ea7 100755 (executable)
@@ -55,7 +55,7 @@ class FileStatement (FileStatementClassObject) :
                 raise Exception ("FV (%s) is NOT described in FDF file!" % (self.FvName))\r
             Fv = GenFdsGlobalVariable.FdfParser.Profile.FvDict.get(self.FvName.upper())\r
             FileName = Fv.AddToBuffer(Buffer)\r
-            SectionFiles = ' -i ' + FileName\r
+            SectionFiles = ('-i', FileName)\r
             \r
         elif self.FdName != None:\r
             if self.FdName.upper() not in GenFdsGlobalVariable.FdfParser.Profile.FdDict.keys():\r
@@ -63,14 +63,14 @@ class FileStatement (FileStatementClassObject) :
             Fd = GenFdsGlobalVariable.FdfParser.Profile.FdDict.get(self.FdName.upper())\r
             FvBin = {}\r
             FileName = Fd.GenFd(FvBin)\r
-            SectionFiles = ' -i ' + FileName\r
+            SectionFiles = ('-i', FileName)\r
         \r
         elif self.FileName != None:\r
             self.FileName = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FileName)\r
-            SectionFiles = ' -i ' + GenFdsGlobalVariable.MacroExtend(self.FileName, Dict)\r
+            SectionFiles = ('-i', GenFdsGlobalVariable.MacroExtend(self.FileName, Dict))\r
             \r
         else:\r
-            SectionFiles = ''\r
+            SectionFiles = tuple()\r
             Index = 0\r
             for section in self.SectionList :\r
                 Index = Index + 1\r
@@ -78,50 +78,34 @@ class FileStatement (FileStatementClassObject) :
                 sectList, align = section.GenSection(OutputDir, self.NameGuid, SecIndex, self.KeyStringList, None, Dict)\r
                 if sectList != []:\r
                     for sect in sectList:\r
-                        SectionFiles = SectionFiles  + \\r
-                                       ' -i '        + \\r
-                                       sect\r
+                        SectionFiles += ('-i', sect)\r
                         if align != None:\r
-                            SectionFiles = SectionFiles  + \\r
-                                           ' -n '        + \\r
-                                           align\r
+                            SectionFiles += ('-n', align)\r
                                \r
         #\r
         # Prepare the parameter\r
         #\r
+        CmdParams = tuple()\r
         if self.Fixed != False:\r
-                Fixed = ' -x '\r
-        else :\r
-                Fixed = ''\r
+            CmdParams += ('-x',)\r
         if self.CheckSum != False :\r
-                CheckSum = ' -s '\r
-        else :\r
-                CheckSum = ''\r
+            CmdParams += ('-s',)\r
         if self.Alignment != None and self.Alignment !='':\r
-            Alignment = ' -a ' + '%s' %self.Alignment\r
-        else :\r
-            Alignment = ''\r
+            CmdParams += ('-a', self.Alignment)\r
 \r
         if not (self.FvFileType == None):\r
-            FileType = ' -t ' + Ffs.Ffs.FdfFvFileTypeToFileType.get(self.FvFileType)\r
-        else:\r
-            FileType = ''\r
+            CmdParams += ('-t', Ffs.Ffs.FdfFvFileTypeToFileType.get(self.FvFileType))\r
 \r
         FfsFileOutput = os.path.join(OutputDir, self.NameGuid + '.ffs')\r
 \r
-\r
-        GenFfsCmd = 'GenFfs'       +  \\r
-                     FileType      +  \\r
-                     Fixed         +  \\r
-                     CheckSum      +  \\r
-                     Alignment     +  \\r
-                     ' -o '        +  \\r
-                     FfsFileOutput +  \\r
-                     ' -g '        +  \\r
-                     self.NameGuid +  \\r
-                     SectionFiles\r
+        GenFfsCmd = (\r
+            'GenFfs',\r
+             '-g', self.NameGuid,\r
+             '-o', FfsFileOutput,\r
+            ) + CmdParams + SectionFiles\r
 \r
         GenFdsGlobalVariable.CallExternalTool(GenFfsCmd,"GenFfs Failed !")\r
         return FfsFileOutput\r
         \r
 \r
+\r
index 3bda80e..f96a298 100644 (file)
@@ -357,30 +357,32 @@ class FfsInfStatement(FfsInfStatementClassObject):
                     FileBeforeStrip = os.path.join(self.OutputPath, ModuleName + '.reloc')\r
                     shutil.copyfile(File, FileBeforeStrip)\r
                     StrippedFile = os.path.join(self.OutputPath, ModuleName + '.stipped')\r
-                    StripCmd = 'GenFw -l '    + \\r
-                               ' -o '         + \\r
-                                StrippedFile        + \\r
-                                ' '           + \\r
-                                GenFdsGlobalVariable.MacroExtend(File, Dict)\r
+                    StripCmd = (\r
+                        'GenFw',\r
+                        '-l',\r
+                        '-o', StrippedFile,\r
+                        GenFdsGlobalVariable.MacroExtend(File, Dict),\r
+                        )\r
                     GenFdsGlobalVariable.CallExternalTool(StripCmd, "Strip Failed !")\r
                     File = StrippedFile\r
                     \r
                 if SectionType == 'TE':\r
                     TeFile = os.path.join( self.OutputPath, self.ModuleGuid + 'Te.raw')\r
-                    GenTeCmd = 'GenFw -t '    + \\r
-                               ' -o '         + \\r
-                                TeFile        + \\r
-                                ' '           + \\r
-                               GenFdsGlobalVariable.MacroExtend(File, Dict)\r
+                    GenTeCmd = (\r
+                        'GenFw',\r
+                        '-t',\r
+                        '-o', TeFile,\r
+                        GenFdsGlobalVariable.MacroExtend(File, Dict),\r
+                        )\r
                     GenFdsGlobalVariable.CallExternalTool(GenTeCmd, "GenFw Failed !")\r
                     File = TeFile\r
                 \r
-                GenSectionCmd = 'GenSec -o '                                + \\r
-                                 OutputFile                                 + \\r
-                                 ' -s '                                     + \\r
-                                 Section.Section.SectionType[SectionType]   + \\r
-                                 ' '                                        + \\r
-                                 File\r
+                GenSectionCmd = (\r
+                    'GenSec',\r
+                    '-o', OutputFile,\r
+                    '-s', Section.Section.SectionType[SectionType],\r
+                    File,\r
+                    )\r
                 #\r
                 # Call GenSection\r
                 #\r
@@ -396,30 +398,32 @@ class FfsInfStatement(FfsInfStatementClassObject):
                 FileBeforeStrip = os.path.join(self.OutputPath, ModuleName + '.reloc')\r
                 shutil.copyfile(File, FileBeforeStrip)\r
                 StrippedFile = os.path.join(self.OutputPath, ModuleName + '.stipped')\r
-                StripCmd = 'GenFw -l '    + \\r
-                           ' -o '         + \\r
-                            StrippedFile        + \\r
-                            ' '           + \\r
-                            GenFdsGlobalVariable.MacroExtend(File, Dict)\r
+                StripCmd = (\r
+                    'GenFw',\r
+                    '-l',\r
+                    '-o', StrippedFile,\r
+                    GenFdsGlobalVariable.MacroExtend(File, Dict),\r
+                    )\r
                 GenFdsGlobalVariable.CallExternalTool(StripCmd, "Strip Failed !")\r
                 File = StrippedFile\r
             \r
             if SectionType == 'TE':\r
                 TeFile = os.path.join( self.OutputPath, self.ModuleGuid + 'Te.raw')\r
-                GenTeCmd = 'GenFw -t '    + \\r
-                           ' -o '         + \\r
-                            TeFile        + \\r
-                            ' '           + \\r
-                           GenFdsGlobalVariable.MacroExtend(File, Dict)\r
+                GenTeCmd = (\r
+                    'GenFw',\r
+                    '-t',\r
+                    '-o', TeFile,\r
+                    GenFdsGlobalVariable.MacroExtend(File, Dict),\r
+                    )\r
                 GenFdsGlobalVariable.CallExternalTool(GenTeCmd, "GenFw Failed !")\r
                 GenSecInputFile = TeFile\r
             \r
-            GenSectionCmd = 'GenSec -o '                                + \\r
-                             OutputFile                                 + \\r
-                             ' -s '                                     + \\r
-                             Section.Section.SectionType[SectionType]   + \\r
-                             ' '                                        + \\r
-                             GenSecInputFile\r
+            GenSectionCmd = (\r
+                'GenSec',\r
+                '-o', OutputFile,\r
+                '-s', Section.Section.SectionType[SectionType],\r
+                GenSecInputFile,\r
+                )\r
             #\r
             # Call GenSection\r
             #\r
@@ -441,35 +445,27 @@ class FfsInfStatement(FfsInfStatementClassObject):
         #\r
         # Prepare the parameter of GenFfs\r
         #\r
-        (FileType,Fixed, CheckSum, Alignment) = self.__GetGenFfsCmdParameter__(Rule)\r
-        \r
+        CmdParams = self.__GetGenFfsCmdParameter__(Rule)\r
+\r
         FfsOutput = self.OutputPath                     + \\r
                     os.sep                              + \\r
                     self.__ExtendMacro__(Rule.NameGuid) + \\r
                     '.ffs'\r
 \r
         GenFdsGlobalVariable.VerboseLogger(self.__ExtendMacro__(Rule.NameGuid))\r
-        InputSection = ''\r
+        InputSection = tuple()\r
         for InputFile in InputFileList:\r
-            InputSection = InputSection + \\r
-                           ' -i '       + \\r
-                           InputFile\r
-            if Alignment != '':\r
-                InputSection = InputSection  + \\r
-                               ' -n '        + \\r
-                               Alignment\r
+            InputSection += ('-i', InputFile)\r
+            for i in range(len(CmdParams) - 1):\r
+                if CmdParams[i] == '-a':\r
+                    InputSection += ('-n', CmdParams[i+1])\r
+                    break\r
 \r
-\r
-        GenFfsCmd = 'GenFfs '  + \\r
-                     FileType  + \\r
-                     Fixed     + \\r
-                     CheckSum  + \\r
-                     Alignment + \\r
-                     ' -o '    + \\r
-                     FfsOutput + \\r
-                     ' -g '    + \\r
-                     self.NameGuid + \\r
-                     InputSection\r
+        GenFfsCmd = (\r
+            'GenFfs',\r
+             '-g', self.NameGuid,\r
+             '-o', FfsOutput,\r
+            ) + CmdParams + InputSection\r
         #\r
         # Call GenSection\r
         #\r
@@ -490,7 +486,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
             if Rule.KeepReloc != None:\r
                 self.KeepRelocFromRule = Rule.KeepReloc\r
         \r
-        SectFiles = ''\r
+        SectFiles = tuple()\r
         Index = 1\r
         for Sect in Rule.SectionList:\r
            SecIndex = '%d' %Index\r
@@ -500,13 +496,9 @@ class FfsInfStatement(FfsInfStatementClassObject):
            else :\r
                SectList, Align = Sect.GenSection(self.OutputPath , self.ModuleGuid, SecIndex, self.KeyStringList, self)\r
            for SecName in  SectList :\r
-               SectFiles = SectFiles    + \\r
-                           ' -i '       + \\r
-                           SecName\r
+               SectFiles += ('-i', SecName)\r
                if Align != None:\r
-                   SectFiles = SectFiles + \\r
-                               ' -n '    + \\r
-                               Align\r
+                   SectFiles += ('-n', Align)\r
            Index = Index + 1\r
         return SectFiles\r
 \r
@@ -521,20 +513,16 @@ class FfsInfStatement(FfsInfStatementClassObject):
     #\r
     def __GenComplexFileFfs__(self, Rule, InputFile):\r
         \r
-        (FileType,Fixed, CheckSum, Alignment) = self.__GetGenFfsCmdParameter__(Rule)\r
+        CmdParams = self.__GetGenFfsCmdParameter__(Rule)\r
         \r
         FfsOutput = os.path.join( self.OutputPath, self.ModuleGuid + '.ffs')\r
-        GenFfsCmd = 'GenFfs '                                     + \\r
-                     Fixed                                        + \\r
-                     CheckSum                                     + \\r
-                     Alignment                                    + \\r
-                     FileType                                     + \\r
-                     ' -g '                                       + \\r
-                     self.ModuleGuid                              + \\r
-                     ' -o '                                       + \\r
-                     FfsOutput                                    + \\r
-                     InputFile\r
-                     \r
+        GenFfsCmd = (\r
+            'GenFfs',\r
+            ) + CmdParams + (\r
+             '-g', self.ModuleGuid,\r
+             '-o', FfsOutput,\r
+            ) + InputFile\r
+\r
         GenFdsGlobalVariable.CallExternalTool(GenFfsCmd, "GenFfs Failed !")\r
         return FfsOutput\r
 \r
@@ -547,20 +535,16 @@ class FfsInfStatement(FfsInfStatementClassObject):
     #   @retval tuple       (FileType, Fixed, CheckSum, Alignment)\r
     #\r
     def __GetGenFfsCmdParameter__(self, Rule):\r
-        FileType = ' -t ' + \\r
-                   Ffs.Ffs.FdfFvFileTypeToFileType[Rule.FvFileType]\r
+        result = tuple()\r
+        result += ('-t', Ffs.Ffs.FdfFvFileTypeToFileType[Rule.FvFileType])\r
+        #FileType = ' -t ' + \\r
+        #           Ffs.Ffs.FdfFvFileTypeToFileType[Rule.FvFileType]\r
         if Rule.Fixed != False:\r
-            Fixed = ' -x '\r
-        else :\r
-            Fixed = ''\r
+            result += ('-x',)\r
         if Rule.CheckSum != False:\r
-            CheckSum = ' -s '\r
-        else :\r
-            CheckSum = ''\r
+            result += ('-s',)\r
             \r
         if Rule.Alignment != None and Rule.Alignment != '':\r
-            Alignment = ' -a %s' %Rule.Alignment\r
-        else :\r
-            Alignment = ''\r
+            result += ('-a', Rule.Alignment)\r
             \r
-        return FileType, Fixed, CheckSum, Alignment
\ No newline at end of file
+        return result\r
index 7b6fa74..7ddef4c 100644 (file)
@@ -92,17 +92,17 @@ class FV (FvClassObject):
         # BUGBUG: FvOutputFile could be specified from FDF file (FV section, CreateFile statement)\r
         if self.CreateFileName != None:\r
             FvOutputFile = self.CreateFileName\r
-            \r
-        Cmd = 'GenFv -i '                 + \\r
-               self.InfFileName           + \\r
-               ' -o '                     + \\r
-               FvOutputFile               + \\r
-               ' -a '                     + \\r
-               GenFdsGlobalVariable.FvAddressFileName\r
+\r
+        GenFvCmd = (\r
+            'GenFv',\r
+             '-i', self.InfFileName,\r
+             '-o', FvOutputFile,\r
+             '-a', GenFdsGlobalVariable.FvAddressFileName,\r
+            )\r
         #\r
         # Call GenFv Tools\r
         #\r
-        GenFdsGlobalVariable.CallExternalTool(Cmd, "GenFv Failed!")\r
+        GenFdsGlobalVariable.CallExternalTool(GenFvCmd, "GenFv Failed!")\r
         #\r
         # Write the Fv contents to Buffer\r
         #\r
@@ -200,4 +200,4 @@ class FV (FvClassObject):
                                        VtfDict.get(self.UiFvName)          + \\r
                                        T_CHAR_LF)\r
 \r
-        
\ No newline at end of file
+        \r
index 821c9cd..2fce353 100755 (executable)
@@ -60,11 +60,12 @@ class FvImageSection(FvImageSectionClassObject):
             \r
             for FileName in FileList:\r
                 OutputFile = os.path.join(OutputPath, ModuleName + 'SEC' + Num + Ffs.SectionSuffix.get("FV_IMAGE"))\r
-                GenSectionCmd = 'GenSec -o '                         + \\r
-                                OutputFile                           + \\r
-                                ' -s '                               + \\r
-                                'EFI_SECTION_FIRMWARE_VOLUME_IMAGE ' + \\r
-                                FvFileName\r
+                GenSectionCmd = (\r
+                    'GenSec',\r
+                    '-o', OutputFile,\r
+                    '-s', 'EFI_SECTION_FIRMWARE_VOLUME_IMAGE',\r
+                    FvFileName,\r
+                    )\r
 \r
                 GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed!")\r
                 OutputFileList.append(OutputFile)\r
@@ -79,20 +80,21 @@ class FvImageSection(FvImageSectionClassObject):
                 self.Fv = Fv\r
             else:\r
                 raise Exception("FvImageSection Failed! %s NOT found in FDF" % self.FvName)\r
-                                 \r
+\r
             FvFileName = self.Fv.AddToBuffer(Buffer, MacroDict = Dict)\r
-            \r
+\r
             #\r
             # Prepare the parameter of GenSection\r
             #\r
             OutputFile = os.path.join(OutputPath, ModuleName + 'SEC' + SecNum + Ffs.SectionSuffix.get("FV_IMAGE"))\r
-                         \r
-            GenSectionCmd = 'GenSec -o '                          + \\r
-                             OutputFile                           + \\r
-                             ' -s '                               + \\r
-                             'EFI_SECTION_FIRMWARE_VOLUME_IMAGE ' + \\r
-                             FvFileName\r
-                             \r
+\r
+            GenSectionCmd = (\r
+                'GenSec',\r
+                '-o', OutputFile,\r
+                '-s', 'EFI_SECTION_FIRMWARE_VOLUME_IMAGE',\r
+                FvFileName,\r
+                )\r
+\r
             GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed!")\r
             OutputFileList.append(OutputFile)\r
                 \r
index 7dd8561..f1372ab 100644 (file)
@@ -123,13 +123,16 @@ class GenFdsGlobalVariable:
         return os.path.normpath(Str)\r
     \r
     def CallExternalTool (cmd, errorMess):\r
-        \r
+\r
+        if type(cmd) not in (tuple, list):\r
+            GenFdsGlobalVariable.ErrorLogger("ToolError!  Invalid parameter type in call to CallExternalTool")\r
+\r
         if GenFdsGlobalVariable.DebugLevel != -1:\r
-            cmd += ' -d %d' % GenFdsGlobalVariable.DebugLevel\r
+            cmd += ('-d', str(GenFdsGlobalVariable.DebugLevel))\r
             GenFdsGlobalVariable.InfLogger (cmd)\r
         \r
         if GenFdsGlobalVariable.VerboseMode:\r
-            cmd += ' -v'\r
+            cmd += ('-v',)\r
             GenFdsGlobalVariable.InfLogger (cmd)\r
         else:\r
             sys.stdout.write ('#')\r
index f9bb8ae..c70c3ae 100755 (executable)
@@ -60,7 +60,7 @@ class GuidSection(GuidSectionClassObject) :
             self.NameGuid = FfsInf.__ExtendMacro__(self.NameGuid)\r
             self.SectionType = FfsInf.__ExtendMacro__(self.SectionType)\r
             \r
-        SectFile = ''\r
+        SectFile = tuple()\r
         Index = 0\r
         for Sect in self.SectionList:\r
             Index = Index + 1\r
@@ -68,9 +68,7 @@ class GuidSection(GuidSectionClassObject) :
             ReturnSectList, align = Sect.GenSection(OutputPath, ModuleName, SecIndex, KeyStringList,FfsInf, Dict)\r
             if ReturnSectList != []:\r
                 for file in ReturnSectList:\r
-                    SectFile = SectFile + \\r
-                               '  '     + \\r
-                               file\r
+                    SectFile += (file,)\r
                        \r
 \r
         OutputFile = OutputPath + \\r
@@ -90,11 +88,11 @@ class GuidSection(GuidSectionClassObject) :
         #\r
         if self.NameGuid == None :\r
             GenFdsGlobalVariable.VerboseLogger( "Use GenSection function Generate CRC32 Section")\r
-            GenSectionCmd = 'GenSec -o '                                   + \\r
-                             OutputFile                                    + \\r
-                             ' -s '                                        + \\r
-                             Section.Section.SectionType[self.SectionType] + \\r
-                             SectFile\r
+            GenSectionCmd = (\r
+                'GenSec',\r
+                 '-o', OutputFile,\r
+                 '-s', Section.Section.SectionType[self.SectionType],\r
+                ) + SectFile\r
                              \r
             GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed!")\r
             OutputFileList = []\r
@@ -108,9 +106,10 @@ class GuidSection(GuidSectionClassObject) :
             #\r
             # Call GenSection with DUMMY section type.\r
             #\r
-            GenSectionCmd = 'GenSec -o '                                   + \\r
-                             OutputFile                                    + \\r
-                             SectFile\r
+            GenSectionCmd = (\r
+                'GenSec',\r
+                '-o', OutputFile,\r
+                ) + SectFile\r
         \r
             GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed!")\r
             #\r
@@ -125,12 +124,12 @@ class GuidSection(GuidSectionClassObject) :
                        '.tmp'\r
             TempFile = os.path.normpath(TempFile)\r
             \r
-            ExternalToolCmd = ExternalTool                             + \\r
-                              ' -e '                                   + \\r
-                              ' -o '                                   + \\r
-                              TempFile                                 + \\r
-                              ' '                                      + \\r
-                              InputFile\r
+            ExternalToolCmd = (\r
+                ExternalTool,\r
+                '-e',\r
+                '-o', TempFile,\r
+                InputFile,\r
+                )\r
 \r
             #\r
             # Call external tool\r
@@ -139,28 +138,20 @@ class GuidSection(GuidSectionClassObject) :
             #\r
             # Call Gensection Add Secntion Header\r
             #\r
-            PROCSSING_REQUIRED = ''\r
-            AUTH_STATUS_VALID = ''\r
+            AttributeTuple = tuple()\r
             if self.ProcessRequired == True:\r
-                PROCSSING_REQUIRED = "PROCSSING_REQUIRED"\r
+                AttributeTuple += ('-a', 'PROCSSING_REQUIRED')\r
             if self.AuthStatusValid == True:\r
-                AUTH_STATUS_VALID = "AUTH_STATUS_VALID"\r
-            if PROCSSING_REQUIRED != '' or AUTH_STATUS_VALID != '':\r
-                AttributeStr = ' -a '              + \\r
-                             PROCSSING_REQUIRED + \\r
-                             AUTH_STATUS_VALID\r
-            else :\r
-                AttributeStr = ''\r
-            GenSectionCmd = 'GenSec -o '                            + \\r
-                             OutputFile                             + \\r
-                             ' -s '                                 + \\r
-                             Section.Section.SectionType['GUIDED']  + \\r
-                             ' -g '                                 + \\r
-                             self.NameGuid                          + \\r
-                             AttributeStr                              + \\r
-                             ' '                                    + \\r
-                             TempFile\r
-                        \r
+                AttributeTuple += ('-a', 'AUTH_STATUS_VALID')\r
+            GenSectionCmd = (\r
+                'GenSec',\r
+                '-o', OutputFile,\r
+                '-s', Section.Section.SectionType['GUIDED'],\r
+                '-g', self.NameGuid,\r
+                ) + AttributeTuple + (\r
+                TempFile,\r
+                )\r
+\r
             GenFdsGlobalVariable.CallExternalTool(GenSectionCmd, "GenSection Failed!")\r
             OutputFileList = []\r
             OutputFileList.append(OutputFile)\r
index 6c0ed31..1263811 100644 (file)
@@ -71,11 +71,12 @@ class UiSection (UiSectionClassObject):
             NameString = ''\r
             \r
             \r
-        GenSectionCmd = 'GenSec -o '                       + \\r
-                         OutputFile                        + \\r
-                         ' -s EFI_SECTION_USER_INTERFACE ' + \\r
-                         '-n '                             + \\r
-                          NameString                       \r
+        GenSectionCmd = (\r
+            'GenSec',\r
+            '-o', OutputFile,\r
+            '-s', 'EFI_SECTION_USER_INTERFACE',\r
+            '-n', NameString,\r
+            )\r
         #\r
         # Call GenSection\r
         #\r
index c50b472..dfab5b0 100644 (file)
@@ -62,9 +62,9 @@ class VerSection (VerSectionClassObject):
         OutputFile = os.path.normpath(OutputFile)\r
         \r
         # Get Build Num\r
-        BuildNum = ''\r
+        BuildNum = tuple()\r
         if not (self.BuildNum == None) :\r
-            BuildNum = ' -j ' + '%d' %self.BuildNum;\r
+            BuildNum = ('-j', ('%d' % self.BuildNum))\r
  \r
         # Get String Data\r
         StringData = ''\r
@@ -73,20 +73,20 @@ class VerSection (VerSectionClassObject):
         elif self.FileName != None:\r
             FileNameStr = GenFdsGlobalVariable.ReplaceWorkspaceMacro(self.FileName)\r
             FileNameStr = GenFdsGlobalVariable.MacroExtend(FileNameStr, Dict)\r
-            FileObj = open (FileNameStr, 'r')\r
+            FileObj = open(FileNameStr, 'r')\r
             StringData = FileObj.read()\r
-            StringData = '\"' + StringData + '\"'\r
+            StringData = '"' + StringData + '"'\r
             FileObj.close()\r
         else:\r
             StringData = ''\r
-            \r
-        GenSectionCmd = 'GenSec -o '                + \\r
-                         OutputFile                 + \\r
-                         ' -s EFI_SECTION_VERSION ' + \\r
-                         '-n '                      + \\r
-                         StringData                 + \\r
-                         BuildNum                   \r
-                         \r
+\r
+        GenSectionCmd = (\r
+            'GenSec',\r
+            '-o', OutputFile,\r
+            '-s', 'EFI_SECTION_VERSION',\r
+            '-n', StringData,\r
+            ) + BuildNum\r
+\r
         #\r
         # Call GenSection\r
         #\r
index cabcb88..d293773 100755 (executable)
@@ -46,13 +46,12 @@ class Vtf (VtfClassObject):
         BaseAddArg = self.GetBaseAddressArg(FdAddressDict)\r
         OutputArg, VtfRawDict = self.GenOutputArg()\r
         \r
-        Cmd = "GenVtf "        + \\r
-               OutputArg       + \\r
-               ' -f '          + \\r
-               self.BsfInfName + \\r
-               ' '             + \\r
-               BaseAddArg      \r
-               \r
+        Cmd = (\r
+            'GenVtf',\r
+            ) + OutputArg + (\r
+            '-f', self.BsfInfName,\r
+            ) + BaseAddArg\r
+\r
         GenFdsGlobalVariable.CallExternalTool(Cmd, "GenFv -Vtf Failed!")\r
         GenFdsGlobalVariable.SharpCounter = 0\r
         \r
@@ -157,12 +156,13 @@ class Vtf (VtfClassObject):
     #\r
     def GetBaseAddressArg(self, FdAddressDict):\r
         FvList = self.GetFvList()\r
-        CmdStr = ''\r
+        CmdStr = tuple()\r
         for i in FvList:\r
             (BaseAddress, Size) = FdAddressDict.get(i)\r
-            CmdStr = CmdStr               + \\r
-                     ' -r 0x%x' %BaseAddress  + \\r
-                     ' -s 0x%x' %Size\r
+            CmdStr += (\r
+                '-r', '0x%x' % BaseAddress,\r
+                '-s', '0x%x' %Size,\r
+                )\r
         return CmdStr\r
     \r
     ## GenOutputArg() method\r
@@ -173,18 +173,16 @@ class Vtf (VtfClassObject):
     #                 \r
     def GenOutputArg(self):\r
         FvVtfDict = {}\r
-        OutPutFileName = ''\r
+        OutputFileName = ''\r
         FvList = self.GetFvList()\r
         Index = 0\r
-        Arg = ''\r
+        Arg = tuple()\r
         for FvObj in FvList:\r
-            Index = Index +1\r
-            OutputFileName = 'Vtf%d.raw' %Index\r
-            OutPutFileName = os.path.join(GenFdsGlobalVariable.FvDir, OutputFileName)\r
-            Arg = Arg    + \\r
-                  ' -o ' + \\r
-                  OutPutFileName\r
-            FvVtfDict[FvObj.upper()] = OutPutFileName\r
+            Index = Index + 1\r
+            OutputFileName = 'Vtf%d.raw' % Index\r
+            OutputFileName = os.path.join(GenFdsGlobalVariable.FvDir, OutputFileName)\r
+            Arg += ('-o', OutputFileName)\r
+            FvVtfDict[FvObj.upper()] = OutputFileName\r
             \r
         return Arg, FvVtfDict\r
                 \r