[RFC Patch v3] binman: add support for creating dummy files for external blobs

Simon Glass sjg at chromium.org
Wed Jan 5 17:54:55 CET 2022


Hi Heiko,

On Wed, 5 Jan 2022 at 09:06, Simon Glass <sjg at chromium.org> wrote:
>
> Hi Heiko,
>
> On Wed, 5 Jan 2022 at 05:58, Heiko Thiery <heiko.thiery at gmail.com> wrote:
> >
> > While converting to binman for an imx8mq board, it has been found that
> > building in the u-boot CI fails. This is because an imx8mq requires an
> > external binary (signed_hdmi_imx8m.bin). If this file cannot be found
> > mkimage fails.
> > To be able to build this board in the u-boot CI a binman option
> > (--fake-ext-blobs) is introduced that can be switched on via the u-boot
> > makefile option BINMAN_FAKE_EXT_BLOBS. With that the needed dummy files are
> > created.
> >
> > Signed-off-by: Heiko Thiery <heiko.thiery at gmail.com>
> > ---
> > v3:
> >  - add CheckFakedBlobs() and print a list of faked files at the end
> >  - add unittest
> >
> > v2:
> >  - pass allow_fake_blobs to ProcessImage()
> >  - set AllowAllowFakeBlob() to images/entries
> >  - create fake blob in Entry_blot.ObtainContents() when file is missing and
> >    creation is allowed
> >
> >  still missing:
> >   - unittest
> >   - option to set BINMAN_FAKE_EXT_BLOBS in Makefile via environment
> >         variable. With that we could simply set this env variable in the CI
> >         (gitlab-ci.yml) with adding support to buildman.
> >
> >  Makefile                            |  1 +
> >  tools/binman/cmdline.py             |  2 ++
> >  tools/binman/control.py             | 26 +++++++++++++++++++-------
> >  tools/binman/entry.py               | 23 +++++++++++++++++++++++
> >  tools/binman/etype/blob.py          | 18 ++++++++++++++++++
> >  tools/binman/etype/blob_ext.py      |  8 ++++++++
> >  tools/binman/etype/mkimage.py       | 20 ++++++++++++++++++++
> >  tools/binman/etype/section.py       | 20 ++++++++++++++++++++
> >  tools/binman/ftest.py               | 13 ++++++++++++-
> >  tools/binman/test/203_fake_blob.dts | 14 ++++++++++++++
> >  10 files changed, 137 insertions(+), 8 deletions(-)
> >  create mode 100644 tools/binman/test/203_fake_blob.dts
>
> Please check that you keep to 80cols, except where it would split a string.
>
> This is missing a few holes in test coverage. Did you try 'binman test -T' ?
>
> If you are stuck I could fiddle with it a bit.

BTW if you need the external tools you might try u-boot-dm/bin-working
which has a command that might fetch them:

binman tool --fetch missing

It is WIP at present, so has an old version of your patch in there.

Regards,
Simon


More information about the U-Boot mailing list