summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/GenFds
diff options
context:
space:
mode:
authorHess Chen <hesheng.chen@intel.com>2014-08-15 03:06:48 +0000
committerhchen30 <hchen30@6f19259b-4bc3-4df7-8a09-765794883524>2014-08-15 03:06:48 +0000
commit1be2ed90a20618d71ddf34b8a07d038da0b36854 (patch)
tree468f6ad18b924e3a58c180403f96d5afcd47a4f9 /BaseTools/Source/Python/GenFds
parentb8a13d736961faff0d11241a0428abc44a084d6e (diff)
There is a limitation on WINDOWS OS for the length of entire file path can’t be larger than 255. There is an OS API provided by Microsoft to add “\\?\” before the path header to support the long file path. Enable this feature on basetools.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15809 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/GenFds')
-rw-r--r--BaseTools/Source/Python/GenFds/AprioriSection.py4
-rw-r--r--BaseTools/Source/Python/GenFds/Capsule.py4
-rw-r--r--BaseTools/Source/Python/GenFds/CompressSection.py2
-rw-r--r--BaseTools/Source/Python/GenFds/DataSection.py13
-rw-r--r--BaseTools/Source/Python/GenFds/DepexSection.py5
-rw-r--r--BaseTools/Source/Python/GenFds/EfiSection.py11
-rw-r--r--BaseTools/Source/Python/GenFds/Fd.py4
-rw-r--r--BaseTools/Source/Python/GenFds/FdfParser.py3
-rw-r--r--BaseTools/Source/Python/GenFds/FfsFileStatement.py4
-rw-r--r--BaseTools/Source/Python/GenFds/FfsInfStatement.py18
-rw-r--r--BaseTools/Source/Python/GenFds/Fv.py9
-rw-r--r--BaseTools/Source/Python/GenFds/FvImageSection.py4
-rw-r--r--BaseTools/Source/Python/GenFds/GenFds.py6
-rw-r--r--BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py5
-rw-r--r--BaseTools/Source/Python/GenFds/GuidSection.py5
-rw-r--r--BaseTools/Source/Python/GenFds/OptRomFileStatement.py4
-rw-r--r--BaseTools/Source/Python/GenFds/OptionRom.py5
-rw-r--r--BaseTools/Source/Python/GenFds/Region.py5
-rw-r--r--BaseTools/Source/Python/GenFds/Section.py4
-rw-r--r--BaseTools/Source/Python/GenFds/UiSection.py5
-rw-r--r--BaseTools/Source/Python/GenFds/VerSection.py5
-rw-r--r--BaseTools/Source/Python/GenFds/Vtf.py5
22 files changed, 69 insertions, 61 deletions
diff --git a/BaseTools/Source/Python/GenFds/AprioriSection.py b/BaseTools/Source/Python/GenFds/AprioriSection.py
index a6dace82a..a2306d062 100644
--- a/BaseTools/Source/Python/GenFds/AprioriSection.py
+++ b/BaseTools/Source/Python/GenFds/AprioriSection.py
@@ -1,7 +1,7 @@
## @file
# process APRIORI file data and generate PEI/DXE APRIORI file
#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -16,7 +16,7 @@
# Import Modules
#
from struct import *
-import os
+import Common.LongFilePathOs as os
import StringIO
import FfsFileStatement
from GenFdsGlobalVariable import GenFdsGlobalVariable
diff --git a/BaseTools/Source/Python/GenFds/Capsule.py b/BaseTools/Source/Python/GenFds/Capsule.py
index fb9213b46..85f95a69c 100644
--- a/BaseTools/Source/Python/GenFds/Capsule.py
+++ b/BaseTools/Source/Python/GenFds/Capsule.py
@@ -1,7 +1,7 @@
## @file
# generate capsule
#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -17,7 +17,7 @@
#
from GenFdsGlobalVariable import GenFdsGlobalVariable
from CommonDataClass.FdfClass import CapsuleClassObject
-import os
+import Common.LongFilePathOs as os
import subprocess
import StringIO
from Common.Misc import SaveFileOnChange
diff --git a/BaseTools/Source/Python/GenFds/CompressSection.py b/BaseTools/Source/Python/GenFds/CompressSection.py
index 4bcf286c2..9d9c9cfdf 100644
--- a/BaseTools/Source/Python/GenFds/CompressSection.py
+++ b/BaseTools/Source/Python/GenFds/CompressSection.py
@@ -1,7 +1,7 @@
## @file
# process compress section generation
#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
diff --git a/BaseTools/Source/Python/GenFds/DataSection.py b/BaseTools/Source/Python/GenFds/DataSection.py
index 0f41953ad..ba3677ed8 100644
--- a/BaseTools/Source/Python/GenFds/DataSection.py
+++ b/BaseTools/Source/Python/GenFds/DataSection.py
@@ -1,7 +1,7 @@
## @file
# process data section generation
#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -19,10 +19,10 @@ import Section
from GenFdsGlobalVariable import GenFdsGlobalVariable
import subprocess
from Ffs import Ffs
-import os
+import Common.LongFilePathOs as os
from CommonDataClass.FdfClass import DataSectionClassObject
from Common.Misc import PeImageClass
-import shutil
+from Common.LongFilePathSupport import CopyLongFilePath
## generate data section
#
@@ -71,9 +71,8 @@ class DataSection (DataSectionClassObject):
MapFile = Filename.replace('.efi', '.map')
if os.path.exists(MapFile):
CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')
- if not os.path.exists(CopyMapFile) or \
- (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):
- shutil.copyfile(MapFile, CopyMapFile)
+ if not os.path.exists(CopyMapFile) or (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):
+ CopyLongFilePath(MapFile, CopyMapFile)
#Get PE Section alignment when align is set to AUTO
if self.Alignment == 'Auto' and self.SecType in ('TE', 'PE32'):
@@ -92,7 +91,7 @@ class DataSection (DataSectionClassObject):
FileBeforeStrip = os.path.join(OutputPath, ModuleName + '.efi')
if not os.path.exists(FileBeforeStrip) or \
(os.path.getmtime(self.SectFileName) > os.path.getmtime(FileBeforeStrip)):
- shutil.copyfile(self.SectFileName, FileBeforeStrip)
+ CopyLongFilePath(self.SectFileName, FileBeforeStrip)
StrippedFile = os.path.join(OutputPath, ModuleName + '.stripped')
GenFdsGlobalVariable.GenerateFirmwareImage(
StrippedFile,
diff --git a/BaseTools/Source/Python/GenFds/DepexSection.py b/BaseTools/Source/Python/GenFds/DepexSection.py
index b7b1ae7d9..c048efe47 100644
--- a/BaseTools/Source/Python/GenFds/DepexSection.py
+++ b/BaseTools/Source/Python/GenFds/DepexSection.py
@@ -1,7 +1,7 @@
## @file
# process depex section generation
#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -19,10 +19,9 @@ import Section
from GenFdsGlobalVariable import GenFdsGlobalVariable
import subprocess
from Ffs import Ffs
-import os
+import Common.LongFilePathOs as os
from CommonDataClass.FdfClass import DepexSectionClassObject
from AutoGen.GenDepex import DependencyExpression
-import shutil
from Common import EdkLogger
from Common.BuildToolError import *
diff --git a/BaseTools/Source/Python/GenFds/EfiSection.py b/BaseTools/Source/Python/GenFds/EfiSection.py
index 3eb4e2384..15ebac570 100644
--- a/BaseTools/Source/Python/GenFds/EfiSection.py
+++ b/BaseTools/Source/Python/GenFds/EfiSection.py
@@ -20,12 +20,13 @@ import Section
from GenFdsGlobalVariable import GenFdsGlobalVariable
import subprocess
from Ffs import Ffs
-import os
+import Common.LongFilePathOs as os
from CommonDataClass.FdfClass import EfiSectionClassObject
-import shutil
from Common import EdkLogger
from Common.BuildToolError import *
from Common.Misc import PeImageClass
+from Common.LongFilePathSupport import OpenLongFilePath as open
+from Common.LongFilePathSupport import CopyLongFilePath
## generate rule section
#
@@ -237,14 +238,14 @@ class EfiSection (EfiSectionClassObject):
if os.path.exists(MapFile):
CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')
if not os.path.exists(CopyMapFile) or \
- (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):
- shutil.copyfile(MapFile, CopyMapFile)
+ (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):
+ CopyLongFilePath(MapFile, CopyMapFile)
if not NoStrip:
FileBeforeStrip = os.path.join(OutputPath, ModuleName + '.efi')
if not os.path.exists(FileBeforeStrip) or \
(os.path.getmtime(File) > os.path.getmtime(FileBeforeStrip)):
- shutil.copyfile(File, FileBeforeStrip)
+ CopyLongFilePath(File, FileBeforeStrip)
StrippedFile = os.path.join(OutputPath, ModuleName + '.stripped')
GenFdsGlobalVariable.GenerateFirmwareImage(
StrippedFile,
diff --git a/BaseTools/Source/Python/GenFds/Fd.py b/BaseTools/Source/Python/GenFds/Fd.py
index 3716549cb..0c06ff57d 100644
--- a/BaseTools/Source/Python/GenFds/Fd.py
+++ b/BaseTools/Source/Python/GenFds/Fd.py
@@ -1,7 +1,7 @@
## @file
# process FD generation
#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -17,7 +17,7 @@
#
import Region
import Fv
-import os
+import Common.LongFilePathOs as os
import StringIO
import sys
from struct import *
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py
index f1e03f4c3..01dab7bda 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -55,7 +55,8 @@ from Common.String import ReplaceMacro
from Common.Misc import tdict
import re
-import os
+import Common.LongFilePathOs as os
+from Common.LongFilePathSupport import OpenLongFilePath as open
##define T_CHAR_SPACE ' '
##define T_CHAR_NULL '\0'
diff --git a/BaseTools/Source/Python/GenFds/FfsFileStatement.py b/BaseTools/Source/Python/GenFds/FfsFileStatement.py
index d0dec380f..a765f9e04 100644
--- a/BaseTools/Source/Python/GenFds/FfsFileStatement.py
+++ b/BaseTools/Source/Python/GenFds/FfsFileStatement.py
@@ -1,7 +1,7 @@
## @file
# process FFS generation from FILE statement
#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -17,7 +17,7 @@
#
import Ffs
import Rule
-import os
+import Common.LongFilePathOs as os
import StringIO
import subprocess
diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
index feab8c84a..a7a65919d 100644
--- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py
+++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
@@ -1,7 +1,7 @@
## @file
# process FFS generation from INF statement
#
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -16,8 +16,7 @@
# Import Modules
#
import Rule
-import os
-import shutil
+import Common.LongFilePathOs as os
import StringIO
from struct import *
from GenFdsGlobalVariable import GenFdsGlobalVariable
@@ -38,6 +37,8 @@ from FvImageSection import FvImageSection
from Common.Misc import PeImageClass
from AutoGen.GenDepex import DependencyExpression
from PatchPcdValue.PatchPcdValue import PatchBinaryFile
+from Common.LongFilePathSupport import CopyLongFilePath
+from Common.LongFilePathSupport import OpenLongFilePath as open
## generate FFS from INF
#
@@ -322,7 +323,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
return EfiFile
Basename = os.path.basename(EfiFile)
Output = os.path.join(self.OutputPath, Basename)
- shutil.copy(EfiFile, Output)
+ CopyLongFilePath(EfiFile, Output)
for Pcd in self.PatchPcds:
RetVal, RetStr = PatchBinaryFile(Output, int(Pcd.Offset, 0), Pcd.DatumType, Pcd.DefaultValue, Pcd.MaxDatumSize)
if RetVal:
@@ -648,8 +649,8 @@ class FfsInfStatement(FfsInfStatementClassObject):
if not NoStrip:
FileBeforeStrip = os.path.join(self.OutputPath, ModuleName + '.reloc')
if not os.path.exists(FileBeforeStrip) or \
- (os.path.getmtime(File) > os.path.getmtime(FileBeforeStrip)):
- shutil.copyfile(File, FileBeforeStrip)
+ (os.path.getmtime(File) > os.path.getmtime(FileBeforeStrip)):
+ CopyLongFilePath(File, FileBeforeStrip)
StrippedFile = os.path.join(self.OutputPath, ModuleName + '.stipped')
GenFdsGlobalVariable.GenerateFirmwareImage(
StrippedFile,
@@ -687,8 +688,9 @@ class FfsInfStatement(FfsInfStatementClassObject):
if not NoStrip:
FileBeforeStrip = os.path.join(self.OutputPath, ModuleName + '.reloc')
if not os.path.exists(FileBeforeStrip) or \
- (os.path.getmtime(GenSecInputFile) > os.path.getmtime(FileBeforeStrip)):
- shutil.copyfile(GenSecInputFile, FileBeforeStrip)
+ (os.path.getmtime(GenSecInputFile) > os.path.getmtime(FileBeforeStrip)):
+ CopyLongFilePath(GenSecInputFile, FileBeforeStrip)
+
StrippedFile = os.path.join(self.OutputPath, ModuleName + '.stipped')
GenFdsGlobalVariable.GenerateFirmwareImage(
StrippedFile,
diff --git a/BaseTools/Source/Python/GenFds/Fv.py b/BaseTools/Source/Python/GenFds/Fv.py
index 781c1a045..03a742696 100644
--- a/BaseTools/Source/Python/GenFds/Fv.py
+++ b/BaseTools/Source/Python/GenFds/Fv.py
@@ -1,7 +1,7 @@
## @file
# process FV generation
#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -15,8 +15,7 @@
##
# Import Modules
#
-import os
-import shutil
+import Common.LongFilePathOs as os
import subprocess
import StringIO
from struct import *
@@ -27,6 +26,8 @@ from GenFdsGlobalVariable import GenFdsGlobalVariable
from GenFds import GenFds
from CommonDataClass.FdfClass import FvClassObject
from Common.Misc import SaveFileOnChange
+from Common.LongFilePathSupport import CopyLongFilePath
+from Common.LongFilePathSupport import OpenLongFilePath as open
T_CHAR_LF = '\n'
@@ -128,7 +129,7 @@ class FV (FvClassObject):
FvOutputFile = self.CreateFileName
FvInfoFileName = os.path.join(GenFdsGlobalVariable.FfsDir, self.UiFvName + '.inf')
- shutil.copy(GenFdsGlobalVariable.FvAddressFileName, FvInfoFileName)
+ CopyLongFilePath(GenFdsGlobalVariable.FvAddressFileName, FvInfoFileName)
OrigFvInfo = None
if os.path.exists (FvInfoFileName):
OrigFvInfo = open(FvInfoFileName, 'r').read()
diff --git a/BaseTools/Source/Python/GenFds/FvImageSection.py b/BaseTools/Source/Python/GenFds/FvImageSection.py
index f5d3f4f9a..caf8de11e 100644
--- a/BaseTools/Source/Python/GenFds/FvImageSection.py
+++ b/BaseTools/Source/Python/GenFds/FvImageSection.py
@@ -1,7 +1,7 @@
## @file
# process FV image section generation
#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -20,7 +20,7 @@ import StringIO
from Ffs import Ffs
import subprocess
from GenFdsGlobalVariable import GenFdsGlobalVariable
-import os
+import Common.LongFilePathOs as os
from CommonDataClass.FdfClass import FvImageSectionClassObject
from Common import EdkLogger
from Common.BuildToolError import *
diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py
index c0762edf2..087f7ab35 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -1,7 +1,7 @@
## @file
# generate flash image
#
-# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -17,7 +17,7 @@
#
from optparse import OptionParser
import sys
-import os
+import Common.LongFilePathOs as os
import linecache
import FdfParser
import Common.BuildToolError as BuildToolError
@@ -42,7 +42,7 @@ from Common.BuildVersion import gBUILD_VERSION
## Version and Copyright
versionNumber = "1.0" + ' ' + gBUILD_VERSION
__version__ = "%prog Version " + versionNumber
-__copyright__ = "Copyright (c) 2007 - 2013, Intel Corporation All rights reserved."
+__copyright__ = "Copyright (c) 2007 - 2014, Intel Corporation All rights reserved."
## Tool entrance method
#
diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
index cbf3d980a..f97b41b83 100644
--- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
+++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
@@ -1,7 +1,7 @@
## @file
# Global variables for GenFds
#
-# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -15,7 +15,7 @@
##
# Import Modules
#
-import os
+import Common.LongFilePathOs as os
import sys
import subprocess
import struct
@@ -30,6 +30,7 @@ from Common.ToolDefClassObject import ToolDefClassObject
from AutoGen.BuildEngine import BuildRule
import Common.DataType as DataType
from Common.Misc import PathClass
+from Common.LongFilePathSupport import OpenLongFilePath as open
## Global variables
#
diff --git a/BaseTools/Source/Python/GenFds/GuidSection.py b/BaseTools/Source/Python/GenFds/GuidSection.py
index 36ad4f58e..97d8ba8f7 100644
--- a/BaseTools/Source/Python/GenFds/GuidSection.py
+++ b/BaseTools/Source/Python/GenFds/GuidSection.py
@@ -1,7 +1,7 @@
## @file
# process GUIDed section generation
#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -18,7 +18,7 @@
import Section
import subprocess
from Ffs import Ffs
-import os
+import Common.LongFilePathOs as os
from GenFdsGlobalVariable import GenFdsGlobalVariable
from CommonDataClass.FdfClass import GuidSectionClassObject
from Common import ToolDefClassObject
@@ -26,6 +26,7 @@ import sys
from Common import EdkLogger
from Common.BuildToolError import *
from FvImageSection import FvImageSection
+from Common.LongFilePathSupport import OpenLongFilePath as open
## generate GUIDed section
#
diff --git a/BaseTools/Source/Python/GenFds/OptRomFileStatement.py b/BaseTools/Source/Python/GenFds/OptRomFileStatement.py
index a98d208e1..5e3273d0f 100644
--- a/BaseTools/Source/Python/GenFds/OptRomFileStatement.py
+++ b/BaseTools/Source/Python/GenFds/OptRomFileStatement.py
@@ -1,7 +1,7 @@
## @file
# process OptionROM generation from FILE statement
#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -15,7 +15,7 @@
##
# Import Modules
#
-import os
+import Common.LongFilePathOs as os
from GenFdsGlobalVariable import GenFdsGlobalVariable
##
diff --git a/BaseTools/Source/Python/GenFds/OptionRom.py b/BaseTools/Source/Python/GenFds/OptionRom.py
index ce46413bf..94f77f60e 100644
--- a/BaseTools/Source/Python/GenFds/OptionRom.py
+++ b/BaseTools/Source/Python/GenFds/OptionRom.py
@@ -1,7 +1,7 @@
## @file
# process OptionROM generation
#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -15,8 +15,7 @@
##
# Import Modules
#
-import os
-import shutil
+import Common.LongFilePathOs as os
import subprocess
import StringIO
diff --git a/BaseTools/Source/Python/GenFds/Region.py b/BaseTools/Source/Python/GenFds/Region.py
index 7879a9e29..15b2ecba9 100644
--- a/BaseTools/Source/Python/GenFds/Region.py
+++ b/BaseTools/Source/Python/GenFds/Region.py
@@ -1,7 +1,7 @@
## @file
# process FD Region generation
#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -19,10 +19,11 @@ from struct import *
from GenFdsGlobalVariable import GenFdsGlobalVariable
import StringIO
from CommonDataClass.FdfClass import RegionClassObject
-import os
+import Common.LongFilePathOs as os
from stat import *
from Common import EdkLogger
from Common.BuildToolError import *
+from Common.LongFilePathSupport import OpenLongFilePath as open
## generate Region
#
diff --git a/BaseTools/Source/Python/GenFds/Section.py b/BaseTools/Source/Python/GenFds/Section.py
index 819bb51a7..e32041d6a 100644
--- a/BaseTools/Source/Python/GenFds/Section.py
+++ b/BaseTools/Source/Python/GenFds/Section.py
@@ -1,7 +1,7 @@
## @file
# section base class
#
-# Copyright (c) 2007-2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007-2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -17,7 +17,7 @@
#
from CommonDataClass.FdfClass import SectionClassObject
from GenFdsGlobalVariable import GenFdsGlobalVariable
-import os, glob
+import Common.LongFilePathOs as os, glob
from Common import EdkLogger
from Common.BuildToolError import *
diff --git a/BaseTools/Source/Python/GenFds/UiSection.py b/BaseTools/Source/Python/GenFds/UiSection.py
index e1b69ed13..e4f3647f1 100644
--- a/BaseTools/Source/Python/GenFds/UiSection.py
+++ b/BaseTools/Source/Python/GenFds/UiSection.py
@@ -1,7 +1,7 @@
## @file
# process UI section generation
#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -18,9 +18,10 @@
import Section
from Ffs import Ffs
import subprocess
-import os
+import Common.LongFilePathOs as os
from GenFdsGlobalVariable import GenFdsGlobalVariable
from CommonDataClass.FdfClass import UiSectionClassObject
+from Common.LongFilePathSupport import OpenLongFilePath as open
## generate UI section
#
diff --git a/BaseTools/Source/Python/GenFds/VerSection.py b/BaseTools/Source/Python/GenFds/VerSection.py
index 8f6da9624..657ebd9d1 100644
--- a/BaseTools/Source/Python/GenFds/VerSection.py
+++ b/BaseTools/Source/Python/GenFds/VerSection.py
@@ -1,7 +1,7 @@
## @file
# process Version section generation
#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -17,10 +17,11 @@
#
from Ffs import Ffs
import Section
-import os
+import Common.LongFilePathOs as os
import subprocess
from GenFdsGlobalVariable import GenFdsGlobalVariable
from CommonDataClass.FdfClass import VerSectionClassObject
+from Common.LongFilePathSupport import OpenLongFilePath as open
## generate version section
#
diff --git a/BaseTools/Source/Python/GenFds/Vtf.py b/BaseTools/Source/Python/GenFds/Vtf.py
index e7e36491d..64b5d7713 100644
--- a/BaseTools/Source/Python/GenFds/Vtf.py
+++ b/BaseTools/Source/Python/GenFds/Vtf.py
@@ -1,7 +1,7 @@
## @file
# process VTF generation
#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -16,8 +16,9 @@
# Import Modules
#
from GenFdsGlobalVariable import GenFdsGlobalVariable
-import os
+import Common.LongFilePathOs as os
from CommonDataClass.FdfClass import VtfClassObject
+from Common.LongFilePathSupport import OpenLongFilePath as open
T_CHAR_LF = '\n'
## generate VTF