Before generating the factory image, check if the input file
exists. Fix the build error when sysupgrade image is too big:
[mkwrgimg] *** error: stat failed on /builder/shared-workdir/build/build_dir/target-mipsel_24kc_musl/linux-ramips_rt288x/tmp/openwrt-ramips-rt288x-airlink101_ar670w-squashfs-factory.bin, No such file or directory
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18836
Signed-off-by: Robert Marko <robimarko@gmail.com>
endef
define Build/wrg-header
- mkwrgimg -i $@ -d "/dev/mtdblock/2" -s $(1) -o $@.new
+ -[ -f "$@" ] && \
+ mkwrgimg -i $@ -d "/dev/mtdblock/2" -s $(1) -o $@.new && \
mv $@.new $@
endef