[PATCH 1/2] tools: binman: fit: support engine override via argument

Quentin Schulz quentin.schulz at cherry.de
Thu May 7 18:03:21 CEST 2026


Hi Julian,

Please follow the instructions for patch submission, c.f. 
https://docs.u-boot.org/en/latest/develop/sending_patches.html#general-patch-submission-rules

Your patches are clearly missing Cc and To recipients to maintainers and 
reviewers. You'll get less eyes on your patches missing those, and 
possibly they'll never be looked at.

On 5/4/26 6:48 PM, julian.haller at bbl.ms.philips.com wrote:
> [You don't often get email from julian.haller at bbl.ms.philips.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> From: Julian Haller <julian.haller at philips.com>
> 
> Allow overriding fit,engine and fit,engine-keydir via arguments,
> enabling engine selection at build time without modifying the device
> tree.
> 

Nice, I like that.

We do need to document and test that though!

Please update the docstring in tools/binman/etype/fit.py to mention the 
environment variables that can be used in lieu of a DT property.

Please add a couple tests in tools/binman/ftest.py to check this works 
as expected.

I see at minimum the following tests to add:

- fit image (.its) without a fit,engine property, but with FIT_ENGINE 
environment variable set,
- fit image (.its) with a fit,engine property AND also FIT_ENGINE 
environment variable (with a different one), the one specified in 
FIT_ENGINE must be used,

> Signed-off-by: Julian Haller <julian.haller at philips.com>
> ---
>   Makefile                  |  2 ++
>   tools/binman/etype/fit.py | 13 +++----------
>   2 files changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 49d9740327e..ffcc639382b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1701,6 +1701,8 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
>                  -a vpl-dtb=$(CONFIG_VPL_OF_REAL) \
>                  -a pre-load-key-path=${PRE_LOAD_KEY_PATH} \
>                  -a of-spl-remove-props=$(CONFIG_OF_SPL_REMOVE_PROPS) \
> +               $(if $(FIT_ENGINE),-a fit$(comma)engine=$(FIT_ENGINE)) \
> +               $(if $(FIT_ENGINE_KEYDIR),-a fit$(comma)engine-keydir=$(FIT_ENGINE_KEYDIR)) \

What if we want to use FIT_ENGINE without a fit,engine-keydir (so we do 
NOT pass FIT_ENGINE_KEYDIR) but it is set in the fit.its? Should we have 
a mechanism to "unset" this property?

I'm thinking, maybe we should check if fit,engine is passed via binman 
arguments instead of DT properties and ignore fit,engine-keydir from the 
DT and only take it if it's from binman arguments too? @Simon/Tom, an 
opinion maybe here? If we go this route, we also need to test those 
cornercases.

Or do we go the other route of forbidding both the binman argument and 
the DT to provide the same property? (in that case, yet another test to 
make sure we fail in that scenario)

Cheers,
Quentin


More information about the U-Boot mailing list