769b86b81bcb90bdd698d66f169a2a620c3920f0
[openwrt/openwrt.git] / target / linux / ramips / image / mt7621.mk
1 #
2 # MT7621 Profiles
3 #
4
5 define Build/ubnt-erx-factory-image
6 if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \
7 echo '21001:6' > $(1).compat; \
8 $(TAR) -cf $(1) --transform='s/^.*/compat/' $(1).compat; \
9 \
10 $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp/' $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE); \
11 md5sum --binary $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) | awk '{print $$1}'> $(1).md5; \
12 $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp.md5/' $(1).md5; \
13 \
14 echo "dummy" > $(1).rootfs; \
15 $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp/' $(1).rootfs; \
16 \
17 md5sum --binary $(1).rootfs | awk '{print $$1}'> $(1).md5; \
18 $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp.md5/' $(1).md5; \
19 \
20 echo '$(BOARD) $(VERSION_CODE) $(VERSION_NUMBER)' > $(1).version; \
21 $(TAR) -rf $(1) --transform='s/^.*/version.tmp/' $(1).version; \
22 \
23 $(CP) $(1) $(BIN_DIR)/; \
24 else \
25 echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
26 fi
27 endef
28
29 define Device/mt7621
30 DTS := MT7621
31 BLOCKSIZE := 64k
32 IMAGE_SIZE := $(ralink_default_fw_size_4M)
33 DEVICE_TITLE := MediaTek MT7621 EVB
34 endef
35 TARGET_DEVICES += mt7621
36
37 define Device/wsr-600
38 DTS := WSR-600
39 IMAGE_SIZE := $(ralink_default_fw_size_16M)
40 DEVICE_TITLE := Buffalo WSR-600
41 endef
42 TARGET_DEVICES += wsr-600
43
44 define Device/re6500
45 DTS := RE6500
46 DEVICE_TITLE := Linksys RE6500
47 endef
48 TARGET_DEVICES += re6500
49
50 define Device/wsr-1166
51 DTS := WSR-1166
52 IMAGE/sysupgrade.bin := trx | pad-rootfs
53 IMAGE_SIZE := $(ralink_default_fw_size_16M)
54 DEVICE_TITLE := Buffalo WSR-1166
55 endef
56 TARGET_DEVICES += wsr-1166
57
58 define Device/dir-860l-b1
59 DTS := DIR-860L-B1
60 BLOCKSIZE := 4k
61 IMAGES += factory.bin
62 KERNEL := kernel-bin | patch-dtb | relocate-kernel | lzma | uImage lzma
63 IMAGE_SIZE := $(ralink_default_fw_size_16M)
64 IMAGE/sysupgrade.bin := \
65 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
66 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
67 pad-rootfs | check-size $$$$(IMAGE_SIZE)
68 IMAGE/factory.bin := \
69 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
70 append-rootfs | pad-rootfs -x 64 | \
71 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
72 seama-seal -m "signature=wrgac13_dlink.2013gui_dir860lb" | \
73 check-size $$$$(IMAGE_SIZE)
74 DEVICE_TITLE := D-Link DIR-860L B1
75 endef
76 TARGET_DEVICES += dir-860l-b1
77
78 define Device/firewrt
79 DTS := FIREWRT
80 IMAGE_SIZE := $(ralink_default_fw_size_16M)
81 DEVICE_TITLE := Firefly FireWRT
82 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev
83 endef
84 TARGET_DEVICES += firewrt
85
86 define Device/pbr-m1
87 DTS := PBR-M1
88 IMAGE_SIZE := $(ralink_default_fw_size_16M)
89 DEVICE_TITLE := PBR-M1
90 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci \
91 kmod-rtc-pcf8563 kmod-i2c-mt7621
92 endef
93 TARGET_DEVICES += pbr-m1
94
95 define Device/sap-g3200u3
96 DTS := SAP-G3200U3
97 DEVICE_TITLE := STORYLiNK SAP-G3200U3
98 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev
99 endef
100 TARGET_DEVICES += sap-g3200u3
101
102 define Device/timecloud
103 DTS := Timecloud
104 DEVICE_TITLE := Thunder Timecloud
105 DEVICE_PACKAGES := kmod-usb3
106 endef
107 TARGET_DEVICES += timecloud
108
109 define Device/witi
110 DTS := WITI
111 IMAGE_SIZE := $(ralink_default_fw_size_16M)
112 DEVICE_TITLE := MQmaker WiTi
113 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci \
114 kmod-rtc-pcf8563 kmod-i2c-mt7621
115 endef
116 TARGET_DEVICES += witi
117
118 define Device/wndr3700v5
119 DTS := WNDR3700V5
120 IMAGE_SIZE := $(ralink_default_fw_size_16M)
121 DEVICE_TITLE := Netgear WNDR3700v5
122 DEVICE_PACKAGES := kmod-usb3
123 endef
124 TARGET_DEVICES += wndr3700v5
125
126 define Device/zbt-wg2626
127 DTS := ZBT-WG2626
128 IMAGE_SIZE := $(ralink_default_fw_size_16M)
129 DEVICE_TITLE := ZBT WG2626
130 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci
131 endef
132 TARGET_DEVICES += zbt-wg2626
133
134 define Device/zbt-wg3526
135 DTS := ZBT-WG3526
136 IMAGE_SIZE := $(ralink_default_fw_size_16M)
137 DEVICE_TITLE := ZBT WG3526
138 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev kmod-ata-core kmod-ata-ahci
139 endef
140 TARGET_DEVICES += zbt-wg3526
141
142 define Device/wf-2881
143 DTS := WF-2881
144 BLOCKSIZE := 128k
145 PAGESIZE := 2048
146 FILESYSTEMS := squashfs
147 IMAGE_SIZE := 129280k
148 KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
149 IMAGE/sysupgrade.bin := append-kernel | append-ubi | check-size $$$$(IMAGE_SIZE)
150 DEVICE_TITLE := NETIS WF-2881
151 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev
152 endef
153 TARGET_DEVICES += wf-2881
154
155 define Device/ubnt-erx
156 DTS := UBNT-ERX
157 FILESYSTEMS := squashfs
158 KERNEL_SIZE := 3145728
159 KERNEL := $(KERNEL_DTB) | uImage lzma
160 IMAGES := sysupgrade.tar
161 KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
162 IMAGE/sysupgrade.tar := sysupgrade-tar
163 DEVICE_TITLE := Ubiquiti EdgeRouter X
164 DEVICE_PACKAGES := -kmod-mt76 -kmod-rt2800-pci -kmod-cfg80211 -wpad-mini -iwinfo
165 endef
166 TARGET_DEVICES += ubnt-erx
167
168 define Device/sk-wb8
169 DTS := SK-WB8
170 IMAGE_SIZE := $(ralink_default_fw_size_16M)
171 DEVICE_TITLE := SamKnows Whitebox 8
172 DEVICE_PACKAGES := kmod-usb3 kmod-ledtrig-usbdev uboot-envtools
173 endef
174 TARGET_DEVICES += sk-wb8
175
176 # FIXME: is this still needed?
177 define Image/Prepare
178 #define Build/Compile
179 rm -rf $(KDIR)/relocate
180 $(CP) ../../generic/image/relocate $(KDIR)
181 $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
182 $(CP) $(KDIR)/relocate/loader.bin $(KDIR)/loader.bin
183 endef