Procházet zdrojové kódy

image: ignore errors from mktplinkfw command

Rework tplink-v2-header and tplink-v2-image Build define to ignore error
if mktplinkfw2 errors out.

This is to handle situation when the image is too big and can't be
generated or prev check-image calls deleted the source file as it's too
big.

This aligns to the pattern used by tplink-v1-image.

Signed-off-by: Christian Marangi <[email protected]>
Christian Marangi před 1 rokem
rodič
revize
5ba701fe19
1 změnil soubory, kde provedl 6 přidání a 7 odebrání
  1. 6 7
      include/image-commands.mk

+ 6 - 7
include/image-commands.mk

@@ -666,23 +666,22 @@ define Build/tplink-v1-image
 endef
 
 define Build/tplink-v2-header
-	$(STAGING_DIR_HOST)/bin/mktplinkfw2 \
+	-$(STAGING_DIR_HOST)/bin/mktplinkfw2 \
 		-c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -L $(KERNEL_LOADADDR) \
 		-E $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR))  \
 		-w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \
 		-T $(TPLINK_HVERSION) -V "ver. 2.0" \
-		-k $@ -o [email protected] $(1)
-	@mv [email protected] $@
+		-k $@ -o [email protected] $(1) \
+	&& mv [email protected] $@ || rm -f $@
 endef
 
 define Build/tplink-v2-image
-	$(STAGING_DIR_HOST)/bin/mktplinkfw2 \
+	-$(STAGING_DIR_HOST)/bin/mktplinkfw2 \
 		-H $(TPLINK_HWID) -W $(TPLINK_HWREV) \
 		-w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \
 		-T $(TPLINK_HVERSION) -V "ver. 2.0" -a 0x4 -j \
-		-k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o [email protected] $(1)
-	cat [email protected] >> $@
-	rm -rf [email protected]
+		-k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o [email protected] $(1) \
+	&& cat [email protected] >> $@ && rm -rf [email protected] || rm -f $@
 endef
 
 define Build/uImage