[PATCH v3 1/3] image-fit.c: introduce CONTROL_DTB_AS_FIT config knob

Simon Glass sjg at chromium.org
Sat May 30 00:02:51 CEST 2026


Hi Rasmus,

On 2026-05-29T19:46:18, Rasmus Villemoes <rv at rasmusvillemoes.dk> wrote:
> image-fit.c: introduce CONTROL_DTB_AS_FIT config knob
>
> Having scripts embedded one way or the other in the U-Boot binary
> means they are automatically verified/trusted by whatever mechanism
> verifies U-Boot.
>
> Writing those scripts in the built-in environment leads to
> backslatitis and missing or wrong quoting and is generally not very
> readable or maintainable.
>
> Maintaining scripts in external files allows one
> to have both syntax highlighting and to some extent apply shellcheck
> on it (though U-Boot's shell is of course not quite POSIX sh, so some
> '#shellcheck disable' directives are needed). Getting those into the
> U-Boot binary is then a matter of having a suitable .dtsi file such as
>
> / {
>         images {
>                 default = 'boot';
>                 boot {
> [...]
>
> boot/Kconfig     | 13 +++++++++++++
>  boot/image-fit.c | 21 +++++++++++++++------
>  2 files changed, 28 insertions(+), 6 deletions(-)

> diff --git a/boot/image-fit.c b/boot/image-fit.c
> @@ -1676,6 +1686,10 @@ int fit_check_format(const void *fit, ulong size)
> +     /* For the control DTB to act as a FIT image, we only require an /images node. */
> +     if (CONFIG_IS_ENABLED(CONTROL_DTB_AS_FIT) && fit == gd_fdt_blob())
> +             return fit_check_images_node(fit);

Please wrap this comment to 80 columns

Reviewed-by: Simon Glass <sjg at chromium.org>

Regards,
Simon


More information about the U-Boot mailing list