-s 0x2000000 -p0x180000:$$newsize:al:0x80208000:"OpenWrt":$@ \
$@.new
@mv $@.new $@
+
+define Build/prepend-factory-uboot
+ mv $@ $@.bak
+ dd if=$(UBOOT_PATH) bs=1M count=1 conv=sync > $@
+ cat $@.bak >> $@
endef
define Build/qsdk-ipq-factory-nand-askey
# to add a version... or we are very careful not to add '\0' into that
# string and call it a day.... Yeah, we do the latter!
UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U')
+ IMAGES := sysupgrade.bin factory.trx
DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \
kmod-usb-ledtrig-usbport
+# The factory image uses a legacy uImage to wrap the firmware
+# That's why we need two uImage headers at the back.
+ UBOOT_PATH := $(STAGING_DIR_IMAGE)/uboot-rt-ac58u.bin
+ IMAGE/factory.trx := sysupgrade-tar | append-metadata | uImage none | \
+ prepend-factory-uboot | uImage none | uImage none | \
+ check-size $$$$(IMAGE_SIZE)
endef
TARGET_DEVICES += asus_rt-ac58u