mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: Re: [PATCH 1/3] scripts: fix_size: check magic
Date: Fri, 31 Jan 2014 18:57:14 +0100	[thread overview]
Message-ID: <20140131175713.GC24917@pengutronix.de> (raw)
In-Reply-To: <1390993508-10287-1-git-send-email-s.hauer@pengutronix.de>

On Wed, Jan 29, 2014 at 12:05:06PM +0100, Sascha Hauer wrote:
> Instead of passing the offset to the fix_size tool check the image to
> fixup for a valid header so that only recognized files are fixed up.
> This makes the usage of this tool safer.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/pbl/Makefile |  2 +-
>  scripts/fix_size.c    | 32 +++++++++++++++++++++++++-------
>  2 files changed, 26 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/pbl/Makefile b/arch/arm/pbl/Makefile
> index bfa73b9..5e90f3d 100644
> --- a/arch/arm/pbl/Makefile
> +++ b/arch/arm/pbl/Makefile
> @@ -23,7 +23,7 @@ $(obj)/zbarebox.bin:	$(obj)/zbarebox FORCE
>  	$(call if_changed,objcopy)
>  	$(call cmd,check_file_size,$(CONFIG_BAREBOX_MAX_IMAGE_SIZE))
>  	$(Q)$(kecho) '  Barebox: fix size'
> -	$(Q)$(objtree)/scripts/fix_size -f $(objtree)/$@ -o 0x2c $(FIX_SIZE)
> +	$(Q)$(objtree)/scripts/fix_size -f $(objtree)/$@ $(FIX_SIZE)

I had to squash in a -i option to ignore invalid headers and return
successfully instead of failing. This is necessary for zynq which
doesn't generate an image with a barebox header but instead with a zynq
header. Before this patch fix_size silently corrupted the image.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2014-01-31 17:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29 11:05 Sascha Hauer
2014-01-29 11:05 ` [PATCH 2/3] images: fix image size in pblx Sascha Hauer
2014-01-29 11:05 ` [PATCH 3/3] ARM: i.MX: external NAND boot: use image size from image header Sascha Hauer
2014-01-31 17:57 ` Sascha Hauer [this message]

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=20140131175713.GC24917@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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