ipq40xx: dynamically build board-2.bin for Mikrotik
[openwrt/staging/chunkeey.git] / target / linux / ipq40xx / image / generic.mk
index b730a0e1840ab6eca7dfe7d6055fb40c9ea617b5..be313e672d3222ad5d07d7991027e49d64d8e2ee 100644 (file)
@@ -236,7 +236,7 @@ define Device/asus_rt-ac58u
        SOC := qcom-ipq4018
        BLOCKSIZE := 128k
        PAGESIZE := 2048
-       IMAGE_SIZE := 20439364
+       IMAGE_SIZE := 20439300
        FILESYSTEMS := squashfs
 #      Someone - in their infinite wisdom - decided to put the firmware
 #      version in front of the image name \03\00\00\04 => Version 3.0.0.4
@@ -244,6 +244,9 @@ define Device/asus_rt-ac58u
 #      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')
+       ARTIFACTS := install.trx
+       ARTIFACT/install.trx := copy-file $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE) \
+               | pad-to $$$$(IMAGE_SIZE) | uImage none
        DEVICE_PACKAGES := -kmod-ath10k-ct kmod-ath10k-ct-smallbuffers \
                kmod-usb-ledtrig-usbport
 endef
@@ -662,6 +665,25 @@ define Device/linksys_mr8300
 endef
 TARGET_DEVICES += linksys_mr8300
 
+define Device/linksys_whw01-v1
+       $(call Device/FitzImage)
+       DEVICE_VENDOR := Linksys
+       DEVICE_MODEL := WHW01
+       DEVICE_VARIANT := v1
+       KERNEL_SIZE := 6144k
+       IMAGE_SIZE := 28704512  # 28032k minus linksys signature (256-bytes).
+       SOC := qcom-ipq4018
+       BLOCKSIZE := 128k
+       PAGESIZE := 2048
+       UBINIZE_OPTS := -E 5    # EOD marks to "hide" factory sig at EOF
+       IMAGES += factory.bin
+       IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
+               append-ubi | linksys-image type=WHW01 | pad-to $$$$(PAGESIZE) | \
+               check-size
+       DEVICE_PACKAGES := uboot-envtools kmod-leds-pca963x
+endef
+TARGET_DEVICES += linksys_whw01-v1
+
 define Device/luma_wrtq-329acn
        $(call Device/FitImage)
        DEVICE_VENDOR := Luma Home