Re: [edk2-devel] RFC: Replace FMMT Tool from C to Python Version

Bob Feng


The PyGen*** tools I mentioned below are not implemented yet. But we want to convert the BaseTools C tools to python tools so we can move all basetools from edk2 repo to edk2-basetools repo.

For the edk2-basetools repo, please refer to the discussion


-----Original Message-----
From: <> On Behalf Of Marvin Häuser
Sent: Friday, October 29, 2021 9:27 PM
To:; Feng, Bob C <bob.c.feng@...>; gaoliming@...; Chen, Christine <yuwei.chen@...>;
Cc: Kinney, Michael D <michael.d.kinney@...>
Subject: Re: [edk2-rfc] [edk2-devel] RFC: Replace FMMT Tool from C to Python Version

Good day,

Is there any information available on PyGenFv? It also handles ELF to PE conversion (who knows why...), is that planned to be ported to Python as well? For Project Amaranth, we are currently implementing a tool to replace the ELF to PE conversion (among other things) and decided to write it in C to leverage the existing EDK II libraries for PE and ELF parsing, rather than re-implementing parsing in a different language.
We'd like to stay compatible with upstream EDK II for as long as possible, and plan to send patches for a tool proposal whenever it is ready (do not expect it before mid next year, if at all).

Best regards,

On 29.10.21 12:43, Bob Feng wrote:


Correct. PyFMMT does not depend on GenSec, GenFfs and GenFv.  Yes. the
future PyGenSec, PyGenFfs and PyGenFv can reuse code from PyFMMT.



*From:* <> *On Behalf Of
*Sent:* Friday, October 29, 2021 10:16 AM
*To:* Chen, Christine <yuwei.chen@...>;;
*Cc:* Feng, Bob C <bob.c.feng@...>; Kinney, Michael D
*Subject:* 回复: [edk2-devel] RFC: Replace FMMT Tool from C to Python


 This is a good news. Thanks for your great work. With this change,
FMMT doesn’t depend on GenSec, GenFfs and GenFv C tool. Right? If yes,
can those logic be reused to replace GenSec, GenFfs and GenFv C tools?



*发件人**:*Chen, Christine <yuwei.chen@...>
*发送时间:* 2021年10月29日 8:33
*抄送:* Feng, Bob C <bob.c.feng@...>; Kinney, Michael D
<michael.d.kinney@...>; Liming Gao <gaoliming@...>
*主题:* [edk2-devel] RFC: Replace FMMT Tool from C to Python Version

Hi everyone,

I would like to propose the new FMMT Python tool, which is used to
replace the origin C version tool.

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.

You can get the FMMT Python tool through below link.

If you are interested in that, pls have a try.

Looking forward to your feedback~


Christine (Yuwei)

Join to automatically receive all group messages.