BUILD_DEVICES:=avm_fritzbox-7530
endef
+define U-Boot/rt_ac58u
+ NAME:=RT-AC58U
+ BUILD_DEVICES:=asus_rt-ac58u
+endef
+
UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes
UBOOT_MAKE_FLAGS = USE_PRIVATE_LIBGCC=yes
export DTC
define Build/Compile
$(Build/Compile/U-Boot)
- (cd $(PKG_BUILD_DIR); ./fritz/fritzcreator.sh $(UBOOT_BOARD);)
+ $(if $(filter rt-ac58u,$(UBOOT_BOARD)),
+ $(CP) $(PKG_BUILD_DIR)/u-boot.bin $(PKG_BUILD_DIR)/$(UBOOT_IMAGE);,
+ (cd $(PKG_BUILD_DIR); ./fritz/fritzcreator.sh $(UBOOT_BOARD);))
endef
define Build/InstallDev
$(INSTALL_BIN) $(PKG_BUILD_DIR)/upload-to-f4040.sh $(1)/
endef
-UBOOT_TARGETS := fritz1200 fritz3000 fritz4040 fritz7530
+UBOOT_TARGETS := fritz1200 fritz3000 fritz4040 fritz7530 rt-ac58u
$(eval $(call BuildPackage/U-Boot))
-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
+ 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