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