Makefile 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  1. #
  2. # Copyright (C) 2010-2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. # boards missing since devicetree update
  8. #EASY50712 ARV3527P
  9. JFFS2_BLOCKSIZE = 64k 128k 256k
  10. KERNEL_LOADADDR = 0x80002000
  11. KERNEL_ENTRY = 0x80002000
  12. include $(TOPDIR)/rules.mk
  13. include $(INCLUDE_DIR)/image.mk
  14. LOADER_MAKE := $(NO_TRACE_MAKE) -C lzma-loader KDIR=$(KDIR)
  15. define Image/BuildLoader/Template
  16. -rm -rf $(KDIR)/lzma-loader
  17. $(LOADER_MAKE) LOADER=loader$(2)-$(1).bin\
  18. LZMA_TEXT_START=0x80a00000 \
  19. LOADADDR=0x80002000 \
  20. LOADER_DATA="$(KDIR)/vmlinux$(2)-$(1).lzma" BOARD="$(1)" \
  21. compile loader.bin
  22. endef
  23. define CompressLzma
  24. $(STAGING_DIR_HOST)/bin/lzma e $(1) $(2)
  25. endef
  26. define PatchKernelLzma
  27. cp $(KDIR)/vmlinux$(2) $(KDIR)/vmlinux$(2)-$(1)
  28. $(LINUX_DIR)/scripts/dtc/dtc -O dtb -o $(KDIR)/$(1).dtb ../dts/$(1).dts
  29. cat $(KDIR)/vmlinux$(2)-$(1) $(KDIR)/$(1).dtb > $(KDIR)/vmlinux$(2)-$(1).tmp
  30. $(call CompressLzma,$(KDIR)/vmlinux$(2)-$(1).tmp,$(KDIR)/vmlinux$(2)-$(1).lzma)
  31. endef
  32. define MkImageLzma
  33. mkimage -A mips -O linux -T kernel -a 0x80002000 -C lzma \
  34. -e 0x80002000 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
  35. -d $(KDIR)/vmlinux$(2)-$(1).lzma $(KDIR)/uImage-$(1)$(2)
  36. endef
  37. define MkImageEVA
  38. lzma2eva 0x80002000 0x80002000 $(KDIR)/vmlinux$(2)-$(1).lzma $(KDIR)/$(1)$(2).eva.prealign
  39. dd if=$(KDIR)/$(1)$(2).eva.prealign of=$(KDIR)/$(1)$(2).eva.align.64k bs=64k conv=sync
  40. dd if=$(KDIR)/$(1)$(2).eva.prealign of=$(KDIR)/$(1)$(2).eva.align.128k bs=128k conv=sync
  41. cat ./eva.dummy.squashfs >> $(KDIR)/$(1)$(2).eva.align.64k
  42. endef
  43. define Image/Build/squashfs
  44. cat $(KDIR)/uImage-$(2) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
  45. $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image)
  46. endef
  47. DGN3500_SKERNEL=0x50000
  48. DGN3500_SKERNEL_DECIMAL=327680
  49. define Image/BuildDGN3500/squashfs
  50. dd if=/dev/zero of=$(BIN_DIR)/$(IMG_PREFIX)-pad bs=$(DGN3500_SKERNEL_DECIMAL) count=1
  51. cat $(BIN_DIR)/$(IMG_PREFIX)-pad $(KDIR)/uImage-$(2) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img
  52. rm -r $(BIN_DIR)/$(IMG_PREFIX)-pad
  53. dd if=/dev/zero ibs=16M count=1 | tr "\000" "\377" > $(BIN_DIR)/$(IMG_PREFIX)-pwf
  54. cp $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.img
  55. dgn3500sum $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.img $(DGN3500_SKERNEL) NA
  56. $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.img)
  57. cp $(BIN_DIR)/$(IMG_PREFIX)-pwf $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-NA.img
  58. dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.img of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-NA.img conv=notrunc
  59. dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.img of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-sysupgrade-NA.image bs=$(DGN3500_SKERNEL_DECIMAL) skip=1
  60. rm -r $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadNA.img
  61. mv $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.img
  62. dgn3500sum $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.img $(DGN3500_SKERNEL) WW
  63. $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.img)
  64. mv $(BIN_DIR)/$(IMG_PREFIX)-pwf $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-WW.img
  65. dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.img of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-WW.img conv=notrunc
  66. dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.img of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-sysupgrade-WW.image bs=$(DGN3500_SKERNEL_DECIMAL) skip=1
  67. rm -r $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepadWW.img
  68. endef
  69. define Image/BuildDGN3500B/squashfs
  70. dd if=/dev/zero of=$(BIN_DIR)/$(IMG_PREFIX)-pad bs=327680 count=1
  71. cat $(BIN_DIR)/$(IMG_PREFIX)-pad $(KDIR)/uImage-$(2) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img
  72. rm -r $(BIN_DIR)/$(IMG_PREFIX)-pad
  73. dd if=/dev/zero ibs=16M count=1 | tr "\000" "\377" > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory.img
  74. dgn3500sum $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img $(DGN3500_SKERNEL) DE
  75. $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img)
  76. dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory.img conv=notrunc
  77. dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-sysupgrade.image bs=$(DGN3500_SKERNEL_DECIMAL) skip=1
  78. rm -r $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory-prepad.img
  79. dgn3500sum $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-sysupgrade.image $(DGN3500_SKERNEL) DE
  80. endef
  81. define Image/BuildEVA/squashfs
  82. cat $(KDIR)/$(2).eva.align.64k $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image.eva
  83. $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image.eva)
  84. endef
  85. define Image/BuildLoader/squashfs
  86. dd if=$(KDIR)/loader-$(2).bin of=$(KDIR)/loader-$(2).bin.padded bs=3072k conv=sync
  87. cat $(KDIR)/loader-$(2).bin.padded $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
  88. $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image)
  89. endef
  90. define Image/BuildEVA/jffs2-128k
  91. cat $(KDIR)/$(2).eva.align.128k $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image.eva
  92. endef
  93. define Image/Build/jffs2-64k
  94. dd if=$(KDIR)/uImage-$(2) of=$(KDIR)/uImage-$(2)-$(1) bs=64k conv=sync
  95. cat $(KDIR)/uImage-$(2)-$(1) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
  96. endef
  97. define Image/Build/jffs2-128k
  98. dd if=$(KDIR)/uImage-$(2) of=$(KDIR)/uImage-$(2)-$(1) bs=128k conv=sync
  99. cat $(KDIR)/uImage-$(2)-$(1) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
  100. endef
  101. define Image/Build/jffs2-256k
  102. dd if=$(KDIR)/uImage-$(2) of=$(KDIR)/uImage-$(2)-$(1) bs=256k conv=sync
  103. cat $(KDIR)/uImage-$(2)-$(1) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
  104. endef
  105. ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  106. define Image/BuildKernel/InitramfsTemplate
  107. $(call PatchKernelLzma,$(1),-initramfs)
  108. $(call MkImageLzma,$(1),-initramfs)
  109. $(CP) $(KDIR)/uImage-$(1)-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(1)-uImage-initramfs
  110. endef
  111. endif
  112. define Image/BuildKernel/Template
  113. $(call PatchKernelLzma,$(1))
  114. $(call MkImageLzma,$(1))
  115. $(CP) $(KDIR)/uImage-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-uImage
  116. $(Image/BuildKernel/InitramfsTemplate)
  117. endef
  118. ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  119. define Image/BuildKernelLoader/InitramfsTemplate
  120. $(CP) $(KDIR)/loader-initramfs-$(1).bin $(BIN_DIR)/$(IMG_PREFIX)-$(1)-vmlinux-initramfs-loader
  121. $(CP) $(KDIR)/vmlinux-initramfs-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-vmlinux-initramfs
  122. endef
  123. endif
  124. define Image/BuildKernelLoader/Template
  125. $(CP) $(KDIR)/loader-$(1).bin $(BIN_DIR)/$(IMG_PREFIX)-$(1)-vmlinux-loader
  126. $(CP) $(KDIR)/vmlinux-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-vmlinux
  127. $(Image/BuildKernelLoader/InitramfsTemplate)
  128. endef
  129. ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  130. define Image/Prepare/InitramfsTemplate
  131. $(call PatchKernelLzma,$(1),-initramfs)
  132. $(call Image/BuildLoader/Template,$(1),-initramfs)
  133. endef
  134. endif
  135. define Image/Prepare/Template
  136. $(call PatchKernelLzma,$(1))
  137. $(call Image/BuildLoader/Template,$(1))
  138. $(Image/Prepare/InitramfsTemplate)
  139. endef
  140. define Image/BuildKernelEVA/Template
  141. $(call PatchKernelLzma,$(1))
  142. $(call MkImageEVA,$(1))
  143. $(CP) $(KDIR)/$(1).eva.align.64k $(BIN_DIR)/$(IMG_PREFIX)-$(1).eva.align.64k
  144. $(CP) $(KDIR)/$(1).eva.align.128k $(BIN_DIR)/$(IMG_PREFIX)-$(1).eva.align.128k
  145. endef
  146. ### Kernel scripts ###
  147. define Build/append-dtb
  148. $(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb)
  149. cat $@.dtb >> $@
  150. endef
  151. define Build/mkbrncmdline
  152. mkbrncmdline -i $@ -o $@.new BRN-BOOT
  153. mv $@.new $@
  154. endef
  155. define Build/mkbrnimg
  156. mkbrnimg -s $(SIGNATURE) -m $(MAGIC) -p $(CRC32_POLY) -o $@ $(word 1,$^) $(word 2,$^)
  157. endef
  158. define Build/fullimage
  159. mkimage -A mips -O linux -C lzma -T filesystem -a 0x00 \
  160. -e 0x00 -n 'LEDE RootFS' \
  161. -d $(word 2,$^) $(word 2,$^).new
  162. cat $(word 1,$^) $(word 2,$^).new > $@.tmp
  163. mkimage -A mips -O linux -T multi -a 0x00 -C none \
  164. -e 0x00 -n 'OpenWrt fullimage' \
  165. -d $@.tmp $@
  166. rm $(word 2,$^).new
  167. rm $@.tmp
  168. endef
  169. # Shared device definition: applies to every defined device
  170. define Device/Default
  171. PROFILES = Default $$(DEVICE_PROFILE)
  172. KERNEL_DEPENDS = $$(wildcard ../dts/$$(DEVICE_DTS).dts)
  173. KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs
  174. KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
  175. KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
  176. FILESYSTEMS := squashfs
  177. DEVICE_PROFILE :=
  178. DEVICE_DTS = $$(DEVICE_PROFILE)
  179. IMAGE_SIZE :=
  180. IMAGES := sysupgrade.bin
  181. IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
  182. endef
  183. DEVICE_VARS += DEVICE_PROFILE DEVICE_DTS IMAGE_SIZE
  184. define Device/lantiqBrnImage
  185. KERNEL := kernel-bin | append-dtb | mkbrncmdline | lzma-no-dict
  186. IMAGES := factory.bin
  187. IMAGE/factory.bin := mkbrnimg | check-size $$$$(IMAGE_SIZE)
  188. endef
  189. DEVICE_VARS += SIGNATURE MAGIC CRC32_POLY
  190. define Device/lantiqFullImage
  191. KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | pad-offset 4 0
  192. IMAGES := sysupgrade.bin fullimage.img
  193. IMAGE/fullimage.img := fullimage | check-size $$$$(IMAGE_SIZE)
  194. endef
  195. ifeq ($(SUBTARGET),xway_legacy)
  196. define Device/ARV4520PW
  197. DEVICE_PROFILE := ARV4520PW
  198. IMAGE_SIZE := 3648k
  199. DEVICE_TITLE := Easybox 800, WAV-281 - ARV4520PW
  200. DEVICE_PACKAGES := kmod-ltq-hcd-danube \
  201. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  202. kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
  203. ltq-adsl-app ppp-mod-pppoa \
  204. kmod-rt61-pci wpad-mini \
  205. swconfig
  206. endef
  207. TARGET_DEVICES += ARV4520PW
  208. define Device/ARV4525PW
  209. DEVICE_PROFILE := ARV4525PW
  210. IMAGE_SIZE := 3776k
  211. DEVICE_TITLE := Speedport W502V Typ A - ARV4525PW
  212. DEVICE_PACKAGES := kmod-ath5k wpad-mini \
  213. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  214. kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
  215. ltq-adsl-app ppp-mod-pppoa
  216. endef
  217. TARGET_DEVICES += ARV4525PW
  218. define Device/ARV452CQW
  219. DEVICE_PROFILE := ARV452CQW
  220. IMAGE_SIZE := 3776k
  221. DEVICE_TITLE := Easybox 801 - ARV452CQW
  222. DEVICE_PACKAGES := kmod-ltq-hcd-danube \
  223. kmod-ath5k wpad-mini \
  224. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  225. kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
  226. ltq-adsl-app ppp-mod-pppoa \
  227. swconfig
  228. endef
  229. TARGET_DEVICES += ARV452CQW
  230. define Device/ARV4518PWR01
  231. DEVICE_PROFILE := ARV4518PWR01
  232. IMAGE_SIZE := 3776k
  233. DEVICE_TITLE := ARV4518PWR01
  234. DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
  235. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  236. kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
  237. ltq-adsl-app ppp-mod-pppoa \
  238. kmod-ath5k wpad-mini \
  239. swconfig
  240. endef
  241. TARGET_DEVICES += ARV4518PWR01
  242. define Device/ARV4518PWR01A
  243. DEVICE_PROFILE := ARV4518PWR01A
  244. IMAGE_SIZE := 3776k
  245. DEVICE_TITLE := ARV4518PWR01A
  246. DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
  247. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  248. kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
  249. ltq-adsl-app ppp-mod-pppoa \
  250. kmod-ath5k wpad-mini \
  251. swconfig
  252. endef
  253. TARGET_DEVICES += ARV4518PWR01A
  254. endif
  255. ifeq ($(SUBTARGET),xway)
  256. # Danube
  257. DEVICE_BTHOMEHUBV2B_UBIFS_OPTS:="-m 512 -e 15872 -c 1959"
  258. DEVICE_BTHOMEHUBV2B_UBI_OPTS:="-m 512 -p 16KiB -s 256"
  259. Image/BuildKernel/Profile/BTHOMEHUBV2B=$(call Image/BuildKernel/Template,BTHOMEHUBV2B)
  260. Image/Build/Profile/BTHOMEHUBV2B=$(call Image/BuildNAND/$(1),$(1),BTHOMEHUBV2B)
  261. define LegacyDevice/BTHOMEHUBV2B
  262. DEVICE_TITLE := BT Home Hub 2B
  263. DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
  264. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  265. kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
  266. kmod-ltq-deu-danube \
  267. ltq-adsl-app ppp-mod-pppoa \
  268. kmod-ath9k wpad-mini \
  269. swconfig
  270. endef
  271. LEGACY_DEVICES += BTHOMEHUBV2B
  272. define Device/EASY50712
  273. DEVICE_PROFILE := EASY50712
  274. IMAGE_SIZE := 3776k
  275. DEVICE_TITLE := Lantiq Danube - EASY50712
  276. endef
  277. TARGET_DEVICES += EASY50712
  278. define Device/ACMP252
  279. DEVICE_PROFILE := ACMP252
  280. IMAGE_SIZE := 14848k
  281. DEVICE_TITLE := AudioCodes MediaPack MP-252
  282. DEVICE_PACKAGES := kmod-rt2x00-pci wpad-mini \
  283. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  284. kmod-ltq-adsl-danube-fw-a kmod-ltq-ptm-danube \
  285. ltq-adsl-app
  286. endef
  287. TARGET_DEVICES += ACMP252
  288. define Device/ARV4510PW
  289. DEVICE_PROFILE := ARV4510PW
  290. IMAGE_SIZE := 15616k
  291. DEVICE_TITLE := Wippies, Elisa - ARV4510PW
  292. DEVICE_PACKAGES := kmod-ledtrig-usbdev kmod-usb2-pci kmod-usb-uhci \
  293. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  294. kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
  295. ltq-adsl-app ppp-mod-pppoa \
  296. kmod-ltq-tapi kmod-ltq-vmmc \
  297. kmod-rt2800-pci kmod-ath5k wpad-mini \
  298. swconfig
  299. endef
  300. TARGET_DEVICES += ARV4510PW
  301. define Device/ARV7525PW
  302. DEVICE_PROFILE := ARV7525PW
  303. IMAGE_SIZE := 3776k
  304. DEVICE_TITLE := Speedport W303V Typ A - ARV7525PW
  305. DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini \
  306. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  307. kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
  308. ltq-adsl-app ppp-mod-pppoa
  309. endef
  310. TARGET_DEVICES += ARV7525PW
  311. define Device/ARV4519PW
  312. DEVICE_PROFILE := ARV4519PW
  313. IMAGE_SIZE := 3776k
  314. DEVICE_TITLE := Vodafone, Pirelli - ARV4519PW
  315. DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
  316. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  317. kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
  318. ltq-adsl-app ppp-mod-pppoa \
  319. swconfig
  320. endef
  321. TARGET_DEVICES += ARV4519PW
  322. define Device/ARV7510PW22
  323. DEVICE_PROFILE := ARV7510PW22
  324. IMAGE_SIZE := 31232k
  325. DEVICE_TITLE := Astoria - ARV7510PW22
  326. DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
  327. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  328. kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
  329. ltq-adsl-app ppp-mod-pppoa \
  330. kmod-ltq-tapi kmod-ltq-vmmc \
  331. kmod-rt2800-pci wpad-mini \
  332. kmod-usb-uhci kmod-usb2 kmod-usb2-pci \
  333. swconfig
  334. endef
  335. TARGET_DEVICES += ARV7510PW22
  336. define Device/ARV7518PW
  337. DEVICE_PROFILE := ARV7518PW
  338. IMAGE_SIZE := 7872k
  339. DEVICE_TITLE := Astoria - ARV7518PW
  340. DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
  341. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  342. kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
  343. ltq-adsl-app ppp-mod-pppoa \
  344. kmod-ath9k wpad-mini \
  345. swconfig
  346. endef
  347. TARGET_DEVICES += ARV7518PW
  348. define Device/ARV7519PW
  349. DEVICE_PROFILE := ARV7519PW
  350. IMAGE_SIZE := 15488k
  351. DEVICE_TITLE := Astoria - ARV7519PW
  352. DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
  353. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  354. kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
  355. ltq-adsl-app ppp-mod-pppoa \
  356. kmod-rt2800-pci wpad-mini \
  357. swconfig
  358. endef
  359. TARGET_DEVICES += ARV7519PW
  360. define Device/ARV752DPW
  361. DEVICE_PROFILE := ARV752DPW
  362. IMAGE_SIZE := 7872k
  363. DEVICE_TITLE := Easybox 802 - ARV752DPW
  364. DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
  365. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  366. kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
  367. ltq-adsl-app ppp-mod-pppoa \
  368. kmod-ltq-tapi kmod-ltq-vmmc \
  369. kmod-rt2800-pci wpad-mini \
  370. swconfig
  371. endef
  372. TARGET_DEVICES += ARV752DPW
  373. define Device/ARV752DPW22
  374. DEVICE_PROFILE := ARV752DPW22
  375. IMAGE_SIZE := 7616k
  376. DEVICE_TITLE := Easybox 803 - ARV752DPW22
  377. DEVICE_PACKAGES := kmod-usb2-pci kmod-usb-uhci kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
  378. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  379. kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
  380. ltq-adsl-app ppp-mod-pppoa \
  381. kmod-ltq-tapi kmod-ltq-vmmc \
  382. kmod-rt2800-pci wpad-mini \
  383. swconfig
  384. endef
  385. TARGET_DEVICES += ARV752DPW22
  386. define Device/ARV8539PW22
  387. DEVICE_PROFILE := ARV8539PW22
  388. IMAGE_SIZE := 7616k
  389. DEVICE_TITLE := Speedport W504V Typ A - ARV8539PW22
  390. DEVICE_PACKAGES := kmod-ltq-hcd-danube \
  391. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  392. kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
  393. ltq-adsl-app ppp-mod-pppoa \
  394. kmod-ath9k wpad-mini \
  395. swconfig
  396. endef
  397. TARGET_DEVICES += ARV8539PW22
  398. define Device/GIGASX76X
  399. DEVICE_PROFILE := GIGASX76X
  400. IMAGE_SIZE := 7680k
  401. DEVICE_TITLE := Gigaset sx76x
  402. DEVICE_PACKAGES := kmod-ltq-hcd-danube kmod-ledtrig-usbdev \
  403. kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
  404. kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
  405. ltq-adsl-app ppp-mod-pppoe \
  406. kmod-ath5k wpad-mini \
  407. swconfig
  408. endef
  409. TARGET_DEVICES += GIGASX76X
  410. # AR9
  411. DEVICE_BTHOMEHUBV3A_UBIFS_OPTS:="-m 512 -e 15872 -c 1959"
  412. DEVICE_BTHOMEHUBV3A_UBI_OPTS:="-m 512 -p 16KiB -s 256"
  413. Image/BuildKernel/Profile/BTHOMEHUBV3A=$(call Image/BuildKernel/Template,BTHOMEHUBV3A)
  414. Image/Build/Profile/BTHOMEHUBV3A=$(call Image/BuildNAND/$(1),$(1),BTHOMEHUBV3A)
  415. define LegacyDevice/BTHOMEHUBV3A
  416. DEVICE_TITLE := BT Home Hub 3A
  417. DEVICE_PACKAGES := kmod-usb-dwc2 kmod-ledtrig-usbdev \
  418. kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
  419. kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \
  420. kmod-ltq-deu-ar9 \
  421. ltq-adsl-app ppp-mod-pppoa \
  422. kmod-ath9k wpad-mini \
  423. swconfig uboot-envtools
  424. endef
  425. LEGACY_DEVICES += BTHOMEHUBV3A
  426. Image/BuildKernel/Profile/DGN3500=$(call Image/BuildKernel/Template,DGN3500)
  427. Image/Build/Profile/DGN3500=$(call Image/BuildDGN3500/$(1),$(1),DGN3500)
  428. define LegacyDevice/DGN3500
  429. DEVICE_TITLE := Netgear DGN3500
  430. DEVICE_PACKAGES := kmod-usb-dwc2 kmod-ledtrig-usbdev \
  431. kmod-ath9k wpad-mini \
  432. kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
  433. kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \
  434. ltq-adsl-app ppp-mod-pppoa \
  435. kmod-ltq-deu-ar9 swconfig
  436. endef
  437. LEGACY_DEVICES += DGN3500
  438. Image/BuildKernel/Profile/DGN3500B=$(call Image/BuildKernel/Template,DGN3500B)
  439. Image/Build/Profile/DGN3500B=$(call Image/BuildDGN3500B/$(1),$(1),DGN3500B)
  440. define LegacyDevice/DGN3500B
  441. DEVICE_TITLE := Netgear DGN3500B
  442. DEVICE_PACKAGES := kmod-usb-dwc2 kmod-ledtrig-usbdev \
  443. kmod-ath9k wpad-mini \
  444. kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
  445. kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
  446. ltq-adsl-app ppp-mod-pppoa \
  447. kmod-ltq-deu-ar9 swconfig
  448. endef
  449. LEGACY_DEVICES += DGN3500B
  450. define Device/WBMRA
  451. DEVICE_PROFILE := WBMRA
  452. IMAGE_SIZE := 31488k
  453. DEVICE_DTS := WBMR
  454. DEVICE_TITLE := Buffalo WBMR-HP-G300H (A) - WBMR
  455. DEVICE_PACKAGES := kmod-usb-dwc2 kmod-ledtrig-usbdev \
  456. kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
  457. kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \
  458. ltq-adsl-app ppp-mod-pppoa \
  459. kmod-ath9k wpad hostapd-utils \
  460. swconfig
  461. endef
  462. TARGET_DEVICES += WBMRA
  463. define Device/WBMRB
  464. DEVICE_PROFILE := WBMRB
  465. IMAGE_SIZE := 31488k
  466. DEVICE_DTS := WBMR
  467. DEVICE_TITLE := Buffalo WBMR-HP-G300H (B) - WBMR
  468. DEVICE_PACKAGES := kmod-usb-dwc2 kmod-ledtrig-usbdev \
  469. kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
  470. kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
  471. ltq-adsl-app ppp-mod-pppoa \
  472. kmod-ath9k wpad hostapd-utils \
  473. swconfig
  474. endef
  475. TARGET_DEVICES += WBMRB
  476. Image/BuildKernel/Profile/FRITZ7320=$(call Image/BuildKernelEVA/Template,FRITZ7320)
  477. Image/Build/Profile/FRITZ7320=$(call Image/BuildEVA/$(1),$(1),FRITZ7320)
  478. define LegacyDevice/FRITZ7320
  479. DEVICE_TITLE := 1&1 HomeServer - FRITZ7320
  480. DEVICE_PACKAGES := kmod-ath9k wpad-mini \
  481. kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
  482. kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
  483. ltq-adsl-app ppp-mod-pppoa \
  484. kmod-ltq-deu-ar9 kmod-usb-dwc2 \
  485. kmod-ath9k wpad-mini
  486. endef
  487. LEGACY_DEVICES += FRITZ7320
  488. define Device/GR7000
  489. DEVICE_PROFILE := GR7000
  490. IMAGE_SIZE := 7808k
  491. DEVICE_TITLE := Aztech GR7000
  492. DEVICE_PACKAGES := kmod-ltq-deu-ar9 kmod-usb-dwc2 swconfig
  493. endef
  494. TARGET_DEVICES += GR7000
  495. define Device/H201L
  496. DEVICE_PROFILE := H201L
  497. IMAGE_SIZE := 7808k
  498. DEVICE_TITLE := ZTE H201L - H201L
  499. DEVICE_PACKAGES := kmod-ath9k-htc wpad-mini \
  500. kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
  501. kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
  502. ltq-adsl-app ppp-mod-pppoe \
  503. kmod-ltq-deu-ar9 kmod-usb-dwc2 \
  504. kmod-ltq-tapi kmod-ltq-vmmc \
  505. swconfig
  506. endef
  507. TARGET_DEVICES += H201L
  508. define Device/P2601HNFX
  509. DEVICE_PROFILE := P2601HNFX
  510. IMAGE_SIZE := 15616k
  511. DEVICE_TITLE := ZyXEL P-2601HN-Fx
  512. DEVICE_PACKAGES := kmod-rt2800-usb wpad-mini \
  513. kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
  514. kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
  515. ltq-adsl-app ppp-mod-pppoe \
  516. kmod-ltq-deu-ar9 kmod-usb-dwc2 \
  517. swconfig
  518. endef
  519. TARGET_DEVICES += P2601HNFX
  520. endif
  521. ifeq ($(SUBTARGET),xrx200)
  522. # VR9
  523. DEVICE_P2812HNUF1_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
  524. DEVICE_P2812HNUF1_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
  525. Image/BuildKernel/Profile/P2812HNUF1=$(call Image/BuildKernel/Template,P2812HNUF1)
  526. Image/Build/Profile/P2812HNUF1=$(call Image/BuildNAND/$(1),$(1),P2812HNUF1)
  527. define LegacyDevice/P2812HNUF1
  528. DEVICE_TITLE := ZyXEL P-2812HNU-F1
  529. DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
  530. endef
  531. LEGACY_DEVICES += P2812HNUF1
  532. DEVICE_P2812HNUF3_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
  533. DEVICE_P2812HNUF3_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
  534. Image/BuildKernel/Profile/P2812HNUF3=$(call Image/BuildKernel/Template,P2812HNUF3)
  535. Image/Build/Profile/P2812HNUF3=$(call Image/BuildNAND/$(1),$(1),P2812HNUF3)
  536. define LegacyDevice/P2812HNUF3
  537. DEVICE_TITLE := ZyXEL P-2812HNU-F3
  538. DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
  539. endef
  540. LEGACY_DEVICES += P2812HNUF3
  541. define Device/ARV7519RW22
  542. DEVICE_PROFILE := ARV7519RW22
  543. IMAGE_SIZE := 31232k
  544. DEVICE_TITLE := Livebox Astoria ARV7519RW22
  545. DEVICE_PACKAGES := kmod-usb-dwc2
  546. endef
  547. TARGET_DEVICES += ARV7519RW22
  548. DEVICE_BTHOMEHUBV5A_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
  549. DEVICE_BTHOMEHUBV5A_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
  550. Image/BuildKernel/Profile/BTHOMEHUBV5A=$(call Image/BuildKernel/Template,BTHOMEHUBV5A)
  551. Image/Build/Profile/BTHOMEHUBV5A=$(call Image/BuildNAND/$(1),$(1),BTHOMEHUBV5A)
  552. define LegacyDevice/BTHOMEHUBV5A
  553. DEVICE_TITLE := BT Home Hub 5A
  554. DEVICE_PACKAGES := kmod-ath9k kmod-ath10k wpad-mini kmod-usb-dwc2
  555. endef
  556. LEGACY_DEVICES += BTHOMEHUBV5A
  557. define Device/EASY80920NAND
  558. $(Device/lantiqFullImage)
  559. DEVICE_PROFILE := EASY80920NAND
  560. IMAGE_SIZE := 64512k
  561. DEVICE_TITLE := Lantiq VR9 - EASY80920NAND
  562. DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-usb-dwc2
  563. endef
  564. TARGET_DEVICES += EASY80920NAND
  565. define Device/EASY80920NOR
  566. DEVICE_PROFILE := EASY80920NOR
  567. IMAGE_SIZE := 7936k
  568. DEVICE_TITLE := Lantiq VR9 - EASY80920NOR
  569. DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-usb-dwc2
  570. endef
  571. TARGET_DEVICES += EASY80920NOR
  572. DEVICE_FRITZ3370_UBIFS_OPTS:="-m 2048 -e 126KiB -c 4096"
  573. DEVICE_FRITZ3370_UBI_OPTS:="-m 2048 -p 128KiB -s 512"
  574. Image/BuildKernel/Profile/FRITZ3370=$(call Image/BuildKernelEVA/Template,FRITZ3370)
  575. Image/Build/Profile/FRITZ3370=$(call Image/BuildEVA/$(1),$(1),FRITZ3370)
  576. define LegacyDevice/FRITZ3370
  577. DEVICE_TITLE := Fritz!Box WLan - FRITZ3370
  578. DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-usb-dwc2
  579. endef
  580. LEGACY_DEVICES += FRITZ3370
  581. Image/BuildKernel/Profile/FRITZ7360SL=$(call Image/BuildKernelEVA/Template,FRITZ7360SL)
  582. Image/Build/Profile/FRITZ7360SL=$(call Image/BuildEVA/$(1),$(1),FRITZ7360SL)
  583. define LegacyDevice/FRITZ7360SL
  584. DEVICE_TITLE := 1&1 HomeServer - FRITZ7360SL
  585. DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-usb-dwc2
  586. endef
  587. LEGACY_DEVICES += FRITZ7360L
  588. Image/Prepare/Profile/VG3503J=$(call Image/Prepare/Template,VG3503J)
  589. Image/BuildKernel/Profile/VG3503J=$(call Image/BuildKernelLoader/Template,VG3503J)
  590. Image/Build/Profile/VG3503J=$(call Image/BuildLoader/$(1),$(1),VG3503J)
  591. define LegacyDevice/VG3503J
  592. DEVICE_TITLE := BT Openreak - ECI VDSL Modem
  593. endef
  594. LEGACY_DEVICES += VG3503J
  595. include tp-link.mk
  596. define Device/WBMR300
  597. DEVICE_PROFILE := WBMR300
  598. IMAGE_SIZE := 15616k
  599. DEVICE_TITLE := Buffalo WBMR-300HPD
  600. DEVICE_PACKAGES := kmod-mt76 wpad-mini kmod-usb-dwc2
  601. endef
  602. TARGET_DEVICES += WBMR300
  603. define Device/VGV7510KW22NOR
  604. DEVICE_PROFILE := VGV7510KW22NOR
  605. IMAGE_SIZE := 15232k
  606. DEVICE_TITLE := o2 Box 6431 / Arcadyan VGV7510KW22 (NOR)
  607. DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
  608. endef
  609. TARGET_DEVICES += VGV7510KW22NOR
  610. define Device/VGV7510KW22BRN
  611. $(Device/lantiqBrnImage)
  612. DEVICE_PROFILE := VGV7510KW22BRN
  613. IMAGE_SIZE := 7168k
  614. SIGNATURE := 5D00008000
  615. MAGIC := 0x12345678
  616. CRC32_POLY := 0x2083b8ed
  617. DEVICE_TITLE := o2 Box 6431 / Arcadyan VGV7510KW22 (BRN)
  618. DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
  619. endef
  620. TARGET_DEVICES += VGV7510KW22BRN
  621. define Device/VGV7519NOR
  622. DEVICE_PROFILE := VGV7519NOR
  623. IMAGE_SIZE := 15360k
  624. DEVICE_TITLE := Experiabox 8 VGV7519
  625. DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
  626. endef
  627. TARGET_DEVICES += VGV7519NOR
  628. define Device/VGV7519BRN
  629. $(Device/lantiqBrnImage)
  630. DEVICE_PROFILE := VGV7519BRN
  631. IMAGE_SIZE := 7168k
  632. SIGNATURE := 5D00008000
  633. MAGIC := 0x12345678
  634. CRC32_POLY := 0x2083b8ed
  635. DEVICE_TITLE := Experiabox 8 VGV7519 (BRN)
  636. DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2
  637. endef
  638. TARGET_DEVICES += VGV7519BRN
  639. endif
  640. ifneq ($($(PROFILE)_UBI_OPTS),)
  641. define Image/BuildNAND/squashfs
  642. $(call prepare_generic_squashfs,$(KDIR)/root.$(1))
  643. $(call Image/Build/UbinizeImage,$(2),,squashfs,$($(PROFILE)_UBI_OPTS))
  644. $(call Image/Build/SysupgradeNAND,$(2),$(1),$(KDIR)/uImage-$(2))
  645. endef
  646. define Image/Build/ubifs
  647. $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(2)-rootfs.ubifs
  648. endef
  649. define Image/Build/ubi
  650. $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(2)-rootfs.ubi
  651. $(CP) $(KDIR)/root-overlay.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(2)-rootfs-overlay.ubi
  652. endef
  653. define Image/BuildEVA/ubi
  654. $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(2)-rootfs.ubi
  655. $(CP) $(KDIR)/root-overlay.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(2)-rootfs-overlay.ubi
  656. endef
  657. ifneq ($($(PROFILE)_UBIFS_OPTS),)
  658. define Image/BuildNAND/ubifs
  659. $(call Image/Build/UbinizeImage,$(2),,ubifs,$($(PROFILE)_UBI_OPTS))
  660. $(call Image/Build/SysupgradeNAND,$(2),$(1),$(KDIR)/uImage-$(2))
  661. endef
  662. define Image/BuildEVA/ubifs
  663. $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(2)-rootfs.ubifs
  664. endef
  665. endif
  666. endif
  667. define Image/Prepare/Profile
  668. $(call Image/Prepare/Profile/$(1))
  669. endef
  670. define Image/BuildKernel/Profile
  671. $(call Image/BuildKernel/Profile/$(1))
  672. endef
  673. define Image/Build/Profile
  674. $(call Image/Build/Profile/$(1),$(2))
  675. endef
  676. $(eval $(call BuildImage))