The factory image can't be bigger than 3328 KByte. If the image is
bigger than that, the gemtek-header tool throws an error and breaks
the build.
Make sure the output file to which the gemtek header should be added
exists and wasn't removed during the check-size step because of it
size. This will prevent hard errors in case the factory image is to big
similar to what is done for sysupgrade images.
Signed-off-by: Mathias Kresin <dev@kresin.me>
#
define Build/gemtek-header
- mkheader_gemtek $@ $@.new $(1) && mv $@.new $@
+ if [ -f $@ ]; then \
+ mkheader_gemtek $@ $@.new $(1) && \
+ mv $@.new $@; \
+ fi
endef
define Device/ar670w
DTS := AR725W
DEVICE_TITLE := Gemtek AR725W
IMAGES += factory.bin
- IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
+ IMAGE/factory.bin := $$(sysupgrade_bin) | check-size 3328k | \
gemtek-header ar725w
endef
TARGET_DEVICES += ar725w