endef
define Build/append-image
- dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) >> $@
+ cp "$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)" "$@.stripmeta"
+ fwtool -s /dev/null -t "$@.stripmeta" || :
+ fwtool -i /dev/null -t "$@.stripmeta" || :
+ dd if="$@.stripmeta" >> "$@"
+ rm "$@.stripmeta"
endef
ifdef IB
endef
else
define Build/append-image-stage
- dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) of=$(STAGING_DIR_IMAGE)/$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))-$(DEVICE_NAME)-$(1)
- dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) >> $@
+ cp "$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)" "$@.stripmeta"
+ fwtool -s /dev/null -t "$@.stripmeta" || :
+ fwtool -i /dev/null -t "$@.stripmeta" || :
+ dd if="$@.stripmeta" of="$(STAGING_DIR_IMAGE)/$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))-$(DEVICE_NAME)-$(1)"
+ dd if="$@.stripmeta" >> "$@"
+ rm "$@.stripmeta"
endef
endif