Makefile 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. include $(TOPDIR)/rules.mk
  2. include $(INCLUDE_DIR)/image.mk
  3. DEVICE_VARS += RAS_BOARD RAS_ROOTFS_SIZE RAS_VERSION
  4. define Device/Default
  5. PROFILES := Default
  6. KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
  7. KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
  8. KERNEL_PREFIX := $$(IMAGE_PREFIX)
  9. KERNEL_LOADADDR := 0x80208000
  10. SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
  11. IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata
  12. IMAGE/sysupgrade.bin/squashfs :=
  13. endef
  14. define Device/FitImage
  15. KERNEL_SUFFIX := -fit-uImage.itb
  16. KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
  17. KERNEL_NAME := Image
  18. endef
  19. define Device/FitImageLzma
  20. KERNEL_SUFFIX := -fit-uImage.itb
  21. KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
  22. KERNEL_NAME := Image
  23. endef
  24. define Device/UbiFit
  25. KERNEL_IN_UBI := 1
  26. IMAGES := nand-factory.ubi nand-sysupgrade.bin
  27. IMAGE/nand-factory.ubi := append-ubi
  28. IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata
  29. endef
  30. define Device/DniImage
  31. KERNEL_SUFFIX := -fit-uImage.itb
  32. KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
  33. KERNEL_NAME := Image
  34. NETGEAR_BOARD_ID :=
  35. NETGEAR_HW_ID :=
  36. IMAGES := factory.img sysupgrade.bin
  37. IMAGE/factory.img := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | netgear-dni
  38. IMAGE/sysupgrade.bin := append-kernel | pad-offset 64k 64 | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-rootfs | pad-rootfs | append-metadata
  39. endef
  40. DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
  41. define Device/8dev_jalapeno
  42. $(call Device/FitImage)
  43. $(call Device/UbiFit)
  44. DEVICE_DTS := qcom-ipq4018-jalapeno
  45. BLOCKSIZE := 128k
  46. PAGESIZE := 2048
  47. DEVICE_TITLE := 8devices Jalapeno
  48. endef
  49. TARGET_DEVICES += 8dev_jalapeno
  50. define Device/asus_rt-ac58u
  51. $(call Device/FitImageLzma)
  52. DEVICE_DTS := qcom-ipq4018-rt-ac58u
  53. BLOCKSIZE := 128k
  54. PAGESIZE := 2048
  55. DTB_SIZE := 65536
  56. DEVICE_TITLE := Asus RT-AC58U
  57. IMAGE_SIZE := 20439364
  58. FILESYSTEMS := squashfs
  59. # Someone - in their infinite wisdom - decided to put the firmware
  60. # version in front of the image name \03\00\00\04 => Version 3.0.0.4
  61. # Since u-boot works with strings we either need another fixup step
  62. # to add a version... or we are very careful not to add '\0' into that
  63. # string and call it a day.... Yeah, we do the latter!
  64. UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC58U')
  65. IMAGES := sysupgrade.bin
  66. DEVICE_PACKAGES := kmod-usb-ledtrig-usbport
  67. endef
  68. TARGET_DEVICES += asus_rt-ac58u
  69. define Device/avm_fritzbox-4040
  70. $(call Device/FitImageLzma)
  71. DEVICE_DTS := qcom-ipq4018-fritz4040
  72. BOARD_NAME := fritz4040
  73. DEVICE_TITLE := AVM Fritz!Box 4040
  74. IMAGE_SIZE := 29753344
  75. UBOOT_PATH := $$(BIN_DIR)/u-boot-fritz4040/uboot-fritz4040.bin
  76. UBOOT_PARTITION_SIZE := 524288
  77. IMAGES = eva.bin sysupgrade.bin
  78. IMAGE/eva.bin := append-uboot | pad-to $$$$(UBOOT_PARTITION_SIZE) | append-kernel | append-rootfs | pad-rootfs
  79. IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
  80. DEVICE_PACKAGES := fritz-tffs fritz-caldata u-boot-fritz4040
  81. endef
  82. TARGET_DEVICES += avm_fritzbox-4040
  83. define Device/compex_wpj428
  84. $(call Device/FitImage)
  85. DEVICE_DTS := qcom-ipq4028-wpj428
  86. DEVICE_DTS_CONFIG := config@4
  87. BLOCKSIZE := 64k
  88. DEVICE_TITLE := Compex WPJ428
  89. IMAGE_SIZE := 31232k
  90. KERNEL_SIZE := 4096k
  91. IMAGES = sysupgrade.bin
  92. IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
  93. DEVICE_PACKAGES := kmod-gpio-beeper
  94. endef
  95. TARGET_DEVICES += compex_wpj428
  96. define Device/glinet_gl-b1300
  97. $(call Device/FitImage)
  98. DEVICE_TITLE := GL.iNet GL-B1300
  99. BOARD_NAME := gl-b1300
  100. DEVICE_DTS := qcom-ipq4029-gl-b1300
  101. KERNEL_SIZE := 4096k
  102. IMAGE_SIZE := 26624k
  103. IMAGES := sysupgrade.bin
  104. IMAGE/sysupgrade.bin := append-kernel |append-rootfs | pad-rootfs | append-metadata
  105. endef
  106. TARGET_DEVICES += glinet_gl-b1300
  107. define Device/meraki_mr33
  108. $(call Device/FitImage)
  109. DEVICE_DTS := qcom-ipq4029-mr33
  110. BLOCKSIZE := 131072
  111. PAGESIZE := 2048
  112. DEVICE_TITLE := Cisco Meraki MR33
  113. IMAGES = sysupgrade.bin
  114. DEVICE_PACKAGES := -swconfig ath10k-firmware-qca9887-ct
  115. endef
  116. TARGET_DEVICES += meraki_mr33
  117. define Device/netgear_ex61x0v2
  118. $(call Device/DniImage)
  119. KERNEL_SIZE := 3080192
  120. DEVICE_DTS_CONFIG := config@4
  121. NETGEAR_BOARD_ID := EX6150v2series
  122. NETGEAR_HW_ID := 29765285+16+0+128+2x2
  123. endef
  124. define Device/netgear_ex6100v2
  125. $(call Device/netgear_ex61x0v2)
  126. DEVICE_DTS := qcom-ipq4018-ex6100v2
  127. DEVICE_TITLE := Netgear EX6100v2
  128. endef
  129. TARGET_DEVICES += netgear_ex6100v2
  130. define Device/netgear_ex6150v2
  131. $(call Device/netgear_ex61x0v2)
  132. DEVICE_DTS := qcom-ipq4018-ex6150v2
  133. DEVICE_TITLE := Netgear EX6150v2
  134. endef
  135. TARGET_DEVICES += netgear_ex6150v2
  136. define Device/openmesh_a42
  137. $(call Device/FitImageLzma)
  138. DEVICE_DTS := qcom-ipq4018-a42
  139. DEVICE_DTS_CONFIG := [email protected]
  140. BLOCKSIZE := 64k
  141. DEVICE_TITLE := OpenMesh A42
  142. KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
  143. IMAGE_SIZE := 15616k
  144. IMAGES = factory.bin sysupgrade.bin
  145. IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42
  146. IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
  147. DEVICE_PACKAGES := uboot-envtools
  148. endef
  149. TARGET_DEVICES += openmesh_a42
  150. define Device/openmesh_a62
  151. $(call Device/FitImageLzma)
  152. DEVICE_DTS := qcom-ipq4019-a62
  153. DEVICE_DTS_CONFIG := [email protected]
  154. BLOCKSIZE := 64k
  155. DEVICE_TITLE := OpenMesh A62
  156. KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb | pad-to $$(BLOCKSIZE)
  157. IMAGE_SIZE := 15552k
  158. IMAGES = factory.bin sysupgrade.bin
  159. IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62
  160. IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
  161. DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools
  162. endef
  163. TARGET_DEVICES += openmesh_a62
  164. define Device/qcom_ap-dk01.1-c1
  165. DEVICE_TITLE := QCA AP-DK01.1-C1
  166. BOARD_NAME := ap-dk01.1-c1
  167. DEVICE_DTS := qcom-ipq4019-ap.dk01.1-c1
  168. KERNEL_INSTALL := 1
  169. KERNEL_SIZE := 4096k
  170. IMAGE_SIZE := 26624k
  171. $(call Device/FitImage)
  172. IMAGES := sysupgrade.bin
  173. IMAGE/sysupgrade.bin := append-kernel | pad-to $$$${KERNEL_SIZE} | append-rootfs | pad-rootfs | append-metadata
  174. endef
  175. TARGET_DEVICES += qcom_ap-dk01.1-c1
  176. define Device/qcom_ap-dk04.1-c1
  177. $(call Device/FitImage)
  178. $(call Device/UbiFit)
  179. DEVICE_DTS := qcom-ipq4019-ap.dk04.1-c1
  180. KERNEL_INSTALL := 1
  181. KERNEL_SIZE := 4048k
  182. BLOCKSIZE := 128k
  183. PAGESIZE := 2048
  184. BOARD_NAME := ap-dk04.1-c1
  185. DEVICE_TITLE := QCA AP-DK04.1-C1
  186. endef
  187. TARGET_DEVICES += qcom_ap-dk04.1-c1
  188. define Device/zyxel_nbg6617
  189. $(call Device/FitImageLzma)
  190. DEVICE_DTS := qcom-ipq4018-nbg6617
  191. DEVICE_TITLE := ZyXEL NBG6617
  192. ROOTFS_SIZE := 24960k
  193. RAS_BOARD := NBG6617
  194. RAS_ROOTFS_SIZE := 19840k
  195. RAS_VERSION := "$(VERSION_DIST) $(REVISION)"
  196. IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
  197. IMAGES := sysupgrade.bin factory.bin
  198. # The ZyXEL firmware allows flashing thru the web-gui only when the rootfs is
  199. # at least as large as the one of the initial firmware image (not the current
  200. # one on the device). This only applies to the Web-UI, the bootlaoder ignores
  201. # this minimum-size. However, the larger image can be flashed both ways.
  202. IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel
  203. IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
  204. DEVICE_PACKAGES := ipq-wifi-zyxel_nbg6617 uboot-envtools
  205. endef
  206. TARGET_DEVICES += zyxel_nbg6617
  207. define Device/zyxel_wre6606
  208. $(call Device/FitImage)
  209. DEVICE_TITLE := ZyXEL WRE6606
  210. DEVICE_DTS_CONFIG := config@4
  211. DEVICE_DTS := qcom-ipq4018-wre6606
  212. DEVICE_PACKAGES := ipq-wifi-zyxel_wre6606
  213. IMAGES := sysupgrade.bin
  214. IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
  215. endef
  216. TARGET_DEVICES += zyxel_wre6606
  217. $(eval $(call BuildImage))