[PATCH v4 1/8] binman: add support for skipping file concatenation for mkimage

Simon Glass sjg at chromium.org
Thu Aug 25 03:25:37 CEST 2022


Hi Quentin,

On Wed, 24 Aug 2022 at 09:29, Quentin Schulz
<quentin.schulz at theobroma-systems.com> wrote:
>
> Hi Simon,
>
> On 8/18/22 10:17, Simon Glass wrote:
> > Hi Quentin,
> >
> > On Wed, 3 Aug 2022 at 06:19, Quentin Schulz <foss+uboot at 0leil.net> wrote:
> >>
> >> From: Quentin Schulz <quentin.schulz at theobroma-systems.com>
> >>
> >> Some image types handled by mkimage require the datafiles to be passed
> >> independently (-d data1:data2) for specific handling of each. A
> >> concatenation of datafiles prior to passing them to mkimage wouldn't
> >> work.
> >>
> >> That is the case for rkspi for example which requires page alignment
> >> and only writing 2KB every 4KB.
> >>
> >> This adds the ability to tell binman to pass the datafiles without
> >> prior concatenation to mkimage, by adding the multiple-data-files
> >> boolean property to the mkimage node.
> >>
> >> Cc: Quentin Schulz <foss+uboot at 0leil.net>
> >> Reviewed-by: Simon Glass <sjg at chromium.org>
> >> Signed-off-by: Quentin Schulz <quentin.schulz at theobroma-systems.com>
> >> ---
> >>   tools/binman/entries.rst      | 22 +++++++++++++++++++
> >>   tools/binman/etype/mkimage.py | 41 +++++++++++++++++++++++++++++++----
> >>   2 files changed, 59 insertions(+), 4 deletions(-)
> >
> > Somehow I missed this one, sorry.
> >
> > It needs a test (try 'binman test -T' to see that it breaks code coverage).
> >
>
> How do you see this test being implemented?
>
> I think it'd be best to mock calls to mkimage (or
> self.mkimage.run_cmd()) and check that the -d parameter has two entries
> separated by a colon but my limited knowledge of unittest.mock does not
> seem to guide me to the proper implementation.
>
> Another way would be to use a specific mkimage type that handles that
> kind of multiple files -d parameter and outputs something more or less
> reproducible, e.g. rkspi type. I don't like this too much even though
> it's much easier because we're bound to this type and the image type
> could change (I recall some endianness fixes a few months ago).
>

You should be able to call mkimage for real and check that it does the
right thing by looking at the output, in a simple way.

See for example testMkimage() and let me know if you need any other hints.

Regards,
Simon


More information about the U-Boot mailing list