diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-07-03 11:56:08 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-07-03 14:47:34 +0200 |
commit | 30166be6e6c07f3814285b598f4ed2960b612a0c (patch) | |
tree | dbc4be62f5a6dd5efbedc4d0472516e4f07f1fc6 /images/Makefile | |
parent | 3c1444e866b14dc5aee9d9e6f14c3162b38f5ff5 (diff) | |
download | barebox-30166be6e6c07f3814285b598f4ed2960b612a0c.tar.gz barebox-30166be6e6c07f3814285b598f4ed2960b612a0c.tar.xz |
kbuild: delete images with missing firmware instead of truncating
It may be confusing to users to be left with a 0-byte image, so let's
delete it instead. This means that every build with missing firmware will
attempt the final make targets, only to delete them at the end.
At the flip-side, there is no risk of broken images to be used later on.
Suggested-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Suggested-by: Michael Olbrich <mol@pengutronix.de>
Suggested-by: Enrico Jörns <e.joerns@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230703095608.2188064-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'images/Makefile')
-rw-r--r-- | images/Makefile | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/images/Makefile b/images/Makefile index e26880de50..c1cb56f5b1 100644 --- a/images/Makefile +++ b/images/Makefile @@ -136,7 +136,7 @@ missing_fw = $(strip $(wildcard $(obj)/$(FILE_$(@F)).missing-firmware $(basename $(obj)/%.img: $(obj)/$$(FILE_$$(@F)) $(Q)if [ -z $(FILE_$(@F)) ]; then echo "FILE_$(@F) empty!"; false; fi $(Q)$(if $(missing_fw),cat $(missing_fw) >$@.missing-firmware,rm -f $@.missing-firmware) - $(call if_changed,$(if $(missing_fw),0size,shipped)) + $(call if_changed,$(if $(missing_fw),delete,shipped)) board = $(srctree)/arch/$(SRCARCH)/boards objboard = $(objtree)/arch/$(SRCARCH)/boards @@ -202,7 +202,7 @@ images: $(image-y-path) $(flash-link) $(flash-list) FORCE @echo "images built:" @for i in $(image-y); do \ if [ -s $(obj)/$$i ]; then echo $$i; \ - else >&2 echo "** firmware missing for $$i **"; \ + else >&2 echo "** $$i skipped due to missing firmware **"; \ $(if $(CONFIG_MISSING_FIRMWARE_ERROR), >&2 sed 's/^/\t/' <$(obj)/$${i}.missing-firmware; missing=1;) \ fi; done; if [ -n "$$missing" ]; then \ echo >&2 "Firmware missing in CONFIG_MISSING_FIRMWARE_ERROR=y build"; exit 1; fi |