generic-ubnt.mk 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. DEVICE_VARS += UBNT_BOARD UBNT_CHIP UBNT_TYPE UBNT_VERSION UBNT_REVISION
  2. # On M (XW) devices the U-Boot as of version 1.1.4-s1039 doesn't like
  3. # VERSION_DIST being on the place of major(?) version number, so we need to
  4. # use some number.
  5. UBNT_REVISION := $(VERSION_DIST)-$(REVISION)
  6. # mkubntimage is using the kernel image direct
  7. # routerboard creates partitions out of the ubnt header
  8. define Build/mkubntimage
  9. -$(STAGING_DIR_HOST)/bin/mkfwimage \
  10. -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
  11. -k $(IMAGE_KERNEL) \
  12. -r $@ \
  13. -o $@
  14. endef
  15. # all UBNT XM/WA devices expect the kernel image to have 1024k while flash, when
  16. # booting the image, the size doesn't matter.
  17. define Build/mkubntimage-split
  18. -[ -f $@ ] && ( \
  19. dd if=$@ of=$@.old1 bs=1024k count=1; \
  20. dd if=$@ of=$@.old2 bs=1024k skip=1; \
  21. $(STAGING_DIR_HOST)/bin/mkfwimage \
  22. -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v$(UBNT_VERSION)-$(UBNT_REVISION) \
  23. -k $@.old1 \
  24. -r $@.old2 \
  25. -o $@; \
  26. rm $@.old1 $@.old2 )
  27. endef
  28. # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
  29. # UBNT_TYPE e.g. one of (BZ, XM, XW)
  30. # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
  31. # UBNT_VERSION e.g. one of (6.0.0, 8.5.0)
  32. define Device/ubnt
  33. DEVICE_PACKAGES := kmod-usb-core kmod-usb2
  34. IMAGE_SIZE := 7552k
  35. UBNT_BOARD := XM
  36. UBNT_VERSION := 6.0.0
  37. IMAGES += factory.bin
  38. IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
  39. append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | mkubntimage-split
  40. endef
  41. define Device/ubnt-xm
  42. $(Device/ubnt)
  43. DEVICE_PACKAGES += kmod-usb-ohci rssileds
  44. UBNT_TYPE := XM
  45. UBNT_CHIP := ar7240
  46. ATH_SOC := ar7241
  47. KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
  48. endef
  49. define Device/ubnt-bz
  50. $(Device/ubnt)
  51. UBNT_TYPE := BZ
  52. UBNT_CHIP := ar7240
  53. ATH_SOC := ar7241
  54. endef
  55. define Device/ubnt-wa
  56. $(Device/ubnt)
  57. UBNT_TYPE := WA
  58. UBNT_CHIP := ar934x
  59. UBNT_BOARD := WA
  60. UBNT_VERSION := 8.5.0
  61. ATH_SOC := ar9342
  62. endef
  63. define Device/ubnt-xw
  64. $(Device/ubnt)
  65. UBNT_TYPE := XW
  66. UBNT_CHIP := ar934x
  67. UBNT_BOARD := XM
  68. UBNT_VERSION := 6.0.4
  69. UBNT_REVISION := 42.$(UBNT_REVISION)
  70. ATH_SOC := ar9342
  71. endef
  72. define Device/ubnt_airrouter
  73. $(Device/ubnt-xm)
  74. DEVICE_TITLE := Ubiquiti AirRouter
  75. SUPPORTED_DEVICES += airrouter
  76. endef
  77. TARGET_DEVICES += ubnt_airrouter
  78. define Device/ubnt_bullet-m
  79. $(Device/ubnt-xm)
  80. DEVICE_TITLE := Ubiquiti Bullet-M
  81. SUPPORTED_DEVICES += bullet-m
  82. endef
  83. TARGET_DEVICES += ubnt_bullet-m
  84. define Device/ubnt_bullet-m-xw
  85. $(Device/ubnt-xw)
  86. DEVICE_TITLE := Ubiquiti Bullet-M (XW)
  87. SUPPORTED_DEVICES += bullet-m-xw
  88. endef
  89. TARGET_DEVICES += ubnt_bullet-m-xw
  90. define Device/ubnt_rocket-m
  91. $(Device/ubnt-xm)
  92. DEVICE_TITLE := Ubiquiti Rocket-M
  93. SUPPORTED_DEVICES += rocket-m
  94. endef
  95. TARGET_DEVICES += ubnt_rocket-m
  96. define Device/ubnt_nanostation-m
  97. $(Device/ubnt-xm)
  98. DEVICE_TITLE := Ubiquiti Nanostation M
  99. SUPPORTED_DEVICES += nano-m
  100. endef
  101. TARGET_DEVICES += ubnt_nanostation-m
  102. define Device/ubnt_nanostation-m-xw
  103. $(Device/ubnt-xw)
  104. DEVICE_TITLE := Ubiquiti Nanostation M (XW)
  105. SUPPORTED_DEVICES += nano-m-xw
  106. endef
  107. TARGET_DEVICES += ubnt_nanostation-m-xw
  108. define Device/ubnt_lap-120
  109. $(Device/ubnt-wa)
  110. DEVICE_TITLE := Ubiquiti LiteAP ac (LAP-120)
  111. DEVICE_PACKAGES +=
  112. IMAGE_SIZE := 15744k
  113. IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split
  114. endef
  115. TARGET_DEVICES += ubnt_lap-120
  116. define Device/ubnt_nanobeam-ac
  117. $(Device/ubnt-wa)
  118. DEVICE_TITLE := Ubiquiti NanoBeam AC
  119. DEVICE_PACKAGES +=
  120. IMAGE_SIZE := 15744k
  121. IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split
  122. endef
  123. TARGET_DEVICES += ubnt_nanobeam-ac
  124. define Device/ubnt_nanostation-ac
  125. $(Device/ubnt-wa)
  126. DEVICE_TITLE := Ubiquiti Nanostation AC
  127. DEVICE_PACKAGES +=
  128. IMAGE_SIZE := 15744k
  129. IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split
  130. endef
  131. TARGET_DEVICES += ubnt_nanostation-ac
  132. define Device/ubnt_nanostation-ac-loco
  133. $(Device/ubnt-wa)
  134. DEVICE_TITLE := Ubiquiti Nanostation AC loco
  135. DEVICE_PACKAGES +=
  136. IMAGE_SIZE := 15744k
  137. IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | mkubntimage-split
  138. endef
  139. TARGET_DEVICES += ubnt_nanostation-ac-loco
  140. define Device/ubnt_unifi
  141. $(Device/ubnt-bz)
  142. DEVICE_TITLE := Ubiquiti UniFi
  143. SUPPORTED_DEVICES += unifi
  144. endef
  145. TARGET_DEVICES += ubnt_unifi
  146. define Device/ubnt_unifiac
  147. ATH_SOC := qca9563
  148. IMAGE_SIZE := 7744k
  149. DEVICE_PACKAGES :=
  150. endef
  151. define Device/ubnt_unifiac-lite
  152. $(Device/ubnt_unifiac)
  153. DEVICE_TITLE := Ubiquiti UniFi AC-Lite
  154. SUPPORTED_DEVICES += ubnt-unifiac-lite
  155. endef
  156. TARGET_DEVICES += ubnt_unifiac-lite
  157. define Device/ubnt_unifiac-mesh
  158. $(Device/ubnt_unifiac)
  159. DEVICE_TITLE := Ubiquiti UniFi AC-Mesh
  160. SUPPORTED_DEVICES += ubnt-unifiac-mesh
  161. endef
  162. TARGET_DEVICES += ubnt_unifiac-mesh
  163. define Device/ubnt_unifiac-mesh-pro
  164. $(Device/ubnt_unifiac)
  165. DEVICE_TITLE := Ubiquiti UniFi AC-Mesh Pro
  166. SUPPORTED_DEVICES += ubnt-unifiac-mesh-pro
  167. endef
  168. TARGET_DEVICES += ubnt_unifiac-mesh-pro
  169. define Device/ubnt_unifiac-pro
  170. $(Device/ubnt_unifiac)
  171. DEVICE_TITLE := Ubiquiti UniFi AC-Pro
  172. DEVICE_PACKAGES += kmod-usb-core kmod-usb2
  173. SUPPORTED_DEVICES += ubnt-unifiac-pro
  174. endef
  175. TARGET_DEVICES += ubnt_unifiac-pro
  176. define Device/ubnt_routerstation_common
  177. DEVICE_PACKAGES := -kmod-ath9k -wpad-mini -uboot-envtools kmod-usb-ohci kmod-usb2 fconfig
  178. ATH_SOC := ar7161
  179. IMAGE_SIZE := 16128k
  180. IMAGES += factory.bin
  181. IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | check-size $$$$(IMAGE_SIZE)
  182. IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | combined-image | check-size $$$$(IMAGE_SIZE)
  183. # IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
  184. KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
  185. KERNEL_INITRAMFS := kernel-bin | append-dtb
  186. endef
  187. define Device/ubnt_routerstation
  188. $(Device/ubnt_routerstation_common)
  189. DEVICE_TITLE := Ubiquiti RouterStation
  190. UBNT_BOARD := RS
  191. UBNT_TYPE := RSx
  192. UBNT_CHIP := ar7100
  193. DEVICE_PACKAGES += -swconfig
  194. endef
  195. TARGET_DEVICES += ubnt_routerstation
  196. define Device/ubnt_routerstation-pro
  197. $(Device/ubnt_routerstation_common)
  198. DEVICE_TITLE := Ubiquiti RouterStation Pro
  199. UBNT_BOARD := RSPRO
  200. UBNT_TYPE := RSPRO
  201. UBNT_CHIP := ar7100pro
  202. endef
  203. TARGET_DEVICES += ubnt_routerstation-pro
  204. define Device/ubnt_acb-isp
  205. $(Device/ubnt)
  206. ATH_SOC := qca9533
  207. IMAGE_SIZE := 15744k
  208. DEVICE_TITLE := Ubiquiti airCube ISP
  209. UBNT_BOARD := ACB-ISP
  210. UBNT_TYPE := ACB
  211. UBNT_CHIP := qca9533
  212. IMAGES := sysupgrade.bin
  213. endef
  214. TARGET_DEVICES += ubnt_acb-isp