diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.py index eb130049b5..73ab877c71 100644 --- a/IntelFsp2Pkg/Tools/PatchFv.py +++ b/IntelFsp2Pkg/Tools/PatchFv.py @@ -165,6 +165,17 @@ class Symbols: if not os.path.isdir(fvDir): raise Exception ("'%s' is not a valid directory!" % fvDir) + # + # if user provided fd name as a input, skip rest of the flow to + # patch fd directly + # + fdFile = os.path.join(fvDir,fvNames + ".fd") + if os.path.exists(fdFile): + print("Tool identified Fd file as a input to patch '%s'" %fdFile) + self.fdFile = fdFile + self.fdSize = os.path.getsize(fdFile) + return 0 + # # If the Guid.xref is not existing in fvDir, then raise an exception # @@ -848,8 +859,9 @@ class Symbols: # Print out the usage # def Usage(): - print ("PatchFv Version 0.50") + print ("PatchFv Version 0.60") print ("Usage: \n\tPatchFv FvBuildDir [FvFileBaseNames:]FdFileBaseNameToPatch \"Offset, Value\"") + print ("\tPatchFv FdFileDir FdFileName \"Offset, Value\"") def main(): # diff --git a/IntelFsp2Pkg/Tools/UserManuals/PatchFvUserManual.md b/IntelFsp2Pkg/Tools/UserManuals/PatchFvUserManual.md index 5f1031e729..f28eedf625 100644 --- a/IntelFsp2Pkg/Tools/UserManuals/PatchFvUserManual.md +++ b/IntelFsp2Pkg/Tools/UserManuals/PatchFvUserManual.md @@ -1,6 +1,7 @@ #Name **_PatchFv.py_** - The python script that patches the firmware volumes (**FV**) with in the flash device (**FD**) file post FSP build. +From version 0.60, script is capable of patching flash device (**FD**) directly. #Synopsis @@ -10,6 +11,12 @@ PatchFv FvBuildDir [FvFileBaseNames:]FdFileBaseNameToPatch ["Offset, Value"]+ | ["Offset, Value, $Command"]+ | ["Offset, Value, $Command, @Comment"]+ ``` +``` +PatchFv FdFileDir FdFileName ["Offset, Value"]+ + | ["Offset, Value, @Comment"]+ + | ["Offset, Value, $Command"]+ + | ["Offset, Value, $Command, @Comment"]+ +``` #Description The **_PatchFv.py_** tool allows the developer to fix up FD images to follow the @@ -102,6 +109,19 @@ ModuleGuid:Offset < > Convert absolute address into an image offset (expr & FSP_SIZE) ``` +From version 0.60 tool allows to pass flash device file path as Argument 1 and +flash device name as Argument 2 and rules for passing offset & value are same +as explained in the previous sections. + +####Example usage: +Argument 1 +``` + YouPlatformFspBinPkg\ +``` +Argument 2 +``` + Fsp_Rebased_T +``` ###Special Commands: Special commands must use the **$** symbol as a prefix to the command itself.