1.Change environment variable from "Framework_Tools_Path" to "FRAMEWORK_TOOLS_PATH".
authorqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 8 Jun 2006 09:11:56 +0000 (09:11 +0000)
committerqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 8 Jun 2006 09:11:56 +0000 (09:11 +0000)
2.Add one OUTPUT - *.org file  for GenFfsFile tool.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@443 6f19259b-4bc3-4df7-8a09-765794883524

16 files changed:
Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/CompressSection.java
Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/FwImageTask.java
Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCRC32SectionTask.java
Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenDepexTask.java
Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFfsFileTask.java
Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFvImageTask.java
Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenSectionTask.java
Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GuidChkTask.java
Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/MakeDeps.java
Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SectFile.java
Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/Section.java
Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/SetStampTask.java
Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/StrGatherTask.java
Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/Tool.java
Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/VfrCompilerTask.java
edksetup.bat

index 8def4eb..674c6c8 100644 (file)
@@ -54,7 +54,7 @@ public class CompressSection implements Section, FfsTypes{
       @param Buffer     The point of output buffer\r
       \r
     **/\r
-    public void toBuffer (DataOutputStream Buffer){\r
+    public void toBuffer (DataOutputStream buffer, DataOutputStream orgBuffer){\r
         \r
         Section    sect;\r
         File       compressOut;\r
@@ -79,7 +79,7 @@ public class CompressSection implements Section, FfsTypes{
                 //  Call each section class's toBuffer function.\r
                 //\r
                 try {\r
-                    sect.toBuffer(Do);\r
+                    sect.toBuffer(Do, orgBuffer);\r
                 }\r
                 catch (BuildException e) {\r
                     System.out.print(e.getMessage());\r
@@ -121,7 +121,7 @@ public class CompressSection implements Section, FfsTypes{
             Ch.SectionHeader.type    = (byte) EFI_SECTION_COMPRESSION;\r
             \r
             //\r
-            //  Note: The compressName was not effective now. Using the\r
+            //  Note: The compressName was not efsfective now. Using the\r
             //  EFI_STANDARD_COMPRSSION for compressType .\r
             //  That is follow old Genffsfile tools. Some code will be added for \r
             //  the different compressName;\r
@@ -138,19 +138,26 @@ public class CompressSection implements Section, FfsTypes{
             //\r
             //  First add CompressHeader to Buffer, then add Compress data.\r
             //\r
-            Buffer.write (headerBuffer);\r
-            Buffer.write(myCompress.outputBuffer);            \r
+            buffer.write (headerBuffer);\r
+            buffer.write(myCompress.outputBuffer);            \r
                 \r
             //\r
-            //  4 Byte aligment \r
+            //  Buffer 4 Byte aligment \r
             //\r
             int size = Ch.GetSize() + myCompress.outputBuffer.length;\r
             \r
             while ((size & 0x03) != 0){\r
                 size ++;\r
-                Buffer.writeByte(0);\r
+                buffer.writeByte(0);\r
+            }\r
+            //\r
+            // orgBuffer 4 Byte aligment\r
+            //\r
+            size = (int)compressOut.length();\r
+            while ((size & 0x03) != 0){\r
+                size ++;\r
+                orgBuffer.writeByte(0);\r
             }\r
-            \r
             //\r
             //  Delete temp file\r
             //\r
index 19583b5..adfe4c7 100644 (file)
@@ -22,6 +22,7 @@ import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.taskdefs.Execute;\r
 import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
 import org.apache.tools.ant.types.Commandline;\r
+import org.tianocore.build.*;\r
 \r
 /**\r
   FwImageTask class.\r
@@ -65,12 +66,12 @@ public class FwImageTask extends Task implements EfiDefine{
         //\r
         // absolute path of efi tools\r
         //\r
-        String path = project.getProperty("env.Framework_Tools_Path");\r
+        String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");\r
         String command;\r
         if (path == null) {\r
-            command = "FwImage";\r
+            command = "fwimage";\r
         } else {\r
-            command = path + "/" + "FwImage";\r
+            command = path + "/" + "fwimage";\r
         }\r
         //\r
         // argument of tools\r
@@ -92,14 +93,15 @@ public class FwImageTask extends Task implements EfiDefine{
 \r
             runner.setAntRun(project);\r
             runner.setCommandline(cmdline.getCommandline());\r
-            System.out.println(Commandline.toString(cmdline.getCommandline()));\r
-\r
+            //System.out.println(Commandline.toString(cmdline.getCommandline()));\r
+            //GenBuildTask.myLogger.log(Commandline.toString(cmdline.getCommandline()),0);\r
+            //getProject().log(Commandline.toString(cmdline.getCommandline()));\r
             revl = runner.execute();\r
             if (EFI_SUCCESS == revl) {\r
                 //\r
                 // command execution success\r
                 //\r
-                System.out.println("fwimage succeeded!");\r
+                System.out.println("fwimage successed!");\r
             } else {\r
                 //\r
                 // command execution fail\r
index 33115aa..52111b9 100644 (file)
@@ -59,12 +59,12 @@ public class GenCRC32SectionTask extends Task implements EfiDefine{
         ///\r
         /// absolute path of efi tools\r
         ///\r
-        String path = project.getProperty("env.Framework_Tools_Path"); \r
+        String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH"); \r
         String command;\r
         if (path == null) {\r
-            command = "GenCRC32Section";\r
+            command = "gencrc32section";\r
         } else {\r
-            command = path + "/" + "GenCRC32Section" ;\r
+            command = path + "/" + "gencrc32section" ;\r
         }\r
         // \r
         // string line of input files \r
index 8713945..acfc0a8 100644 (file)
@@ -51,12 +51,12 @@ public class GenDepexTask extends Task implements EfiDefine {
         //\r
         // absolute path of edk tools\r
         //\r
-        String path = project.getProperty("env.Framework_Tools_Path");\r
+        String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");\r
         String command;\r
         if (path == null) {\r
-            command = "GenDepex";\r
+            command = "gendepex";\r
         } else {\r
-            command = path + "/" + "GenDepex";\r
+            command = path + "/" + "gendepex";\r
         }\r
         //\r
         // argument of GenDepex tool\r
@@ -87,7 +87,7 @@ public class GenDepexTask extends Task implements EfiDefine {
                 //\r
                 // command execution success\r
                 //\r
-                System.out.println("GenDepex execute succeeded!");\r
+                System.out.println("GenDepex execute successed!");\r
 \r
             } else {\r
                 //\r
@@ -163,4 +163,4 @@ public class GenDepexTask extends Task implements EfiDefine {
     public String getPadding() {\r
         return this.padding;\r
     }\r
-}\r
+}
\ No newline at end of file
index 00712d8..4d4c996 100644 (file)
@@ -114,13 +114,17 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes {
       \r
       GenFfsFileTask execute is to generate ffs file according to input section \r
       dscriptive information.\r
-     */\r
+    **/\r
     public void execute() throws BuildException {\r
         Section           sect;\r
         int               fileSize;\r
+        int               orgFileSize;\r
         int               fileDataSize;\r
+        int               orgFileDataSize;\r
         File              ffsFile;\r
+        File              ffsOrgFile;\r
         FfsHeader         ffsHeader = new FfsHeader();  \r
+        FfsHeader         orgFfsHeader = new FfsHeader();\r
         String            ffsSuffix = "";\r
         String            outputPath = "";\r
 \r
@@ -128,7 +132,7 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes {
         //  Get Fraemwork_Tools_Path\r
         //\r
         Project pj = this.getOwningTarget().getProject();\r
-        path       = pj.getProperty("env.Framework_Tools_Path");\r
+        path       = pj.getProperty("env.FRAMEWORK_TOOLS_PATH");\r
 \r
         //\r
         //  Check does the BaseName, Guid, FileType set value.\r
@@ -165,14 +169,26 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes {
         System.out.print("General Ffs file: file name is:\n");\r
         System.out.print(outputPath + this.ffsFileGuid + '-' + this.baseName + ffsSuffix);\r
         System.out.print("\n");\r
-\r
+        \r
         //\r
-        //  Create file output stream -- dataBuffer.\r
-        //   \r
+        // Create ffs ORG file. fileName = FfsFileGuid + BaseName + ffsSuffix +\r
+        // ".org".\r
+        //\r
+        ffsOrgFile = new File(outputPath + this.ffsFileGuid + '-' + this.baseName + ffsSuffix + ".org");\r
+           \r
         try {\r
+            //\r
+            //  Create file output stream -- dataBuffer.\r
+            //\r
             FileOutputStream dataFs     = new FileOutputStream (ffsFile.getAbsolutePath());\r
             DataOutputStream dataBuffer = new DataOutputStream (dataFs);\r
-\r
+            \r
+            //\r
+            // Create org file output stream -- orgDataBuffer\r
+            //\r
+            FileOutputStream orgDataFs     = new FileOutputStream (ffsOrgFile.getAbsolutePath());\r
+            DataOutputStream orgDataBuffer = new DataOutputStream (orgDataFs);\r
+            \r
             //\r
             //  Search SectionList find earch section and call it's \r
             //  ToBuffer function.\r
@@ -185,7 +201,7 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes {
                     //\r
                     //  The last section don't need 4 byte ffsAligment.\r
                     //\r
-                    sect.toBuffer((DataOutputStream)dataBuffer);\r
+                    sect.toBuffer((DataOutputStream)dataBuffer, (DataOutputStream) orgDataBuffer);\r
                 } catch (Exception e) {\r
                     throw new BuildException (e.getMessage());\r
                 }\r
@@ -207,22 +223,40 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes {
             FileInputStream fi = new FileInputStream (ffsFile.getAbsolutePath());\r
             DataInputStream di = new DataInputStream (fi);\r
             di.read(fileBuffer);\r
-            di.close(); \r
-\r
+            di.close();\r
+            \r
+            //\r
+            // create input org stream to read file data\r
+            //\r
+            byte[] orgFileBuffer = new byte[(int)ffsOrgFile.length()];\r
+            FileInputStream ofi  = new FileInputStream (ffsOrgFile.getAbsolutePath());\r
+            DataInputStream odi  = new DataInputStream (ofi);\r
+            odi.read(orgFileBuffer);\r
+            odi.close();\r
 \r
             //\r
             //  Add GUID to header struct\r
             //\r
             if (this.ffsFileGuid != null) {\r
                 stringToGuid (this.ffsFileGuid, ffsHeader.name);\r
+                //\r
+                // Add Guid to org header struct\r
+                //\r
+                stringToGuid (this.ffsFileGuid, orgFfsHeader.name);\r
             }\r
 \r
             ffsHeader.ffsAttributes = this.attributes;\r
             if ((ffsHeader.fileType = stringToType(this.ffsFileType))== -1) {\r
                 throw new BuildException ("FFS_FILE_TYPE unknow!\n");\r
             }\r
-\r
-\r
+            \r
+            //\r
+            // Copy ffsHeader.ffsAttribute and fileType to orgFfsHeader.ffsAttribute\r
+            // and fileType\r
+            //            \r
+            orgFfsHeader.ffsAttributes = ffsHeader.ffsAttributes;\r
+            orgFfsHeader.fileType      = ffsHeader.fileType;\r
+            \r
             //\r
             //  Adjust file size. The function is used to tripe the last \r
             //  section padding of 4 binary boundary. \r
@@ -231,15 +265,21 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes {
             if (ffsHeader.fileType != EFI_FV_FILETYPE_RAW) {\r
 \r
                 fileDataSize = adjustFileSize (fileBuffer);\r
+                orgFileDataSize = adjustFileSize (orgFileBuffer);\r
 \r
             } else {\r
                 fileDataSize = fileBuffer.length;\r
+                orgFileDataSize = orgFileBuffer.length;\r
             }\r
 \r
             //\r
             //  1. add header size to file size\r
             //\r
             fileSize = fileDataSize + ffsHeader.getSize();\r
+            //\r
+            //     add header size to org file size\r
+            //\r
+            orgFileSize = orgFileDataSize + ffsHeader.getSize();\r
 \r
             if ((ffsHeader.ffsAttributes & FFS_ATTRIB_TAIL_PRESENT) != 0) {\r
                 if (ffsHeader.fileType == EFI_FV_FILETYPE_FFS_PAD) {\r
@@ -256,6 +296,7 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes {
                                              );            \r
                 }\r
                 fileSize = fileSize + 2;\r
+                orgFileSize = orgFileSize + 2;\r
             }\r
 \r
             //\r
@@ -264,7 +305,14 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes {
             ffsHeader.ffsFileSize[0] = (byte)(fileSize & 0x00FF);\r
             ffsHeader.ffsFileSize[1] = (byte)((fileSize & 0x00FF00)>>8);\r
             ffsHeader.ffsFileSize[2] = (byte)(((int)fileSize & 0xFF0000)>>16);\r
-\r
+            \r
+            //\r
+            //     set file size to org header struct\r
+            //\r
+            orgFfsHeader.ffsFileSize[0] = (byte)(orgFileSize & 0x00FF);\r
+            orgFfsHeader.ffsFileSize[1] = (byte)((orgFileSize & 0x00FF00)>>8);\r
+            orgFfsHeader.ffsFileSize[2] = (byte)(((int)orgFileSize & 0xFF0000)>>16);\r
+            \r
             //\r
             //  Fill in checksums and state, these must be zero for checksumming\r
             //\r
@@ -272,21 +320,43 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes {
                                                                  ffsHeader.structToBuffer(),\r
                                                                  ffsHeader.getSize()\r
                                                                  );\r
-\r
+            //\r
+            // Fill in org file's header check sum and state\r
+            //\r
+            orgFfsHeader.integrityCheck.header = calculateChecksum8 (\r
+                                                                    orgFfsHeader.structToBuffer(),\r
+                                                                    orgFfsHeader.getSize()\r
+                                                                    );\r
+            \r
             if ((this.attributes & FFS_ATTRIB_CHECKSUM) != 0) {\r
                 if ((this.attributes & FFS_ATTRIB_TAIL_PRESENT) != 0) {\r
                     ffsHeader.integrityCheck.file = calculateChecksum8 (\r
                                                                        fileBuffer, \r
                                                                        fileDataSize\r
                                                                        );\r
+                    //\r
+                    // Add org file header\r
+                    //\r
+                    orgFfsHeader.integrityCheck.file = calculateChecksum8 (\r
+                                                                           orgFileBuffer,\r
+                                                                           orgFileDataSize\r
+                                                                           );\r
                 } else {\r
                     ffsHeader.integrityCheck.file = calculateChecksum8 (\r
                                                                        fileBuffer,\r
                                                                        fileDataSize\r
                                                                        );\r
+                    //\r
+                    // Add org file header\r
+                    //\r
+                    orgFfsHeader.integrityCheck.file = calculateChecksum8 (\r
+                                                                          orgFileBuffer,\r
+                                                                          orgFileDataSize\r
+                                                                          );\r
                 }\r
             } else {\r
                 ffsHeader.integrityCheck.file = FFS_FIXED_CHECKSUM;\r
+                orgFfsHeader.integrityCheck.file = FFS_FIXED_CHECKSUM;\r
             }\r
 \r
             //\r
@@ -295,21 +365,30 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes {
             ffsHeader.ffsState = EFI_FILE_HEADER_CONSTRUCTION | \r
                                  EFI_FILE_HEADER_VALID | \r
                                  EFI_FILE_DATA_VALID;\r
-\r
-\r
+            orgFfsHeader.integrityCheck.file = ffsHeader.ffsState;\r
+            \r
             //\r
             // create output stream to first write header data in file, then write sect data in file.\r
             //\r
             FileOutputStream headerFfs = new FileOutputStream (ffsFile.getAbsolutePath());\r
             DataOutputStream ffsBuffer = new DataOutputStream (headerFfs);\r
-\r
+            \r
+            FileOutputStream orgHeaderFfs = new FileOutputStream (ffsOrgFile.getAbsolutePath());\r
+            DataOutputStream orgFfsBuffer = new DataOutputStream (orgHeaderFfs);\r
+            \r
             //\r
             //  Add header struct and file data to FFS file\r
             //\r
             ffsBuffer.write(ffsHeader.structToBuffer());\r
+            orgFfsBuffer.write(orgFfsHeader.structToBuffer());\r
+            \r
             for (int i = 0; i< fileDataSize; i++) {\r
                 ffsBuffer.write(fileBuffer[i]);\r
             }\r
+            \r
+            for (int i = 0; i < orgFileDataSize; i++){\r
+                orgFfsBuffer.write(orgFileBuffer[i]);\r
+            }\r
 \r
             //\r
             //  If there is a tail, then set it\r
@@ -333,6 +412,9 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes {
                 tailByte[1] = (byte)((tailValue & 0xff00)>>8);  \r
                 ffsBuffer.write(tailByte[0]);\r
                 ffsBuffer.write(tailByte[1]);\r
+                \r
+                orgFfsBuffer.write(tailByte[0]);\r
+                orgFfsBuffer.write(tailByte[1]);\r
             }\r
 \r
             //\r
@@ -340,6 +422,7 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes {
             //  the buffer can't be rewritten to file. \r
             //\r
             ffsBuffer.close();\r
+            orgFfsBuffer.close();\r
             System.out.print ("Successful create ffs file!\n");\r
         } catch (Exception e) {\r
             throw new BuildException (e.getMessage());\r
@@ -672,7 +755,7 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes {
         }\r
 \r
         if (ffsFileType.equals("EFI_FV_FILETYPE_FREEFORM")) {\r
-            return(byte)EFI_FV_FILETYPE_SECURITY_CORE;\r
+            return(byte)EFI_FV_FILETYPE_FREEFORM;\r
         }\r
 \r
         if (ffsFileType.equals("EFI_FV_FILETYPE_SECURITY_CORE")) {\r
index 6f3cd7b..1f5e4ec 100644 (file)
@@ -14,6 +14,7 @@
 \r
  **/\r
 package org.tianocore.framework.tasks;\r
+import java.io.File;\r
 \r
 import org.apache.tools.ant.BuildException;\r
 import org.apache.tools.ant.Project;\r
@@ -22,16 +23,6 @@ import org.apache.tools.ant.taskdefs.Execute;
 import org.apache.tools.ant.taskdefs.LogStreamHandler;\r
 import org.apache.tools.ant.types.Commandline;\r
 \r
-import java.io.File;\r
-import java.io.IOException;\r
-import java.io.InputStream;\r
-import java.io.InputStreamReader;\r
-import java.lang.ProcessBuilder;\r
-import java.util.ArrayList;\r
-import java.util.LinkedList;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
 /**\r
   GenFvImageTask\r
   \r
@@ -39,10 +30,6 @@ import java.util.Map;
   \r
 **/\r
 public class GenFvImageTask extends Task implements EfiDefine{\r
-    ///\r
-    /// tool name\r
-    ///\r
-    static final private String toolName = "GenFvImage";\r
     ///\r
     /// The name of input inf file\r
     ///\r
@@ -51,15 +38,7 @@ public class GenFvImageTask extends Task implements EfiDefine{
     /// The target architecture.\r
     ///\r
     private String arch="";\r
-    ///\r
-    /// Output directory\r
-    ///\r
-    private String outputDir = ".";\r
-    ///\r
-    /// argument list\r
-    ///\r
-    LinkedList<String> argList = new LinkedList<String>();\r
-\r
+    \r
     /**\r
       execute\r
       \r
@@ -68,45 +47,68 @@ public class GenFvImageTask extends Task implements EfiDefine{
     **/\r
     public void execute() throws BuildException  {\r
         Project project = this.getOwningTarget().getProject();\r
-        String path = project.getProperty("env.Framework_Tools_Path");\r
-        if (path == null) {\r
+        String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");\r
+        String command = "";\r
+        \r
+        if (path == null){\r
             path = "";\r
-        } else {\r
-            path += File.separatorChar;\r
+        }else {\r
+            path = path + File.separatorChar;\r
         }\r
-\r
-        if (arch != null && arch.length() > 0) {\r
-            argList.addFirst(path + toolName + "_" + arch);\r
-        } else {\r
-            argList.addFirst(path + toolName);\r
+        \r
+        if (arch.equalsIgnoreCase("")){\r
+            command = path + "GenFvImage";\r
         }\r
-\r
-        ///\r
-        /// lauch the program\r
-        ///\r
-        ProcessBuilder pb = new ProcessBuilder(argList);\r
-        pb.directory(new File(outputDir));\r
-        int exitCode = 0;\r
+        if (arch.equalsIgnoreCase("ia32")){\r
+            command = path + "GenFvImage_IA32";\r
+        }   \r
+        if (arch.equalsIgnoreCase("x64")){\r
+            command = path + "GenFvImage_X64";\r
+        }\r
+        if (arch.equalsIgnoreCase("ipf")){\r
+            command = path + "GenFvImage_IPF";\r
+        }\r
+        String argument = infFile;\r
+        \r
         try {\r
-            Process cmdProc = pb.start();\r
-            InputStreamReader cmdOut = new InputStreamReader(cmdProc.getInputStream());\r
-            char[] buf = new char[1024];\r
-\r
-            exitCode = cmdProc.waitFor();\r
-            if (exitCode != 0) {\r
-                int len = cmdOut.read(buf, 0, 1024);\r
-                log(new String(buf, 0, len), Project.MSG_ERR);\r
+            \r
+            Commandline commandLine = new Commandline();\r
+            commandLine.setExecutable(command);\r
+            commandLine.createArgument().setLine(argument);\r
+            \r
+            LogStreamHandler streamHandler = new LogStreamHandler(this,\r
+                                                   Project.MSG_INFO,\r
+                                                   Project.MSG_WARN);\r
+            //\r
+            // create a execute object and set it's commandline\r
+            //\r
+            Execute runner = new Execute(streamHandler,null);\r
+            runner.setAntRun(project);\r
+            runner.setCommandline(commandLine.getCommandline());            \r
+            System.out.println(Commandline.toString(commandLine.getCommandline()));\r
+            \r
+            int revl = -1;\r
+            //\r
+            //  user execute class call external programs - GenFvImage\r
+            //\r
+            revl = runner.execute();\r
+            // \r
+            // execute command line success!\r
+            //\r
+            if (EFI_SUCCESS == revl){\r
+                System.out.println("GenFvImage succeeded!");\r
             } else {\r
-                log("GenFvImage - DONE!", Project.MSG_VERBOSE);\r
+                \r
+            // \r
+            // execute command line failed! \r
+            //\r
+                throw new BuildException("GenFvImage failed !(error =" + \r
+                    Integer.toHexString(revl) + ")");\r
             }\r
+            \r
         } catch (Exception e) {\r
-            throw new BuildException(e.getMessage());\r
-        } finally {\r
-            if (exitCode != 0) {\r
-                throw new BuildException("GenFvImage: failed to generate FV file!");\r
-            }\r
-        }\r
-\r
+            System.out.println(e.getMessage());\r
+        }       \r
     }\r
     /**\r
       getInfFile\r
@@ -126,9 +128,7 @@ public class GenFvImageTask extends Task implements EfiDefine{
       @param infFile  name of infFile\r
     **/\r
     public void setInfFile(String infFile) {\r
-        this.infFile = infFile;\r
-        argList.add("-I");\r
-        argList.add(infFile);\r
+        this.infFile = "-I " + infFile;\r
     }\r
     \r
     /**\r
@@ -150,27 +150,5 @@ public class GenFvImageTask extends Task implements EfiDefine{
     **/\r
     public void setArch(String arch) {\r
         this.arch = arch;\r
-    }\r
-\r
-    /**\r
-      getOutputDir\r
-      \r
-      This function is to get output directory.\r
-      \r
-      @return                Path of output directory.\r
-    **/\r
-    public String getOutputDir() {\r
-        return outputDir;\r
-    }\r
-\r
-    /**\r
-      setOutputDir\r
-      \r
-      This function is to set output directory.\r
-      \r
-      @param outputDir        The output direcotry.\r
-    **/\r
-    public void setOutputDir(String outputDir) {\r
-        this.outputDir = outputDir;\r
-    }\r
+    }   \r
 }
\ No newline at end of file
index 61aefa6..1995d70 100644 (file)
@@ -59,11 +59,11 @@ public class GenSectionTask extends Task implements EfiDefine {
         //\r
         // absolute path of efi tools\r
         //\r
-        String path = project.getProperty("env.Framework_Tools_Path");\r
+        String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");\r
         if (path == null) {\r
-            command = "GenSection";\r
+            command = "gensection";\r
         } else {\r
-            command = path + "/" + "GenSection";\r
+            command = path + "/" + "gensection";\r
         }\r
         //\r
         // argument of tools\r
@@ -93,7 +93,7 @@ public class GenSectionTask extends Task implements EfiDefine {
                 //\r
                 // command execution success\r
                 //\r
-                System.out.println("gensection succeeded!");\r
+                System.out.println("gensection successed!");\r
             } else {\r
                 //\r
                 // command execution fail\r
index 69feb4e..ebccca4 100644 (file)
@@ -96,7 +96,7 @@ public class GuidChkTask extends Task implements EfiDefine{
     //   \r
     public void execute() throws BuildException {\r
         Project project = this.getOwningTarget().getProject();\r
-        String path = project.getProperty("env.Framework_Tools_Path");\r
+        String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");\r
         String command;\r
         if (path == null) {\r
             command = "GuidChk";\r
index a90d362..c538403 100644 (file)
@@ -74,7 +74,7 @@ public class MakeDeps extends Task {
         }\r
 \r
         Project prj  = this.getOwningTarget().getProject();\r
-        String  toolPath = prj.getProperty("env.Framework_Tools_Path");\r
+        String  toolPath = prj.getProperty("env.FRAMEWORK_TOOLS_PATH");\r
         ///\r
         /// compose full tool path\r
         ///\r
index 3557647..b4e153d 100644 (file)
@@ -53,7 +53,7 @@ public class SectFile implements Section {
   \r
      @param   Buffer  buffer to contain the section file content with alignment\r
      **/\r
-    public void toBuffer (DataOutputStream Buffer){\r
+    public void toBuffer (DataOutputStream buffer, DataOutputStream orgBuffer){\r
         File   sectFile;\r
         byte   data;\r
         long   fileLen;\r
@@ -83,7 +83,11 @@ public class SectFile implements Section {
             int i = 0;\r
             while (i < fileLen) {\r
                 data = In.readByte();\r
-                Buffer.writeByte(data);\r
+                buffer.writeByte(data);\r
+                //\r
+                // Add data to org file \r
+                //\r
+                orgBuffer.writeByte(data);\r
                 i++;\r
             }\r
 \r
@@ -92,7 +96,11 @@ public class SectFile implements Section {
             ///\r
             while ((fileLen & 0x03)!= 0) {\r
                 fileLen ++;\r
-                Buffer.writeByte(0);\r
+                buffer.writeByte(0);\r
+                //\r
+                // Add data to org file \r
+                //\r
+                orgBuffer.writeByte(0);\r
             } \r
 \r
             ///\r
index 3f56eaf..6abee52 100644 (file)
@@ -19,5 +19,5 @@ import java.io.DataOutputStream;
  Section interface is for geting the contain buffer form compress, tool, and sectFile  \r
  **/\r
 public interface Section {\r
-    public void toBuffer (DataOutputStream Buffer);\r
+    public void toBuffer (DataOutputStream buffer, DataOutputStream orgBuffer);\r
 }
\ No newline at end of file
index af04702..bf0a754 100644 (file)
@@ -46,7 +46,7 @@ public class SetStampTask extends Task implements EfiDefine {
         ///\r
         /// absolute path of edk tools\r
         ///\r
-        String path = project.getProperty("env.Framework_Tools_Path");\r
+        String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");\r
         String command;\r
         if (path == null) {\r
             command = "setstamp";\r
@@ -82,7 +82,7 @@ public class SetStampTask extends Task implements EfiDefine {
                 ///\r
                 /// command execution success\r
                 ///\r
-                System.out.println("SetStamp execute succeeded!");\r
+                System.out.println("SetStamp execute successed!");\r
             } else {\r
                 ///\r
                 /// command execution fail\r
@@ -133,4 +133,4 @@ public class SetStampTask extends Task implements EfiDefine {
         return this.timeFile;\r
     }\r
 \r
-}\r
+}
\ No newline at end of file
index c136f15..8368caa 100644 (file)
@@ -108,12 +108,12 @@ public class StrGatherTask extends Task implements EfiDefine {
         ///\r
         /// absolute path of efi tools\r
         ///\r
-        String path = project.getProperty("env.Framework_Tools_Path"); \r
+        String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH"); \r
         String command;\r
         if (path == null) {\r
-            command = "StrGather";\r
+            command = "strgather";\r
         } else {\r
-            command = path + "/" + "StrGather";\r
+            command = path + "/" + "strgather";\r
         }\r
 \r
         ///\r
index 36b095a..c784a50 100644 (file)
@@ -39,7 +39,7 @@ public class Tool implements EfiDefine, Section {
 \r
      @param     buffer  The buffer to put the result with alignment\r
      **/\r
-    public void toBuffer (DataOutputStream buffer){\r
+    public void toBuffer (DataOutputStream buffer, DataOutputStream orgBuffer){\r
         File           OutputFile;\r
         byte           data;\r
 \r
@@ -72,6 +72,10 @@ public class Tool implements EfiDefine, Section {
             while (i < fileLen) {\r
                 data = In.readByte();\r
                 buffer.writeByte(data);\r
+                //\r
+                // Add data to org file\r
+                //\r
+                orgBuffer.writeByte(data);\r
                 i ++;\r
             }\r
 \r
@@ -81,6 +85,7 @@ public class Tool implements EfiDefine, Section {
             while ((fileLen & 0x03) != 0) {\r
                 fileLen++;\r
                 buffer.writeByte(0);\r
+                orgBuffer.writeByte(0);\r
             }\r
             In.close();\r
 \r
index dbd796e..cf2fe1e 100644 (file)
@@ -153,7 +153,7 @@ public class VfrCompilerTask extends Task implements EfiDefine {
      **/\r
     public void execute() throws BuildException {\r
         Project project = this.getProject();\r
-        String  toolPath= project.getProperty("env.Framework_Tools_Path");\r
+        String  toolPath= project.getProperty("env.FRAMEWORK_TOOLS_PATH");\r
         String  command;\r
         if (toolPath == null) {\r
             command = "VfrCompile";\r
index 99a33bc..a39e35e 100644 (file)
@@ -62,7 +62,7 @@ if not exist %XMLBEANS_HOME%\lib\saxon8.jar goto no_saxon8
 @REM\r
 set WORKSPACE=%CD%\r
 \r
-set Framework_Tools_Path=%WORKSPACE%\Tools\bin\r
+set FRAMEWORK_TOOLS_PATH=%WORKSPACE%\Tools\bin\r
 set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;%XMLBEANS_HOME%\bin;%Framework_Tools_Path%;%PATH%\r
 \r
 echo.\r