mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] kbuild: delete images with missing firmware instead of truncating
@ 2023-07-03  9:56 Ahmad Fatoum
  2023-07-03 12:48 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2023-07-03  9:56 UTC (permalink / raw)
  To: barebox
  Cc: Rouven Czerwinski, Michael Olbrich, Enrico Jörns, Ahmad Fatoum

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>
---
 images/Makefile      | 4 ++--
 scripts/Makefile.lib | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/images/Makefile b/images/Makefile
index e26880de50b4..c1cb56f5b189 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
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index b8fb2684421e..f04c09f9e280 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -239,6 +239,9 @@ endef
 quiet_cmd_0size = 0SIZE $@
 cmd_0size = : > $@
 
+quiet_cmd_delete = DELETE  $@
+      cmd_delete = rm -f $@
+
 quiet_cmd_shipped = SHIPPED $@
 cmd_shipped = cat $< > $@
 
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH master] kbuild: delete images with missing firmware instead of truncating
  2023-07-03  9:56 [PATCH master] kbuild: delete images with missing firmware instead of truncating Ahmad Fatoum
@ 2023-07-03 12:48 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-07-03 12:48 UTC (permalink / raw)
  To: Ahmad Fatoum
  Cc: barebox, Rouven Czerwinski, Michael Olbrich, Enrico Jörns

On Mon, Jul 03, 2023 at 11:56:08AM +0200, Ahmad Fatoum wrote:
> 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>
> ---
>  images/Makefile      | 4 ++--
>  scripts/Makefile.lib | 3 +++
>  2 files changed, 5 insertions(+), 2 deletions(-)

Applied, thanks

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 |



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-03 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-03  9:56 [PATCH master] kbuild: delete images with missing firmware instead of truncating Ahmad Fatoum
2023-07-03 12:48 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox