6d9a7273d4f6fc9f2f44c207d6939fd4458f3604
[openwrt/staging/chunkeey.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 mkhash md5 $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) > $(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 mkhash md5 $(1).rootfs > $(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/11acnas
30 DTS := 11ACNAS
31 IMAGE_SIZE := $(ralink_default_fw_size_16M)
32 DEVICE_TITLE := WeVO 11AC NAS Router
33 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-i2c-mt7621 kmod-mt76
34 endef
35 TARGET_DEVICES += 11acnas
36
37 define Device/ac1200pro
38 DTS := AC1200pro
39 IMAGE_SIZE := $(ralink_default_fw_size_32M)
40 DEVICE_TITLE := Digineo AC1200 Pro
41 DEVICE_PACKAGES := kmod-usb3 kmod-ata-core kmod-ata-ahci
42 endef
43 TARGET_DEVICES += ac1200pro
44
45 define Device/dir-860l-b1
46 DTS := DIR-860L-B1
47 BLOCKSIZE := 64k
48 IMAGES += factory.bin
49 KERNEL := kernel-bin | patch-dtb | relocate-kernel | lzma | uImage lzma
50 IMAGE_SIZE := $(ralink_default_fw_size_16M)
51 IMAGE/sysupgrade.bin := \
52 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
53 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
54 pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
55 IMAGE/factory.bin := \
56 append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
57 append-rootfs | pad-rootfs -x 64 | \
58 seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
59 seama-seal -m "signature=wrgac13_dlink.2013gui_dir860lb" | \
60 check-size $$$$(IMAGE_SIZE)
61 DEVICE_TITLE := D-Link DIR-860L B1
62 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
63 endef
64 TARGET_DEVICES += dir-860l-b1
65
66 define Device/firewrt
67 DTS := FIREWRT
68 IMAGE_SIZE := $(ralink_default_fw_size_16M)
69 DEVICE_TITLE := Firefly FireWRT
70 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
71 endef
72 TARGET_DEVICES += firewrt
73
74 define Device/mt7621
75 DTS := MT7621
76 BLOCKSIZE := 64k
77 IMAGE_SIZE := $(ralink_default_fw_size_4M)
78 DEVICE_TITLE := MediaTek MT7621 EVB
79 endef
80 TARGET_DEVICES += mt7621
81
82 define Device/newifi-d1
83 DTS := Newifi-D1
84 IMAGE_SIZE := $(ralink_default_fw_size_32M)
85 DEVICE_TITLE := Newifi D1
86 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-i2c-mt7621
87 endef
88 TARGET_DEVICES += newifi-d1
89
90 define Device/pbr-m1
91 DTS := PBR-M1
92 IMAGE_SIZE := $(ralink_default_fw_size_16M)
93 DEVICE_TITLE := PBR-M1
94 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci \
95 kmod-i2c-mt7621
96 endef
97 TARGET_DEVICES += pbr-m1
98
99 define Device/rb750gr3
100 DTS := RB750Gr3
101 IMAGE_SIZE := $(ralink_default_fw_size_16M)
102 DEVICE_TITLE := MikroTik RB750Gr3
103 DEVICE_PACKAGES := kmod-usb3 uboot-envtools -kmod-mt76 -kmod-rt2x00-lib -kmod-mac80211 -kmod-cfg80211 -wpad-mini -iwinfo
104 endef
105 TARGET_DEVICES += rb750gr3
106
107 define Device/re6500
108 DTS := RE6500
109 DEVICE_TITLE := Linksys RE6500
110 endef
111 TARGET_DEVICES += re6500
112
113 define Device/sap-g3200u3
114 DTS := SAP-G3200U3
115 DEVICE_TITLE := STORYLiNK SAP-G3200U3
116 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
117 endef
118 TARGET_DEVICES += sap-g3200u3
119
120 define Device/sk-wb8
121 DTS := SK-WB8
122 IMAGE_SIZE := $(ralink_default_fw_size_16M)
123 DEVICE_TITLE := SamKnows Whitebox 8
124 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport uboot-envtools
125 endef
126 TARGET_DEVICES += sk-wb8
127
128 define Device/timecloud
129 DTS := Timecloud
130 DEVICE_TITLE := Thunder Timecloud
131 DEVICE_PACKAGES := kmod-usb3
132 endef
133 TARGET_DEVICES += timecloud
134
135 define Device/ubnt-erx
136 DTS := UBNT-ERX
137 FILESYSTEMS := squashfs
138 KERNEL_SIZE := 3145728
139 KERNEL := $(KERNEL_DTB) | uImage lzma
140 IMAGES := sysupgrade.tar
141 KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
142 IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
143 DEVICE_TITLE := Ubiquiti EdgeRouter X
144 DEVICE_PACKAGES := -kmod-mt76 -kmod-rt2x00-lib -kmod-mac80211 -kmod-cfg80211 -wpad-mini -iwinfo
145 endef
146 TARGET_DEVICES += ubnt-erx
147
148 define Device/vr500
149 DTS := VR500
150 IMAGE_SIZE := 66453504
151 DEVICE_TITLE := Planex VR500
152 DEVICE_PACKAGES := kmod-usb3
153 endef
154 TARGET_DEVICES += vr500
155
156 define Device/w2914nsv2
157 DTS := W2914NSV2
158 IMAGE_SIZE := $(ralink_default_fw_size_16M)
159 DEVICE_TITLE := WeVO W2914NS v2
160 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-i2c-mt7621 kmod-mt76
161 endef
162 TARGET_DEVICES += w2914nsv2
163
164 define Device/wf-2881
165 DTS := WF-2881
166 BLOCKSIZE := 128k
167 PAGESIZE := 2048
168 FILESYSTEMS := squashfs
169 IMAGE_SIZE := 129280k
170 KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
171 UBINIZE_OPTS := -E 5
172 IMAGE/sysupgrade.bin := append-kernel | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE)
173 DEVICE_TITLE := NETIS WF-2881
174 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
175 endef
176 TARGET_DEVICES += wf-2881
177
178 define Device/witi
179 DTS := WITI
180 IMAGE_SIZE := $(ralink_default_fw_size_16M)
181 DEVICE_TITLE := MQmaker WiTi
182 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci \
183 kmod-i2c-mt7621
184 endef
185 TARGET_DEVICES += witi
186
187 define Device/wndr3700v5
188 DTS := WNDR3700V5
189 IMAGE_SIZE := $(ralink_default_fw_size_16M)
190 DEVICE_TITLE := Netgear WNDR3700v5
191 DEVICE_PACKAGES := kmod-usb3
192 endef
193 TARGET_DEVICES += wndr3700v5
194
195 define Device/wsr-1166
196 DTS := WSR-1166
197 IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
198 IMAGE_SIZE := $(ralink_default_fw_size_16M)
199 DEVICE_TITLE := Buffalo WSR-1166
200 endef
201 TARGET_DEVICES += wsr-1166
202
203 define Device/wsr-600
204 DTS := WSR-600
205 IMAGE_SIZE := $(ralink_default_fw_size_16M)
206 DEVICE_TITLE := Buffalo WSR-600
207 endef
208 TARGET_DEVICES += wsr-600
209
210 define Device/zbt-wg2626
211 DTS := ZBT-WG2626
212 IMAGE_SIZE := $(ralink_default_fw_size_16M)
213 DEVICE_TITLE := ZBT WG2626
214 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci
215 endef
216 TARGET_DEVICES += zbt-wg2626
217
218 define Device/zbt-wg3526
219 DTS := ZBT-WG3526
220 IMAGE_SIZE := $(ralink_default_fw_size_16M)
221 DEVICE_TITLE := ZBT WG3526
222 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci
223 endef
224 TARGET_DEVICES += zbt-wg3526
225
226 # FIXME: is this still needed?
227 define Image/Prepare
228 #define Build/Compile
229 rm -rf $(KDIR)/relocate
230 $(CP) ../../generic/image/relocate $(KDIR)
231 $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
232 $(CP) $(KDIR)/relocate/loader.bin $(KDIR)/loader.bin
233 endef