diff options
Diffstat (limited to 'BaseTools/Source/Python/FMMT/FMMT.py')
-rw-r--r-- | BaseTools/Source/Python/FMMT/FMMT.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/FMMT/FMMT.py b/BaseTools/Source/Python/FMMT/FMMT.py index 3590f3340e..bf580b3843 100644 --- a/BaseTools/Source/Python/FMMT/FMMT.py +++ b/BaseTools/Source/Python/FMMT/FMMT.py @@ -41,6 +41,8 @@ parser.add_argument("-c", "--ConfigFilePath", dest="ConfigFilePath", nargs='+', FmmtConf file saves the target guidtool used in compress/uncompress process.\
If do not provide, FMMT tool will search the inputfile folder for FmmtConf.ini firstly, if not found,\
the FmmtConf.ini saved in FMMT tool's folder will be used as default.")
+parser.add_argument("-s", "--ShrinkFv", dest="ShrinkFv", nargs='+',
+ help="Shrink the Fv file: '-s InputFvfile OutputFvfile")
def print_banner():
print("")
@@ -111,6 +113,9 @@ class FMMT(): else:
ReplaceFfs(inputfile, self.CheckFfsName(Ffs_name), newffsfile, outputfile)
+ def Shrink(self,inputfile: str, outputfile: str) -> None:
+ self.SetDestPath(inputfile)
+ ShrinkFv(inputfile, outputfile)
def main():
args=parser.parse_args()
@@ -142,6 +147,8 @@ def main(): fmmt.Replace(args.Replace[0],args.Replace[2],args.Replace[3],args.Replace[4],args.Replace[1])
else:
fmmt.Replace(args.Replace[0],args.Replace[1],args.Replace[2],args.Replace[3])
+ elif args.ShrinkFv:
+ fmmt.Shrink(args.ShrinkFv[0], args.ShrinkFv[1])
else:
parser.print_help()
except Exception as e:
|