[PATCH] firmware: handle firmware files being links correctly
Sascha Hauer
s.hauer at pengutronix.de
Wed Sep 17 06:04:07 PDT 2025
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 |
More information about the barebox
mailing list