BaseTools: Add FMMT Python Tool
The FMMT python tool is used for firmware files operation, which has the Fv/FFs-based 'View'&'Add'&'Delete'&'Replace' operation function: 1.Parse a FD(Firmware Device) / FV(Firmware Volume) / FFS(Firmware Files) 2.Add a new FFS into a FV file (both included in a FD file or not) 3.Replace an FFS in a FV file with a new FFS file 4.Delete an FFS in a FV file (both included in a FD file or not) 5.Extract the FFS from a FV file (both included in a FD file or not) This version of FMMT Python tool does not support PEIM rebase feature, this feature will be added in future update. Currently the FMMT C tool is saved in edk2-staging repo, but its quality and coding style can't meet the Edk2 quality, which is hard to maintain (Hard/Duplicate Code; Regression bugs; Restrict usage). The new Python version keeps same functions with origin C version. It has higher quality and better coding style, and it is much easier to extend new functions and to maintain. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1847 RFC Link: https://edk2.groups.io/g/devel/message/82877 Staging Link: https://github.com/tianocore/edk2-staging/tree/PyFMMT Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
committed by
mergify[bot]
parent
101f4c7892
commit
a64b944942
14
BaseTools/BinWrappers/PosixLike/FMMT
Executable file
14
BaseTools/BinWrappers/PosixLike/FMMT
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
#python `dirname $0`/RunToolFromSource.py `basename $0` $*
|
||||
|
||||
# If a ${PYTHON_COMMAND} command is available, use it in preference to python
|
||||
if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then
|
||||
python_exe=${PYTHON_COMMAND}
|
||||
fi
|
||||
|
||||
full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
|
||||
dir=$(dirname "$full_cmd")
|
||||
cmd=${full_cmd##*/}
|
||||
|
||||
export PYTHONPATH="$dir/../../Source/Python:$dir/../../Source/Python/FMMT:$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}"
|
||||
exec "${python_exe:-python}" -m $cmd.$cmd "$@"
|
4
BaseTools/BinWrappers/WindowsLike/FMMT.bat
Normal file
4
BaseTools/BinWrappers/WindowsLike/FMMT.bat
Normal file
@@ -0,0 +1,4 @@
|
||||
@setlocal
|
||||
@set ToolName=%~n0%
|
||||
@set PYTHONPATH=%PYTHONPATH%;%BASE_TOOLS_PATH%\Source\Python;%BASE_TOOLS_PATH%\Source\Python\FMMT
|
||||
@%PYTHON_COMMAND% -m %ToolName%.%ToolName% %*
|
Reference in New Issue
Block a user