generic-ubnt.mk 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. DEVICE_VARS += UBNT_BOARD UBNT_CHIP UBNT_TYPE
  2. # mkubntimage is using the kernel image direct
  3. # routerboard creates partitions out of the ubnt header
  4. define Build/mkubntimage
  5. -$(STAGING_DIR_HOST)/bin/mkfwimage \
  6. -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
  7. -k $(IMAGE_KERNEL) \
  8. -r $@ \
  9. -o $@
  10. endef
  11. # all UBNT XM device expect the kernel image to have 1024k while flash, when
  12. # booting the image, the size doesn't matter.
  13. define Build/mkubntimage-split
  14. -[ -f $@ ] && ( \
  15. dd if=$@ [email protected] bs=1024k count=1; \
  16. dd if=$@ [email protected] bs=1024k skip=1; \
  17. $(STAGING_DIR_HOST)/bin/mkfwimage \
  18. -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-$(VERSION_DIST)-$(REVISION) \
  19. -k [email protected] \
  20. -r [email protected] \
  21. -o $@; \
  22. rm [email protected] [email protected] )
  23. endef
  24. # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
  25. # UBNT_TYPE e.g. one of (BZ, XM, XW)
  26. # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
  27. define Device/ubnt
  28. DEVICE_PACKAGES := kmod-usb-core kmod-usb2
  29. IMAGE_SIZE := 7552k
  30. UBNT_BOARD := XM
  31. IMAGES += factory.bin
  32. IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
  33. append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE) | mkubntimage-split
  34. endef
  35. define Device/ubnt-xm
  36. $(Device/ubnt)
  37. DEVICE_PACKAGES += kmod-usb-ohci rssileds
  38. UBNT_TYPE := XM
  39. UBNT_CHIP := ar7240
  40. ATH_SOC := ar7241
  41. KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
  42. endef
  43. define Device/ubnt-bz
  44. $(Device/ubnt)
  45. UBNT_TYPE := BZ
  46. UBNT_CHIP := ar7240
  47. ATH_SOC := ar7241
  48. endef
  49. define Device/ubnt_bullet-m
  50. $(Device/ubnt-xm)
  51. DEVICE_TITLE := Ubiquiti Bullet-M
  52. SUPPORTED_DEVICES += bullet-m
  53. endef
  54. TARGET_DEVICES += ubnt_bullet-m
  55. define Device/ubnt_rocket-m
  56. $(Device/ubnt-xm)
  57. DEVICE_TITLE := Ubiquiti Rocket-M
  58. SUPPORTED_DEVICES += rocket-m
  59. endef
  60. TARGET_DEVICES += ubnt_rocket-m
  61. define Device/ubnt_nano-m
  62. $(Device/ubnt-xm)
  63. DEVICE_TITLE := Ubiquiti Nano-M
  64. SUPPORTED_DEVICES += nano-m
  65. endef
  66. TARGET_DEVICES += ubnt_nano-m
  67. define Device/ubnt_unifi
  68. $(Device/ubnt-bz)
  69. DEVICE_TITLE := Ubiquiti UniFi
  70. SUPPORTED_DEVICES += unifi
  71. endef
  72. TARGET_DEVICES += ubnt_unifi
  73. define Device/ubnt_unifiac
  74. ATH_SOC := qca9563
  75. IMAGE_SIZE := 7744k
  76. IMAGES := sysupgrade.bin
  77. IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
  78. DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
  79. endef
  80. define Device/ubnt_unifiac-lite
  81. $(Device/ubnt_unifiac)
  82. DEVICE_TITLE := Ubiquiti UniFi AC-Lite
  83. SUPPORTED_DEVICES += ubnt-unifiac-lite
  84. endef
  85. TARGET_DEVICES += ubnt_unifiac-lite
  86. define Device/ubnt_unifiac-mesh
  87. $(Device/ubnt_unifiac)
  88. DEVICE_TITLE := Ubiquiti UniFi AC-Mesh
  89. SUPPORTED_DEVICES += ubnt-unifiac-mesh
  90. endef
  91. TARGET_DEVICES += ubnt_unifiac-mesh
  92. define Device/ubnt_unifiac-mesh-pro
  93. $(Device/ubnt_unifiac)
  94. DEVICE_TITLE := Ubiquiti UniFi AC-Mesh Pro
  95. SUPPORTED_DEVICES += ubnt-unifiac-mesh-pro
  96. endef
  97. TARGET_DEVICES += ubnt_unifiac-mesh-pro
  98. define Device/ubnt_unifiac-pro
  99. $(Device/ubnt_unifiac)
  100. DEVICE_TITLE := Ubiquiti UniFi AC-Pro
  101. DEVICE_PACKAGES += kmod-usb-core kmod-usb2
  102. SUPPORTED_DEVICES += ubnt-unifiac-pro
  103. endef
  104. TARGET_DEVICES += ubnt_unifiac-pro
  105. define Device/ubnt_routerstation_common
  106. DEVICE_PACKAGES := -kmod-ath9k -wpad-mini -uboot-envtools kmod-usb-ohci kmod-usb2 fconfig
  107. ATH_SOC := ar7161
  108. IMAGE_SIZE := 16128k
  109. IMAGES := sysupgrade.bin factory.bin
  110. IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | check-size $$$$(IMAGE_SIZE)
  111. IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | combined-image | check-size $$$$(IMAGE_SIZE) | append-metadata
  112. KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
  113. KERNEL_INITRAMFS := kernel-bin | append-dtb
  114. endef
  115. define Device/ubnt_routerstation
  116. $(Device/ubnt_routerstation_common)
  117. DEVICE_TITLE := Ubiquiti RouterStation
  118. UBNT_BOARD := RS
  119. UBNT_TYPE := RSx
  120. UBNT_CHIP := ar7100
  121. DEVICE_PACKAGES += -swconfig
  122. endef
  123. TARGET_DEVICES += ubnt_routerstation
  124. define Device/ubnt_routerstation-pro
  125. $(Device/ubnt_routerstation_common)
  126. DEVICE_TITLE := Ubiquiti RouterStation Pro
  127. UBNT_BOARD := RSPRO
  128. UBNT_TYPE := RSPRO
  129. UBNT_CHIP := ar7100pro
  130. endef
  131. TARGET_DEVICES += ubnt_routerstation-pro