]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/FfsInfStatement.py
There is a limitation on WINDOWS OS for the length of entire file path can’t be large...
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / FfsInfStatement.py
index feab8c84a097f326c0157dbd861b3df08879c8a2..a7a65919d7cd977d6f3c12f5769e01cb66f362e1 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process FFS generation from INF statement\r
 #\r
-#  Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -16,8 +16,7 @@
 # Import Modules\r
 #\r
 import Rule\r
-import os\r
-import shutil\r
+import Common.LongFilePathOs as os\r
 import StringIO\r
 from struct import *\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
@@ -38,6 +37,8 @@ from FvImageSection import FvImageSection
 from Common.Misc import PeImageClass\r
 from AutoGen.GenDepex import DependencyExpression\r
 from PatchPcdValue.PatchPcdValue import PatchBinaryFile\r
+from Common.LongFilePathSupport import CopyLongFilePath\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## generate FFS from INF\r
 #\r
@@ -322,7 +323,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
             return EfiFile\r
         Basename = os.path.basename(EfiFile)\r
         Output = os.path.join(self.OutputPath, Basename)\r
-        shutil.copy(EfiFile, Output)\r
+        CopyLongFilePath(EfiFile, Output)\r
         for Pcd in self.PatchPcds:\r
             RetVal, RetStr = PatchBinaryFile(Output, int(Pcd.Offset, 0), Pcd.DatumType, Pcd.DefaultValue, Pcd.MaxDatumSize)\r
             if RetVal:\r
@@ -648,8 +649,8 @@ class FfsInfStatement(FfsInfStatementClassObject):
                 if not NoStrip:\r
                     FileBeforeStrip = os.path.join(self.OutputPath, ModuleName + '.reloc')\r
                     if not os.path.exists(FileBeforeStrip) or \\r
-                        (os.path.getmtime(File) > os.path.getmtime(FileBeforeStrip)):\r
-                        shutil.copyfile(File, FileBeforeStrip)\r
+                           (os.path.getmtime(File) > os.path.getmtime(FileBeforeStrip)):\r
+                        CopyLongFilePath(File, FileBeforeStrip)\r
                     StrippedFile = os.path.join(self.OutputPath, ModuleName + '.stipped')\r
                     GenFdsGlobalVariable.GenerateFirmwareImage(\r
                                             StrippedFile,\r
@@ -687,8 +688,9 @@ class FfsInfStatement(FfsInfStatementClassObject):
             if not NoStrip:\r
                 FileBeforeStrip = os.path.join(self.OutputPath, ModuleName + '.reloc')\r
                 if not os.path.exists(FileBeforeStrip) or \\r
-                    (os.path.getmtime(GenSecInputFile) > os.path.getmtime(FileBeforeStrip)):\r
-                    shutil.copyfile(GenSecInputFile, FileBeforeStrip)\r
+                       (os.path.getmtime(GenSecInputFile) > os.path.getmtime(FileBeforeStrip)):\r
+                    CopyLongFilePath(GenSecInputFile, FileBeforeStrip)\r
+\r
                 StrippedFile = os.path.join(self.OutputPath, ModuleName + '.stipped')\r
                 GenFdsGlobalVariable.GenerateFirmwareImage(\r
                                         StrippedFile,\r