[PATCH master] kbuild: delete images with missing firmware instead of truncating

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
Suggested-by: Michael Olbrich <mol@xxxxxxxxxxxxxx>
Suggested-by: Enrico Jörns <e.joerns@xxxxxxxxxxxxxx>
Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 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





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux