From: Tom Rini <trini@konsulko.com>
To: "Pali Rohár" <pali@kernel.org>,
"Alison Wang" <alison.wang@nxp.com>,
"Priyanka Jain" <priyanka.jain@nxp.com>,
"Mingkai Hu" <mingkai.hu@nxp.com>,
"Rajesh Bhagat" <rajesh.bhagat@nxp.com>
Cc: "Simon Glass" <sjg@chromium.org>,
"Alexandru Gagniuc" <mr.nuke.me@gmail.com>,
"Yann Dirson" <yann@blade-group.com>, "Stefan Roese" <sr@denx.de>,
"Marek Behún" <marek.behun@nic.cz>,
u-boot@lists.denx.de
Subject: Re: [PATCH v2] tools: mkimage: Call verify_header after writing image to disk
Date: Sat, 22 Jan 2022 11:35:02 -0500 [thread overview]
Message-ID: <20220122163502.GR7004@bill-the-cat> (raw)
In-Reply-To: <20220122163118.5puevbiklty6xb5d@pali>
[-- Attachment #1: Type: text/plain, Size: 2319 bytes --]
On Sat, Jan 22, 2022 at 05:31:18PM +0100, Pali Rohár wrote:
> On Friday 21 January 2022 21:15:43 Tom Rini wrote:
> > On Sat, Jan 22, 2022 at 02:44:22AM +0100, Pali Rohár wrote:
> > > On Friday 21 January 2022 16:21:33 Tom Rini wrote:
> > > > On Fri, Jan 14, 2022 at 06:34:43PM +0100, Pali Rohár wrote:
> > > >
> > > > > If image backend provides verify_header callback then call it after writing
> > > > > image to disk. This ensures that written image is correct.
> > > > >
> > > > > Signed-off-by: Pali Rohár <pali@kernel.org>
> > > > > Reviewed-by: Stefan Roese <sr@denx.de>
> > > > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > > > ---
> > > > > tools/mkimage.c | 41 +++++++++++++++++++++++++++++++++++++++++
> > > > > 1 file changed, 41 insertions(+)
> > > >
> > > > This breaks a number of platforms such as ls1021atwr_sdcard_qspi and
> > > > it's not clear to me why exactly.
> > >
> > > Maybe they were already broken and this patch just detected it?
> > > Or verify_header callback for particular image type is reject valid
> > > image?
> > >
> > > Do you have some pointers to failed build logs?
> >
> > Try building for ls1021atwr_sdcard_qspi with your patch applied, the
> > only new thing that's shown in the logs is the error message.
>
> So... I have tried following without this patch:
>
> $ make ls1021atwr_sdcard_qspi_defconfig
> $ make CROSS_COMPILE=arm-linux-gnueabi- -j8
>
> It generated file spl/u-boot-spl.pbl without error. Now I called -l on
> this generated file for type pblimage and I got following output:
>
> $ ./tools/dumpimage -T pblimage -l spl/u-boot-spl.pbl
> GP Header: Size aa55aa55 LoadAddr 1ee0100
>
> $ ./tools/mkimage -T pblimage -l spl/u-boot-spl.pbl
> GP Header: Size aa55aa55 LoadAddr 1ee0100
>
> "GP Header:" line is from the TI OMAP image backend type gpimage or type
> omapimage (implemented in file gpimage-common.c).
>
> So it means that files generated by ls1021atwr_sdcard_qspi are already
> broken and my patch just detected it. Or it is also possible that
> validation code in pblimage.c file is incorrect and broken.
>
> What to do with it now?
Thanks for digging. This is a problem for a number of the ls1021,
ls1043 and ls1046 platforms, so lets add some maintainers there.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2022-01-22 16:35 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-13 14:42 [PATCH] mkimage: Call verify_header after writing image to disk Pali Rohár
2022-01-13 19:30 ` Simon Glass
2022-01-14 17:34 ` [PATCH v2] tools: " Pali Rohár
2022-01-15 9:46 ` Stefan Roese
2022-01-15 18:01 ` Simon Glass
2022-01-21 21:21 ` Tom Rini
2022-01-22 1:44 ` Pali Rohár
2022-01-22 2:15 ` Tom Rini
2022-01-22 16:31 ` Pali Rohár
2022-01-22 16:34 ` Pali Rohár
2022-01-22 16:35 ` Tom Rini [this message]
2022-02-02 9:06 ` Priyanka Jain
2022-02-15 19:52 ` Pali Rohár
2022-02-16 9:33 ` Priyanka Jain
2022-02-16 14:17 ` Z.Q. Hou
2022-03-06 11:50 ` Pali Rohár
2022-03-06 13:58 ` Tom Rini
2022-03-08 13:42 ` Tom Rini
2022-03-14 1:51 ` 陈健洪
2022-03-14 1:54 ` 陈健洪
2022-04-06 15:55 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220122163502.GR7004@bill-the-cat \
--to=trini@konsulko.com \
--cc=alison.wang@nxp.com \
--cc=marek.behun@nic.cz \
--cc=mingkai.hu@nxp.com \
--cc=mr.nuke.me@gmail.com \
--cc=pali@kernel.org \
--cc=priyanka.jain@nxp.com \
--cc=rajesh.bhagat@nxp.com \
--cc=sjg@chromium.org \
--cc=sr@denx.de \
--cc=u-boot@lists.denx.de \
--cc=yann@blade-group.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox