[PATCH v5 2/3] binman: collection: Set build_done on referenced entries

Simon Glass sjg at chromium.org
Sat Apr 11 19:18:59 CEST 2026


Hi Yan,

On 2026-04-08T15:02:01, Paul HENRYS <paul.henrys_ext at softathome.com> wrote:
> binman: collection: Set build_done on referenced entries
>
> The collection etype uses phandles in the 'content' property to
> reference other entries. Mark each referenced entry with build_done
> to avoid rebuilding the same entry data multiple times.
>
> This is important for cases where rebuilding may change the data
> content, e.g. due to timestamps or random IVs in encryption.
>
> Refactor GetContentsByPhandle() to return both the entry object and
> its data.
>
> Signed-off-by: yan wang <yan.wang at softathome.com>
>
> tools/binman/etype/collection.py | 8 ++++++--
>  tools/binman/etype/section.py    | 5 +++--
>  2 files changed, 9 insertions(+), 4 deletions(-)

> diff --git a/tools/binman/etype/collection.py b/tools/binman/etype/collection.py
> @@ -45,12 +45,16 @@ class Entry_collection(Entry):
> +            # Mark referenced entries as build_done to avoid rebuilding
> +            entry.build_done = True

Just a thought - have you tested this against testCollectionSection
and testMkimageCollection?

An alternative would be to set build_done only when required=True, so
it happens during ProcessContents() rather than ObtainContents():

    if required:
        entry.build_done = True

What do you think?

At some point we should try to come up with a better algorithm for
when Binman rebuilds the contents of an entry.

Regards,
Simon


More information about the U-Boot mailing list