generic-ubnt.mk 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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
  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 ath10k-firmware-qca988x
  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-pro
  93. $(Device/ubnt_unifiac)
  94. DEVICE_TITLE := Ubiquiti UniFi AC-Pro
  95. DEVICE_PACKAGES += kmod-usb-core kmod-usb2
  96. SUPPORTED_DEVICES += ubnt-unifiac-pro
  97. endef
  98. TARGET_DEVICES += ubnt_unifiac-pro