[PATCH] firmware: handle firmware files being links correctly
Sascha Hauer
s.hauer at pengutronix.de
Wed Sep 17 03:06:27 PDT 2025
On Wed, Sep 17, 2025 at 11:58:34AM +0200, 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.
>
> Fix this by including the sha256sum directly in the generated assembly
> file by using .byte rather than generating a file containing the
> binary sha256sum and include that using .incbin. This way the generated
> assembly file for sure changes when the firmware file changes and it's
> rebuilt when necessary (and not when it's not).
>
> Reproducer:
>
> export ARCH=arm
> make imx_v8_defconfig
> echo foo > firmware/foo
> echo bar > firmware/bar
> ln -sf foo firmware/imx8mm-bl31.bin
> make
>
> The following should rebuild the barebox image including the updated
> firmware, but doesn't:
>
> ln -sf bar firmware/imx8mm-bl31.bin
> make
I ran into this several times now when I tested different TF-A versions.
I linked the bl31 directly into the trusted-firmware build tree and
at some point I wanted to test a known good bl31 binary and changed the
link to that file. The result can be confusing and time consuming, so
after this happened once again it was time to fix this.
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