mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH] firmware: handle firmware files being links correctly
Date: Wed, 17 Sep 2025 15:04:07 +0200	[thread overview]
Message-ID: <aMqxx2GFYYmg9G7X@pengutronix.de> (raw)
In-Reply-To: <70e5f030-a3c5-4fa8-af71-99084828d56e@pengutronix.de>

On Wed, Sep 17, 2025 at 12:21:57PM +0200, Ahmad Fatoum wrote:
> On 9/17/25 11:58 AM, Sascha Hauer wrote:
> > Sometimes firmware files can be links. When rebuilding barebox correctly
> > rebuilds the firmware when file the link points to is updated, but the
> > firmware is not rebuilt when the link itself is changed to link to
> > another file.
> 
> This is surprising. I though GNU make looks at the mtime of the destination.

It does, but in this case it should also consider the timestamp of the
link itself, not the destination.

> > @@ -80,7 +82,7 @@ filechk_fwbin = { \
> >  	echo "    .p2align ASM_LGPTR"				;\
> >  	echo ".global _fw_$(FWSTR)_sha_start"			;\
> >  	echo "_fw_$(FWSTR)_sha_start:"				;\
> > -	echo "    .incbin \"$(fwobjdir)/$(FWNAME).sha.bin\""	;\
> > +	echo "    .byte $${SHA}"				;\
> >  	echo ".global _fw_$(FWSTR)_sha_end"			;\
> 
> How about we add here an
> 
> .if _fw_$(FWSTR)_sha_start - _fw_$(FWSTR)_sha_end
> 	.err
> 	.warnig "sha256sum empty"
> .endif
> 
> As .byte doesn't require an argument, this would ensure breakage to be
> noticed at compile time.

Ok. The .if expression is reversed. Will change to:

	.if _fw_$(FWSTR)_sha_start + 32 - _fw_$(FWSTR)_sha_end
	.error "sha256sum invalid"
	.endif"

This not only checks for an empty sha sum but also for the correct
length.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



  reply	other threads:[~2025-09-17 13:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17  9:58 Sascha Hauer
2025-09-17 10:06 ` Sascha Hauer
2025-09-17 10:21 ` Ahmad Fatoum
2025-09-17 13:04   ` Sascha Hauer [this message]
2025-09-18 14:24 ` Sascha Hauer

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=aMqxx2GFYYmg9G7X@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=a.fatoum@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