[PATCH] tools: mkimage/dumpimage: Allow to use -l with -T

Simon Glass sjg at chromium.org
Sat Feb 26 19:37:09 CET 2022


On Sat, 12 Feb 2022 at 17:10, Pali Rohár <pali at kernel.org> wrote:
>
> Currently -l option for mkimage and dumpimage ignores option -T and always
> tries to autodetect image type.
>
> With this change it is possible to tell mkimage and dumpimage to parse
> image file as specific type (and not random autodetected type). This allows
> to use mkimage -l or dumpimage -l as tool for validating image.
>
> params.type for -l option is now by default initialized to zero
> (IH_TYPE_INVALID) instead of IH_TYPE_KERNEL. imagetool_get_type() for
> IH_TYPE_INVALID returns NULL, which is assigned to tparams. mkimage and
> dumpimage code is extended to handle tparams with NULL for -l option. And
> imagetool_verify_print_header() is extended to do validation via tparams if
> is not NULL.
>
> Signed-off-by: Pali Rohár <pali at kernel.org>
> ---
>  doc/mkimage.1     | 10 ++++++++--
>  tools/dumpimage.c | 17 ++++++++---------
>  tools/imagetool.c | 11 ++++++++++-
>  tools/imagetool.h | 22 ++++------------------
>  tools/mkimage.c   | 36 ++++++++++++++----------------------
>  5 files changed, 44 insertions(+), 52 deletions(-)

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

In the comments for NULL, please indicate what it means


More information about the U-Boot mailing list