router_le.mk 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. #
  2. # Copyright (C) 2007-2009 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. define trxedimax/jffs2-128k
  8. -a 0x20000 -f $(KDIR)/root.jffs2-128k
  9. endef
  10. define trxedimax/jffs2-64k
  11. -a 0x10000 -f $(KDIR)/root.jffs2-64k
  12. endef
  13. define trxedimax/squashfs
  14. -a 1024 -f $(KDIR)/root.squashfs
  15. endef
  16. define Image/Build/TRXEdimax
  17. $(STAGING_DIR_HOST)/bin/trx -o $(1) -f $(KDIR)/vmlinux.lzma \
  18. $(call trxedimax/$(2))
  19. endef
  20. define Image/Build/Compex
  21. $(call Image/Build/Loader,$(2),gz,0x80500000,0,y,$(2))
  22. $(call Image/Build/TRX,$(call imgname,$(1),$(2)).trx,$(1),$(KDIR)/loader-$(2).gz)
  23. endef
  24. define Image/Build/Edimax
  25. $(call Image/Build/Loader,$(2),gz,0x80500000,0x6D8,y,$(2))
  26. $(call Image/Build/TRXEdimax,$(call imgname,$(1),$(2)).trx,$(1))
  27. $(STAGING_DIR_HOST)/bin/mkcsysimg -B $(2) -d -w \
  28. -r $(KDIR)/loader-$(2).gz::0x1000 \
  29. -x $(call imgname,$(1),$(2)).trx:0x10000 \
  30. -x $(JFFS2MARK):0x10000 \
  31. $(call imgname,$(1),$(2))-webui.bin
  32. $(STAGING_DIR_HOST)/bin/mkcsysimg -B $(2) -d \
  33. -r $(KDIR)/loader-$(2).gz::0x1000 \
  34. -x $(call imgname,$(1),$(2)).trx:0x10000 \
  35. -x $(JFFS2MARK):0x10000 \
  36. $(call imgname,$(1),$(2))-xmodem.bin
  37. rm -f $(call imgname,$(1),$(2)).trx
  38. endef
  39. define Image/Build/Osbridge
  40. $(call Image/Build/Loader,$(2),gz,0x80500000,0x6D8,y,$(2))
  41. $(call Image/Build/TRXEdimax,$(call imgname,$(1),$(2)).trx,$(1))
  42. $(STAGING_DIR_HOST)/bin/mkcsysimg -B $(2) -d \
  43. -r $(KDIR)/loader-$(2).gz::0x1000 \
  44. -x $(call imgname,$(1),$(2)).trx:0x10000 \
  45. -x $(JFFS2MARK):0x10000 \
  46. $(call imgname,$(1),$(2))-firmware.bin
  47. $(STAGING_DIR_HOST)/bin/osbridge-crc \
  48. -i $(call imgname,$(1),$(2))-firmware.bin \
  49. -o $(call imgname,$(1),$(2))-temp.bin
  50. $(STAGING_DIR_HOST)/bin/pc1crypt \
  51. -i $(call imgname,$(1),$(2))-temp.bin \
  52. -o $(call imgname,$(1),$(2))-webui.bin
  53. rm -f $(call imgname,$(1),$(2))-temp.bin
  54. rm -f $(call imgname,$(1),$(2)).trx
  55. endef
  56. define Image/Build/Infineon
  57. $(call Image/Build/Loader,$(2),gz,0x80500000,0x6D8,y,$(2))
  58. $(call Image/Build/TRXNoloader,$(call imgname,$(1),$(2)).trx,$(1))
  59. dd if=$(KDIR)/loader-$(2).gz of=$(call imgname,$(1),$(2)).img bs=64k conv=sync
  60. cat $(call imgname,$(1),$(2)).trx >> $(call imgname,$(1),$(2)).img
  61. endef
  62. define Image/Build/Cellvision
  63. $(call Image/Build/Loader,$(2),bin,0x80500000,0x6D8,y,$(3))
  64. mkdir -p $(BIN_DIR)/tmp
  65. cp $(KDIR)/loader-$(2).bin $(BIN_DIR)/tmp/vmlinux.bin
  66. gzip -9n $(BIN_DIR)/tmp/vmlinux.bin
  67. dd if=$(BIN_DIR)/tmp/vmlinux.bin.gz of=$(call imgname,$(1),$(2))-xmodem.bin bs=64k conv=sync
  68. rm -rf $(BIN_DIR)/tmp
  69. $(call Image/Build/TRXNoloader,$(call imgname,$(1),$(2)).trx,$(1))
  70. cat $(call imgname,$(1),$(2)).trx >> $(call imgname,$(1),$(2))-xmodem.bin
  71. $(STAGING_DIR_HOST)/bin/mkcasfw -B $(2) -d \
  72. -K $(call imgname,$(1),$(2))-xmodem.bin \
  73. $(call imgname,$(1),$(2))-webui.bin
  74. endef
  75. define Image/Build/Cellvision2
  76. # only for CAS-700/771/790/861
  77. $(call Image/Build/Loader,$(2),gz,0x80500000,0x6D8,y,$(3))
  78. $(call Image/Build/TRXNoloader,$(call imgname,$(1),$(2)).trx,$(1))
  79. dd if=$(KDIR)/loader-$(2).gz of=$(call imgname,$(1),$(2)).bin bs=64k conv=sync
  80. cat $(call imgname,$(1),$(2)).trx >> $(call imgname,$(1),$(2)).bin
  81. echo -ne '\x14\x07\x24\x06$(2)' | dd bs=14 count=1 conv=sync >> $(call imgname,$(1),$(2)).bin
  82. echo -ne 'OpenWrt\x00\x00\x00' >> $(call imgname,$(1),$(2)).bin
  83. endef
  84. define Image/Build/MyLoader
  85. $(call Image/Build/Loader,$(2),gz,0x80500000,0)
  86. $(call Image/Build/TRXNoloader,$(call imgname,$(1),$(2)).trx,$(1))
  87. $(STAGING_DIR_HOST)/bin/mkmylofw -B $(2) \
  88. -p0x20000:0x10000:ahp:0x80001000 \
  89. -p0x30000:0 \
  90. -b0x20000:0x10000:h:$(KDIR)/loader-$(2).gz \
  91. -b0x30000:0::$(call imgname,$(1),$(2)).trx \
  92. $(call imgname,$(1),$(2)).bin
  93. endef
  94. #
  95. # Cellvision CAS-630/630W, CAS-670/670W, NFS-101U/101WU, NFS-202U/202WU
  96. #
  97. define Image/Build/Template/Cellvision
  98. $(call Image/Build/Cellvision,$(1),$(2),$(3))
  99. endef
  100. define Image/Build/Template/Cellvision/squashfs
  101. $(call Image/Build/Template/Cellvision,squashfs,$(1),$(2))
  102. endef
  103. define Image/Build/Template/Cellvision/jffs2-64k
  104. $(call Image/Build/Template/Cellvision,jffs2-64k,$(1),$(2))
  105. endef
  106. #
  107. # Cellvision CAS-700/700W, CAS-771/771W, CAS-790, CAS-861/861W
  108. #
  109. define Image/Build/Template/Cellvision2
  110. $(call Image/Build/Cellvision2,$(1),$(2),$(3))
  111. endef
  112. define Image/Build/Template/Cellvision2/squashfs
  113. $(call Image/Build/Template/Cellvision2,squashfs,$(1),$(2))
  114. endef
  115. define Image/Build/Template/Cellvision2/jffs2-64k
  116. $(call Image/Build/Template/Cellvision2,jffs2-64k,$(1),$(2))
  117. endef
  118. define Image/Build/Template/Cellvision2/Initramfs
  119. $(call Image/Build/LZMAKernel/Cellvision,$(1),$(2),gz)
  120. endef
  121. #
  122. # Compex NP27G, NP28G, WP54G, WP54AG, WPP54G, WPP54AG
  123. #
  124. define Image/Build/Template/Compex
  125. $(call Image/Build/MyLoader,$(1),$(2))
  126. endef
  127. define Image/Build/Template/Compex/squashfs
  128. $(call Image/Build/Template/Compex,squashfs,$(1))
  129. endef
  130. define Image/Build/Template/Compex/jffs2-64k
  131. $(call Image/Build/Template/Compex,jffs2-64k,$(1))
  132. endef
  133. define Image/Build/Template/Compex/Initramfs
  134. $(call Image/Build/LZMAKernel/Generic,$(1),bin)
  135. endef
  136. #
  137. # Compex WP54G-WRT
  138. #
  139. define Image/Build/Template/WP54GWRT
  140. $(call Image/Build/Compex,$(1),wp54g-wrt)
  141. endef
  142. define Image/Build/Template/WP54GWRT/squashfs
  143. $(call Image/Build/Template/WP54GWRT,squashfs)
  144. endef
  145. define Image/Build/Template/WP54GWRT/jffs2-64k
  146. $(call Image/Build/Template/WP54GWRT,jffs2-64k)
  147. endef
  148. define Image/Build/Template/WP54GWRT/Initramfs
  149. $(call Image/Build/LZMAKernel/KArgs,wp54g-wrt,bin)
  150. endef
  151. #
  152. # Edimax BR-6104K, BR-6104KP, BR-6104Wg, BR-6114WG
  153. #
  154. define Image/Build/Template/Edimax
  155. $(call Image/Build/Edimax,$(1),$(2))
  156. endef
  157. define Image/Build/Template/Edimax/squashfs
  158. $(call Image/Build/Template/Edimax,squashfs,$(1))
  159. endef
  160. define Image/Build/Template/Edimax/Initramfs
  161. $(call Image/Build/LZMAKernel/Admboot,$(1),gz)
  162. endef
  163. #
  164. # Infineon EASY 5120, EASY 83000
  165. #
  166. define Image/Build/Template/Infineon
  167. $(call Image/Build/Infineon,$(1),$(2))
  168. endef
  169. define Image/Build/Template/Infineon/squashfs
  170. $(call Image/Build/Template/Infineon,squashfs,$(1))
  171. endef
  172. define Image/Build/Template/Infineon/jffs2-64k
  173. $(call Image/Build/Template/Infineon,jffs2-64k,$(1))
  174. endef
  175. define Image/Build/Template/Infineon/Initramfs
  176. $(call Image/Build/LZMAKernel/Admboot,$(1),gz)
  177. endef
  178. #
  179. # Generic EB-214A
  180. #
  181. define Image/Build/Template/Edimax/Initramfs
  182. $(call Image/Build/LZMAKernel/Admboot,eb-214a,bin)
  183. endef
  184. #
  185. # Mikrotik RouterBOARD 1xx
  186. #
  187. define Image/Build/Template/Mikrotik/Initramfs
  188. $(CP) $(KDIR)/vmlinux.elf $(call imgname,netboot,rb1xx)
  189. endef
  190. #
  191. # OSBRiDGE 5GXi/5XLi
  192. #
  193. define Image/Build/Template/Osbridge
  194. $(call Image/Build/Osbridge,$(1),$(2))
  195. endef
  196. define Image/Build/Template/Osbridge/squashfs
  197. $(call Image/Build/Template/Osbridge,squashfs,$(1))
  198. endef
  199. define Image/Build/Template/Osbridge/Initramfs
  200. $(call Image/Build/LZMAKernel/Admboot,$(1),gz)
  201. endef
  202. #
  203. # Profiles
  204. #
  205. define Image/Build/Profile/CAS630
  206. $(call Image/Build/Template/Cellvision/$(1),cas-630,cas-630)
  207. endef
  208. define Image/Build/Profile/CAS630W
  209. $(call Image/Build/Template/Cellvision/$(1),cas-630w,cas-630)
  210. endef
  211. define Image/Build/Profile/CAS670
  212. $(call Image/Build/Template/Cellvision/$(1),cas-670,cas-670)
  213. endef
  214. define Image/Build/Profile/CAS670W
  215. $(call Image/Build/Template/Cellvision/$(1),cas-670w,cas-670)
  216. endef
  217. define Image/Build/Profile/NFS101U
  218. $(call Image/Build/Template/Cellvision/$(1),nfs-101u,nfs-101u)
  219. $(call Image/Build/Template/Cellvision/$(1),dn-7013,nfs-101u)
  220. $(call Image/Build/Template/Cellvision/$(1),dns-120,nfs-101u)
  221. $(call Image/Build/Template/Cellvision/$(1),mu-5000fs,nfs-101u)
  222. $(call Image/Build/Template/Cellvision/$(1),tn-u100,nfs-101u)
  223. $(call Image/Build/Template/Cellvision/$(1),cg-nsadp,nfs-101u)
  224. endef
  225. define Image/Build/Profile/NFS101WU
  226. $(call Image/Build/Template/Cellvision/$(1),nfs-101wu,nfs-101u)
  227. $(call Image/Build/Template/Cellvision/$(1),dns-g120,nfs-101u)
  228. endef
  229. define Image/Build/Profile/CAS700
  230. $(call Image/Build/Template/Cellvision2/$(1),cas-700,cas-700)
  231. endef
  232. define Image/Build/Profile/CAS700W
  233. $(call Image/Build/Template/Cellvision2/$(1),cas-700w,cas-700)
  234. endef
  235. define Image/Build/Profile/CAS771
  236. $(call Image/Build/Template/Cellvision2/$(1),cas-771,cas-771)
  237. endef
  238. define Image/Build/Profile/CAS771W
  239. $(call Image/Build/Template/Cellvision2/$(1),cas-771w,cas-771)
  240. endef
  241. define Image/Build/Profile/CAS790
  242. $(call Image/Build/Template/Cellvision2/$(1),cas-790,cas-790)
  243. endef
  244. define Image/Build/Profile/CAS861
  245. $(call Image/Build/Template/Cellvision2/$(1),cas-861,cas-861)
  246. endef
  247. define Image/Build/Profile/CAS861W
  248. $(call Image/Build/Template/Cellvision2/$(1),cas-861w,cas-861)
  249. endef
  250. define Image/Build/Profile/NP27G
  251. $(call Image/Build/Template/Compex/$(1),np27g)
  252. endef
  253. define Image/Build/Profile/NP28G
  254. $(call Image/Build/Template/Compex/$(1),np28g)
  255. endef
  256. define Image/Build/Profile/WP54
  257. $(call Image/Build/Template/Compex/$(1),wp54g)
  258. $(call Image/Build/Template/Compex/$(1),wp54ag)
  259. $(call Image/Build/Template/Compex/$(1),wpp54g)
  260. $(call Image/Build/Template/Compex/$(1),wpp54ag)
  261. $(call Image/Build/Template/WP54GWRT/$(1))
  262. endef
  263. define Image/Build/Profile/BR6104K
  264. $(call Image/Build/Template/Edimax/$(1),br-6104k)
  265. endef
  266. define Image/Build/Profile/BR6104KP
  267. $(call Image/Build/Template/Edimax/$(1),br-6104kp)
  268. endef
  269. define Image/Build/Profile/BR6104WG
  270. $(call Image/Build/Template/Edimax/$(1),br-6104wg)
  271. endef
  272. define Image/Build/Profile/BR6114WG
  273. $(call Image/Build/Template/Edimax/$(1),br-6114wg)
  274. endef
  275. define Image/Build/Profile/EASY83000
  276. $(call Image/Build/Template/Infineon/$(1),easy-83000)
  277. endef
  278. define Image/Build/Profile/EASY5120RT
  279. $(call Image/Build/Template/Infineon/$(1),easy-5120-rt)
  280. endef
  281. define Image/Build/Profile/EASY5120PATA
  282. $(call Image/Build/Template/Infineon/$(1),easy-5120p-ata)
  283. endef
  284. define Image/Build/Profile/PMUGW
  285. $(call Image/Build/Template/Infineon/$(1),powerline-mugw)
  286. endef
  287. define Image/Build/Profile/5GXI
  288. $(call Image/Build/Template/Osbridge/$(1),5gxi)
  289. endef
  290. define Image/Build/Profile/RouterBoard
  291. $(call Image/Build/Template/Mikrotik/$(1))
  292. endef
  293. ifeq ($(CONFIG_BROKEN),y)
  294. define Image/Build/Experimental
  295. # Cellvison
  296. $(call Image/Build/Profile/CAS630,$(1))
  297. $(call Image/Build/Profile/CAS630W,$(1))
  298. $(call Image/Build/Profile/CAS670,$(1))
  299. $(call Image/Build/Profile/CAS670W,$(1))
  300. $(call Image/Build/Profile/CAS700,$(1))
  301. $(call Image/Build/Profile/CAS700W,$(1))
  302. $(call Image/Build/Profile/CAS771,$(1))
  303. $(call Image/Build/Profile/CAS771W,$(1))
  304. $(call Image/Build/Profile/CAS861,$(1))
  305. $(call Image/Build/Profile/CAS861W,$(1))
  306. # Motorola
  307. $(call Image/Build/Profile/PMUGW,$(1))
  308. # OSBRiDGE
  309. $(call Image/Build/Profile/5GXI,$(1))
  310. endef
  311. endif
  312. define Image/Build/Profile/Generic
  313. # Cellvision
  314. $(call Image/Build/Profile/NFS101U,$(1))
  315. $(call Image/Build/Profile/NFS101WU,$(1))
  316. # Compex
  317. $(call Image/Build/Profile/WP54,$(1))
  318. $(call Image/Build/Profile/NP27G,$(1))
  319. $(call Image/Build/Profile/NP28G,$(1))
  320. # Edimax
  321. $(call Image/Build/Profile/BR6104K,$(1))
  322. $(call Image/Build/Profile/BR6104KP,$(1))
  323. $(call Image/Build/Profile/BR6104WG,$(1))
  324. $(call Image/Build/Profile/BR6114WG,$(1))
  325. $(call Image/Build/Profile/EB214A,$(1))
  326. # Infineon
  327. $(call Image/Build/Profile/EASY83000,$(1))
  328. $(call Image/Build/Profile/EASY5120RT,$(1))
  329. $(call Image/Build/Profile/EASY5120PATA,$(1))
  330. # Mikrotik
  331. $(call Image/Build/Profile/RB1xx/$(1))
  332. $(call Image/Build/Experimental,$(1))
  333. endef