mt7621.mk 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. #
  2. # MT7621 Profiles
  3. #
  4. define Build/ubnt-erx-factory-image
  5. if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \
  6. echo '21001:6' > $(1).compat; \
  7. $(TAR) -cf $(1) --transform='s/^.*/compat/' $(1).compat; \
  8. \
  9. $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp/' $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE); \
  10. mkhash md5 $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) > $(1).md5; \
  11. $(TAR) -rf $(1) --transform='s/^.*/vmlinux.tmp.md5/' $(1).md5; \
  12. \
  13. echo "dummy" > $(1).rootfs; \
  14. $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp/' $(1).rootfs; \
  15. \
  16. mkhash md5 $(1).rootfs > $(1).md5; \
  17. $(TAR) -rf $(1) --transform='s/^.*/squashfs.tmp.md5/' $(1).md5; \
  18. \
  19. echo '$(BOARD) $(VERSION_CODE) $(VERSION_NUMBER)' > $(1).version; \
  20. $(TAR) -rf $(1) --transform='s/^.*/version.tmp/' $(1).version; \
  21. \
  22. $(CP) $(1) $(BIN_DIR)/; \
  23. else \
  24. echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
  25. fi
  26. endef
  27. define Device/11acnas
  28. DTS := 11ACNAS
  29. IMAGE_SIZE := $(ralink_default_fw_size_16M)
  30. DEVICE_TITLE := WeVO 11AC NAS Router
  31. DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-mt76
  32. endef
  33. TARGET_DEVICES += 11acnas
  34. define Device/ac1200pro
  35. DTS := AC1200pro
  36. IMAGE_SIZE := $(ralink_default_fw_size_32M)
  37. DEVICE_TITLE := Digineo AC1200 Pro
  38. DEVICE_PACKAGES := kmod-usb3 kmod-ata-core kmod-ata-ahci
  39. endef
  40. TARGET_DEVICES += ac1200pro
  41. define Device/dir-860l-b1
  42. DTS := DIR-860L-B1
  43. BLOCKSIZE := 64k
  44. IMAGES += factory.bin
  45. KERNEL := kernel-bin | patch-dtb | relocate-kernel | lzma | uImage lzma
  46. IMAGE_SIZE := $(ralink_default_fw_size_16M)
  47. IMAGE/sysupgrade.bin := \
  48. append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
  49. seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
  50. pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
  51. IMAGE/factory.bin := \
  52. append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
  53. append-rootfs | pad-rootfs -x 64 | \
  54. seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
  55. seama-seal -m "signature=wrgac13_dlink.2013gui_dir860lb" | \
  56. check-size $$$$(IMAGE_SIZE)
  57. DEVICE_TITLE := D-Link DIR-860L B1
  58. DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
  59. endef
  60. TARGET_DEVICES += dir-860l-b1
  61. define Device/firewrt
  62. DTS := FIREWRT
  63. IMAGE_SIZE := $(ralink_default_fw_size_16M)
  64. DEVICE_TITLE := Firefly FireWRT
  65. DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
  66. endef
  67. TARGET_DEVICES += firewrt
  68. define Device/gb-pc1
  69. DTS := GB-PC1
  70. DEVICE_TITLE := GnuBee Personal Cloud One
  71. DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620
  72. IMAGE_SIZE := $(ralink_default_fw_size_32M)
  73. endef
  74. TARGET_DEVICES += gb-pc1
  75. define Device/mt7621
  76. DTS := MT7621
  77. BLOCKSIZE := 64k
  78. IMAGE_SIZE := $(ralink_default_fw_size_4M)
  79. DEVICE_TITLE := MediaTek MT7621 EVB
  80. endef
  81. TARGET_DEVICES += mt7621
  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
  87. endef
  88. TARGET_DEVICES += newifi-d1
  89. define Device/pbr-m1
  90. DTS := PBR-M1
  91. IMAGE_SIZE := $(ralink_default_fw_size_16M)
  92. DEVICE_TITLE := PBR-M1
  93. DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci
  94. endef
  95. TARGET_DEVICES += pbr-m1
  96. define Device/rb750gr3
  97. DTS := RB750Gr3
  98. IMAGE_SIZE := $(ralink_default_fw_size_16M)
  99. DEVICE_TITLE := MikroTik RB750Gr3
  100. DEVICE_PACKAGES := kmod-usb3 uboot-envtools -kmod-mt76 -kmod-rt2x00-lib -kmod-mac80211 -kmod-cfg80211 -wpad-mini -iwinfo
  101. endef
  102. TARGET_DEVICES += rb750gr3
  103. define Device/re6500
  104. DTS := RE6500
  105. DEVICE_TITLE := Linksys RE6500
  106. endef
  107. TARGET_DEVICES += re6500
  108. define Device/sap-g3200u3
  109. DTS := SAP-G3200U3
  110. DEVICE_TITLE := STORYLiNK SAP-G3200U3
  111. DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
  112. endef
  113. TARGET_DEVICES += sap-g3200u3
  114. define Device/sk-wb8
  115. DTS := SK-WB8
  116. IMAGE_SIZE := $(ralink_default_fw_size_16M)
  117. DEVICE_TITLE := SamKnows Whitebox 8
  118. DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport uboot-envtools
  119. endef
  120. TARGET_DEVICES += sk-wb8
  121. define Device/timecloud
  122. DTS := Timecloud
  123. DEVICE_TITLE := Thunder Timecloud
  124. DEVICE_PACKAGES := kmod-usb3
  125. endef
  126. TARGET_DEVICES += timecloud
  127. define Device/ubnt-erx
  128. DTS := UBNT-ERX
  129. FILESYSTEMS := squashfs
  130. KERNEL_SIZE := 3145728
  131. KERNEL := $(KERNEL_DTB) | uImage lzma
  132. IMAGES := sysupgrade.tar
  133. KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
  134. IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
  135. DEVICE_TITLE := Ubiquiti EdgeRouter X
  136. DEVICE_PACKAGES := -kmod-mt76 -kmod-mt7603 -kmod-mt76x2 -kmod-mt76-core -kmod-mac80211 -kmod-cfg80211 -wpad-mini -iwinfo
  137. endef
  138. TARGET_DEVICES += ubnt-erx
  139. define Device/vr500
  140. DTS := VR500
  141. IMAGE_SIZE := 66453504
  142. DEVICE_TITLE := Planex VR500
  143. DEVICE_PACKAGES := kmod-usb3
  144. endef
  145. TARGET_DEVICES += vr500
  146. define Device/w2914nsv2
  147. DTS := W2914NSV2
  148. IMAGE_SIZE := $(ralink_default_fw_size_16M)
  149. DEVICE_TITLE := WeVO W2914NS v2
  150. DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-mt76
  151. endef
  152. TARGET_DEVICES += w2914nsv2
  153. define Device/wf-2881
  154. DTS := WF-2881
  155. BLOCKSIZE := 128k
  156. PAGESIZE := 2048
  157. FILESYSTEMS := squashfs
  158. IMAGE_SIZE := 129280k
  159. KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
  160. UBINIZE_OPTS := -E 5
  161. IMAGE/sysupgrade.bin := append-kernel | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE)
  162. DEVICE_TITLE := NETIS WF-2881
  163. DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport
  164. endef
  165. TARGET_DEVICES += wf-2881
  166. define Device/witi
  167. DTS := WITI
  168. IMAGE_SIZE := $(ralink_default_fw_size_16M)
  169. DEVICE_TITLE := MQmaker WiTi
  170. DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci
  171. endef
  172. TARGET_DEVICES += witi
  173. define Device/wndr3700v5
  174. DTS := WNDR3700V5
  175. IMAGE_SIZE := $(ralink_default_fw_size_16M)
  176. DEVICE_TITLE := Netgear WNDR3700v5
  177. DEVICE_PACKAGES := kmod-usb3
  178. endef
  179. TARGET_DEVICES += wndr3700v5
  180. define Device/wsr-1166
  181. DTS := WSR-1166
  182. IMAGE/sysupgrade.bin := trx | pad-rootfs | append-metadata
  183. IMAGE_SIZE := $(ralink_default_fw_size_16M)
  184. DEVICE_TITLE := Buffalo WSR-1166
  185. endef
  186. TARGET_DEVICES += wsr-1166
  187. define Device/wsr-600
  188. DTS := WSR-600
  189. IMAGE_SIZE := $(ralink_default_fw_size_16M)
  190. DEVICE_TITLE := Buffalo WSR-600
  191. endef
  192. TARGET_DEVICES += wsr-600
  193. define Device/zbt-wg2626
  194. DTS := ZBT-WG2626
  195. IMAGE_SIZE := $(ralink_default_fw_size_16M)
  196. DEVICE_TITLE := ZBT WG2626
  197. DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci
  198. endef
  199. TARGET_DEVICES += zbt-wg2626
  200. define Device/zbt-wg3526
  201. DTS := ZBT-WG3526
  202. IMAGE_SIZE := $(ralink_default_fw_size_16M)
  203. DEVICE_TITLE := ZBT WG3526
  204. DEVICE_PACKAGES := kmod-usb3 kmod-usb-ledtrig-usbport kmod-ata-core kmod-ata-ahci
  205. endef
  206. TARGET_DEVICES += zbt-wg3526
  207. # FIXME: is this still needed?
  208. define Image/Prepare
  209. #define Build/Compile
  210. rm -rf $(KDIR)/relocate
  211. $(CP) ../../generic/image/relocate $(KDIR)
  212. $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
  213. $(CP) $(KDIR)/relocate/loader.bin $(KDIR)/loader.bin
  214. endef