Re: [PATCH 1/3] scripts: fix_size: check magic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux