فهرست منبع

image: ignore errors from more commands

Ignore errors in more image commands to handle case where the image is
too big and check-image validation fails.

Signed-off-by: Christian Marangi <[email protected]>
Christian Marangi 11 ماه پیش
والد
کامیت
def70fa85b
1فایلهای تغییر یافته به همراه11 افزوده شده و 11 حذف شده
  1. 11 11
      include/image-commands.mk

+ 11 - 11
include/image-commands.mk

@@ -316,12 +316,12 @@ define Build/elecom-product-header
 	$(eval product=$(word 1,$(1)))
 	$(eval product=$(word 1,$(1)))
 	$(eval fw=$(if $(word 2,$(1)),$(word 2,$(1)),$@))
 	$(eval fw=$(if $(word 2,$(1)),$(word 2,$(1)),$@))
 
 
-	( \
+	-( \
 		echo -n -e "ELECOM\x00\x00$(product)" | dd bs=40 count=1 conv=sync; \
 		echo -n -e "ELECOM\x00\x00$(product)" | dd bs=40 count=1 conv=sync; \
 		echo -n "0.00" | dd bs=16 count=1 conv=sync; \
 		echo -n "0.00" | dd bs=16 count=1 conv=sync; \
 		dd if=$(fw); \
 		dd if=$(fw); \
-	) > $(fw).new
-	mv $(fw).new $(fw)
+	) > $(fw).new \
+	&& mv $(fw).new $(fw) || rm -f $(fw)
 endef
 endef
 
 
 define Build/elecom-wrc-gs-factory
 define Build/elecom-wrc-gs-factory
@@ -351,10 +351,10 @@ define Build/elx-header
 		echo -ne "$$($(MKHASH) md5 $@ | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \
 		echo -ne "$$($(MKHASH) md5 $@ | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \
 			dd bs=58 count=1 conv=sync; \
 			dd bs=58 count=1 conv=sync; \
 	) > $(KDIR)/tmp/$(DEVICE_NAME).header
 	) > $(KDIR)/tmp/$(DEVICE_NAME).header
-	$(call Build/xor-image,-p $(xor_pattern) -x)
-	cat $(KDIR)/tmp/$(DEVICE_NAME).header $@ > [email protected]
-	mv [email protected] $@
-	rm -rf $(KDIR)/tmp/$(DEVICE_NAME).header
+	-$(call Build/xor-image,-p $(xor_pattern) -x) \
+	&& cat $(KDIR)/tmp/$(DEVICE_NAME).header $@ > [email protected] \
+	&& mv [email protected] $@ \
+	&& rm -rf $(KDIR)/tmp/$(DEVICE_NAME).header
 endef
 endef
 
 
 define Build/eva-image
 define Build/eva-image
@@ -614,8 +614,8 @@ define Build/seama-seal
 endef
 endef
 
 
 define Build/senao-header
 define Build/senao-header
-	$(STAGING_DIR_HOST)/bin/mksenaofw $(1) -e $@ -o [email protected]
-	mv [email protected] $@
+	-$(STAGING_DIR_HOST)/bin/mksenaofw $(1) -e $@ -o [email protected] \
+	&& mv [email protected] $@ || rm -f $@
 endef
 endef
 
 
 define Build/sysupgrade-tar
 define Build/sysupgrade-tar
@@ -718,8 +718,8 @@ define Build/multiImage
 endef
 endef
 
 
 define Build/xor-image
 define Build/xor-image
-	$(STAGING_DIR_HOST)/bin/xorimage -i $@ -o [email protected] $(1)
-	mv [email protected] $@
+	-$(STAGING_DIR_HOST)/bin/xorimage -i $@ -o [email protected] $(1) \
+	&& mv [email protected] $@ || rm -f $@
 endef
 endef
 
 
 define Build/zip
 define Build/zip