59744087905e4b03f27e5ec3593ddae6ea5d7777
[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 := 64k
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 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
76 endef
77 TARGET_DEVICES += dir-860l-b1
78
79 define Device/firewrt
80 DTS := FIREWRT
81 IMAGE_SIZE := $(ralink_default_fw_size_16M)
82 DEVICE_TITLE := Firefly FireWRT
83 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
84 endef
85 TARGET_DEVICES += firewrt
86
87 define Device/newifi-d1
88 DTS := Newifi-D1
89 IMAGE_SIZE := $(ralink_default_fw_size_16M)
90 DEVICE_TITLE := Newifi D1
91 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-i2c-mt7621
92 endef
93 TARGET_DEVICES += newifi-d1
94
95 define Device/pbr-m1
96 DTS := PBR-M1
97 IMAGE_SIZE := $(ralink_default_fw_size_16M)
98 DEVICE_TITLE := PBR-M1
99 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci \
100 kmod-i2c-mt7621
101 endef
102 TARGET_DEVICES += pbr-m1
103
104 define Device/sap-g3200u3
105 DTS := SAP-G3200U3
106 DEVICE_TITLE := STORYLiNK SAP-G3200U3
107 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
108 endef
109 TARGET_DEVICES += sap-g3200u3
110
111 define Device/timecloud
112 DTS := Timecloud
113 DEVICE_TITLE := Thunder Timecloud
114 DEVICE_PACKAGES := kmod-usb3
115 endef
116 TARGET_DEVICES += timecloud
117
118 define Device/witi
119 DTS := WITI
120 IMAGE_SIZE := $(ralink_default_fw_size_16M)
121 DEVICE_TITLE := MQmaker WiTi
122 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci \
123 kmod-i2c-mt7621
124 endef
125 TARGET_DEVICES += witi
126
127 define Device/wndr3700v5
128 DTS := WNDR3700V5
129 IMAGE_SIZE := $(ralink_default_fw_size_16M)
130 DEVICE_TITLE := Netgear WNDR3700v5
131 DEVICE_PACKAGES := kmod-usb3
132 endef
133 TARGET_DEVICES += wndr3700v5
134
135 define Device/zbt-wg2626
136 DTS := ZBT-WG2626
137 IMAGE_SIZE := $(ralink_default_fw_size_16M)
138 DEVICE_TITLE := ZBT WG2626
139 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci
140 endef
141 TARGET_DEVICES += zbt-wg2626
142
143 define Device/zbt-wg3526
144 DTS := ZBT-WG3526
145 IMAGE_SIZE := $(ralink_default_fw_size_16M)
146 DEVICE_TITLE := ZBT WG3526
147 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci
148 endef
149 TARGET_DEVICES += zbt-wg3526
150
151 define Device/wf-2881
152 DTS := WF-2881
153 BLOCKSIZE := 128k
154 PAGESIZE := 2048
155 FILESYSTEMS := squashfs
156 IMAGE_SIZE := 129280k
157 KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
158 UBINIZE_OPTS := -E 5
159 IMAGE/sysupgrade.bin := append-kernel | append-ubi | check-size $$$$(IMAGE_SIZE)
160 DEVICE_TITLE := NETIS WF-2881
161 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
162 endef
163 TARGET_DEVICES += wf-2881
164
165 define Device/ubnt-erx
166 DTS := UBNT-ERX
167 FILESYSTEMS := squashfs
168 KERNEL_SIZE := 3145728
169 KERNEL := $(KERNEL_DTB) | uImage lzma
170 IMAGES := sysupgrade.tar
171 KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
172 IMAGE/sysupgrade.tar := sysupgrade-tar
173 DEVICE_TITLE := Ubiquiti EdgeRouter X
174 DEVICE_PACKAGES := -kmod-mt76 -kmod-rt2x00-lib -kmod-mac80211 -kmod-cfg80211 -wpad-mini -iwinfo
175 endef
176 TARGET_DEVICES += ubnt-erx
177
178 define Device/sk-wb8
179 DTS := SK-WB8
180 IMAGE_SIZE := $(ralink_default_fw_size_16M)
181 DEVICE_TITLE := SamKnows Whitebox 8
182 DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport uboot-envtools
183 endef
184 TARGET_DEVICES += sk-wb8
185
186 define Device/vr500
187 DTS := VR500
188 IMAGE_SIZE := 66453504
189 DEVICE_TITLE := Planex VR500
190 DEVICE_PACKAGES := kmod-usb3
191 endef
192 TARGET_DEVICES += vr500
193
194 # FIXME: is this still needed?
195 define Image/Prepare
196 #define Build/Compile
197 rm -rf $(KDIR)/relocate
198 $(CP) ../../generic/image/relocate $(KDIR)
199 $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
200 $(CP) $(KDIR)/relocate/loader.bin $(KDIR)/loader.bin
201 endef