Makefile 89 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197
  1. #
  2. # Copyright (C) 2008-2011 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/image.mk
  9. IMAGE_PROFILE:=$(if $(PROFILE),$(PROFILE),Default)
  10. JFFS2_BLOCKSIZE = 64k 128k 256k
  11. KERNEL_LOADADDR = 0x80060000
  12. DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD NETGEAR_ID CMDLINE CONSOLE IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS
  13. define Build/netgear-squashfs
  14. rm -rf $@.fs $@.squashfs
  15. mkdir -p $@.fs/image
  16. cp $@ $@.fs/image/uImage
  17. $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
  18. $@.fs $@.squashfs \
  19. -noappend -root-owned -be -b 65536
  20. dd if=/dev/zero bs=1k count=1 >> $@.squashfs
  21. mkimage \
  22. -A mips -O linux -T filesystem -C none \
  23. -M $(NETGEAR_KERNEL_MAGIC) \
  24. -a 0xbf070000 -e 0xbf070000 \
  25. -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
  26. -d $@.squashfs $@
  27. rm -rf $@.squashfs $@.fs
  28. endef
  29. define Build/netgear-uImage
  30. $(call Build/uImage,$(1) -M $(NETGEAR_KERNEL_MAGIC))
  31. endef
  32. define Build/netgear-image
  33. $(STAGING_DIR_HOST)/bin/mkdniimg \
  34. -B $(NETGEAR_BOARD) -v OpenWrt.$(REVISION) \
  35. $(if $(NETGEAR_ID),-H $(NETGEAR_ID)) \
  36. -r "$(1)" \
  37. -i $@ -o $@.new
  38. mv $@.new $@
  39. endef
  40. # combine kernel and rootfs into one image
  41. # -a align the rootfs start on an <align> bytes boundary
  42. # -j add jffs2 end-of-filesystem markers
  43. # -s strip padding from end of the image
  44. # -X reserve <size> bytes in the firmware image (hexval prefixed with 0x)
  45. define Build/mktplinkfw
  46. -$(STAGING_DIR_HOST)/bin/mktplinkfw \
  47. -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) \
  48. -k $(word 1,$^) \
  49. -r $@ \
  50. -o $@.new \
  51. -j -X 0x40000 \
  52. -a $(call rootfs_align,$(FILESYSTEM)) \
  53. $(if $(findstring sysupgrade,$1),-s) && mv $@.new $@ || rm -f $@
  54. endef
  55. # -c combined image
  56. define Build/mktplinkfw-initramfs
  57. $(STAGING_DIR_HOST)/bin/mktplinkfw \
  58. -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) \
  59. -k $@ \
  60. -o $@.new \
  61. -s -S \
  62. -c
  63. @mv $@.new $@
  64. endef
  65. define Build/loader-common
  66. rm -rf $@.src
  67. $(MAKE) -C lzma-loader \
  68. PKG_BUILD_DIR="$@.src" \
  69. TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \
  70. KERNEL_CMDLINE="$(CMDLINE)" BOARD="$(BOARDNAME)" \
  71. LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
  72. $(1) compile loader.gz
  73. mv "$@.gz" "$@"
  74. rm -rf $@.src
  75. endef
  76. define Build/loader-okli-compile
  77. $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS) FLASH_MAX=0)
  78. endef
  79. define Build/loader-kernel
  80. $(call Build/loader-common,LOADER_DATA="$@")
  81. endef
  82. define Build/loader-okli
  83. dd if=$(KDIR)/loader-$(1).gz bs=7680 conv=sync of="$@.new"
  84. cat "$@" >> "$@.new"
  85. mv "$@.new" "$@"
  86. endef
  87. define Build/copy-file
  88. cat "$(1)" > "$@"
  89. endef
  90. DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT
  91. define Device/Default
  92. BOARDNAME :=
  93. DEVICE_PROFILE = $$(BOARDNAME)
  94. PROFILES = Default Minimal $$(DEVICE_PROFILE)
  95. MTDPARTS :=
  96. IMAGES := sysupgrade.bin
  97. BLOCKSIZE := 64k
  98. FILESYSTEMS = $(filter-out jffs2-%,$(TARGET_FILESYSTEMS)) jffs2-$$(BLOCKSIZE)
  99. CONSOLE = ttyS0,115200
  100. CMDLINE = $$(if $$(BOARDNAME),board=$$(BOARDNAME)) $$(if $$(MTDPARTS),mtdparts=$$(MTDPARTS)) $$(if $$(CONSOLE),console=$$(CONSOLE))
  101. KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma
  102. COMPILE :=
  103. IMAGES := sysupgrade.bin
  104. IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
  105. endef
  106. define Device/bsb
  107. BOARDNAME = BSB
  108. IMAGE_SIZE = 16000k
  109. CONSOLE = ttyATH0,115200
  110. MTDPARTS = spi0.0:128k(u-boot)ro,64k(u-boot-env)ro,16128k(firmware),64k(art)ro
  111. endef
  112. TARGET_DEVICES += bsb
  113. define Device/carambola2
  114. BOARDNAME = CARAMBOLA2
  115. IMAGE_SIZE = 16000k
  116. CONSOLE = ttyATH0,115200
  117. MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
  118. endef
  119. TARGET_DEVICES += carambola2
  120. define Device/weio
  121. BOARDNAME = WEIO
  122. IMAGE_SIZE = 16000k
  123. CONSOLE = ttyATH0,115200
  124. MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
  125. endef
  126. TARGET_DEVICES += weio
  127. define Device/wndr3700
  128. BOARDNAME = WNDR3700
  129. NETGEAR_KERNEL_MAGIC = 0x33373030
  130. NETGEAR_BOARD = WNDR3700
  131. IMAGE_SIZE = 7680k
  132. MTDPARTS = spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,7680k(firmware),64k(art)ro
  133. IMAGES := sysupgrade.bin factory.img factory-NA.img
  134. KERNEL := kernel-bin | patch-cmdline | lzma -d20 | netgear-uImage lzma
  135. IMAGE/default = append-kernel $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs
  136. IMAGE/sysupgrade.bin = $$(IMAGE/default) | check-size $$$$(IMAGE_SIZE)
  137. IMAGE/factory.img = $$(IMAGE/default) | netgear-image | check-size $$$$(IMAGE_SIZE)
  138. IMAGE/factory-NA.img = $$(IMAGE/default) | netgear-image NA | check-size $$$$(IMAGE_SIZE)
  139. endef
  140. define Device/wndr3700v2
  141. $(Device/wndr3700)
  142. NETGEAR_BOARD = WNDR3700v2
  143. NETGEAR_KERNEL_MAGIC = 0x33373031
  144. NETGEAR_ID = 29763654+16+64
  145. IMAGE_SIZE = 15872k
  146. MTDPARTS = spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,15872k(firmware),64k(art)ro
  147. IMAGES := sysupgrade.bin factory.img
  148. endef
  149. define Device/wndr3800
  150. $(Device/wndr3700v2)
  151. NETGEAR_BOARD = WNDR3800
  152. NETGEAR_ID = 29763654+16+128
  153. endef
  154. define Device/wndr3800ch
  155. $(Device/wndr3800)
  156. NETGEAR_BOARD = WNDR3800CH
  157. endef
  158. define Device/wndrmac
  159. $(Device/wndr3700v2)
  160. NETGEAR_BOARD = WNDRMAC
  161. endef
  162. define Device/wndrmacv2
  163. $(Device/wndr3800)
  164. NETGEAR_BOARD = WNDRMACv2
  165. endef
  166. TARGET_DEVICES += wndr3700 wndr3700v2 wndr3800 wndr3800ch wndrmac wndrmacv2
  167. define Device/tplink
  168. TPLINK_HWREV := 0x1
  169. KERNEL := kernel-bin | patch-cmdline | lzma
  170. KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | mktplinkfw-initramfs
  171. IMAGES := sysupgrade.bin factory.bin
  172. IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade
  173. IMAGE/factory.bin := append-rootfs | mktplinkfw factory
  174. endef
  175. define Device/tplink-nolzma
  176. $(Device/tplink)
  177. LOADER_FLASH_OFFS := 0x22000
  178. COMPILE := loader-$(1).gz
  179. COMPILE/loader-$(1).gz := loader-okli-compile
  180. KERNEL := copy-file $(KDIR)/vmlinux.bin.lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1)
  181. KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux-initramfs.bin.lzma | loader-kernel | mktplinkfw-initramfs
  182. endef
  183. define Device/tplink-4m
  184. $(Device/tplink-nolzma)
  185. TPLINK_FLASHLAYOUT := 4M
  186. IMAGE_SIZE := 3904k
  187. endef
  188. define Device/tplink-8m
  189. $(Device/tplink-nolzma)
  190. TPLINK_FLASHLAYOUT := 8M
  191. IMAGE_SIZE := 7936k
  192. endef
  193. define Device/tplink-4mlzma
  194. $(Device/tplink)
  195. TPLINK_FLASHLAYOUT := 4Mlzma
  196. IMAGE_SIZE := 3904k
  197. endef
  198. define Device/tplink-8mlzma
  199. $(Device/tplink)
  200. TPLINK_FLASHLAYOUT := 8Mlzma
  201. IMAGE_SIZE := 7936k
  202. endef
  203. define Device/tplink-16mlzma
  204. $(Device/tplink)
  205. TPLINK_FLASHLAYOUT := 16Mlzma
  206. IMAGE_SIZE := 15872k
  207. endef
  208. define Device/tl-wdr4300-v1
  209. $(Device/tplink-8mlzma)
  210. BOARDNAME = TL-WDR4300
  211. DEVICE_PROFILE = TLWDR4300
  212. TPLINK_HWID := 0x43000001
  213. endef
  214. define Device/tl-wdr3500-v1
  215. $(Device/tl-wdr4300-v1)
  216. BOARDNAME = TL-WDR3500
  217. TPLINK_HWID := 0x35000001
  218. endef
  219. define Device/tl-wdr3600-v1
  220. $(Device/tl-wdr4300-v1)
  221. TPLINK_HWID := 0x36000001
  222. endef
  223. define Device/tl-wdr4300-v1-il
  224. $(Device/tl-wdr4300-v1)
  225. TPLINK_HWID := 0x43008001
  226. endef
  227. define Device/tl-wdr4310-v1
  228. $(Device/tl-wdr4300-v1)
  229. TPLINK_HWID := 0x43100001
  230. endef
  231. define Device/mw4530r-v1
  232. $(Device/tl-wdr4300-v1)
  233. TPLINK_HWID := 0x45300001
  234. endef
  235. TARGET_DEVICES += tl-wdr3500-v1 tl-wdr3600-v1 tl-wdr4300-v1 tl-wdr4300-v1-il tl-wdr4310-v1 mw4530r-v1
  236. define Device/archer-c5
  237. $(Device/tplink-16mlzma)
  238. BOARDNAME := ARCHER-C5
  239. DEVICE_PROFILE := ARCHERC7
  240. TPLINK_HWID := 0xc5000001
  241. endef
  242. define Device/archer-c7-v1
  243. $(Device/tplink-8mlzma)
  244. BOARDNAME := ARCHER-C7
  245. DEVICE_PROFILE := ARCHERC7
  246. TPLINK_HWID := 0x75000001
  247. endef
  248. define Device/archer-c7-v2
  249. $(Device/tplink-16mlzma)
  250. BOARDNAME := ARCHER-C7
  251. DEVICE_PROFILE := ARCHERC7
  252. TPLINK_HWID := 0xc7000002
  253. endef
  254. TARGET_DEVICES += archer-c5 archer-c7-v1 archer-c7-v2
  255. define Device/antminer-s1
  256. $(Device/tplink-8mlzma)
  257. BOARDNAME := ANTMINER-S1
  258. DEVICE_PROFILE := ANTMINERS1
  259. TPLINK_HWID := 0x04440101
  260. CONSOLE := ttyATH0,115200
  261. endef
  262. define Device/antminer-s3
  263. $(Device/tplink-8mlzma)
  264. BOARDNAME := ANTMINER-S3
  265. DEVICE_PROFILE := ANTMINERS3
  266. TPLINK_HWID := 0x04440301
  267. CONSOLE := ttyATH0,115200
  268. endef
  269. define Device/el-m150
  270. $(Device/tplink-8mlzma)
  271. BOARDNAME := EL-M150
  272. DEVICE_PROFILE := ELM150
  273. TPLINK_HWID := 0x01500101
  274. CONSOLE := ttyATH0,115200
  275. endef
  276. define Device/el-mini
  277. $(Device/tplink-8mlzma)
  278. BOARDNAME := EL-MINI
  279. DEVICE_PROFILE := ELMINI
  280. TPLINK_HWID := 0x01530001
  281. CONSOLE := ttyATH0,115200
  282. endef
  283. TARGET_DEVICES += antminer-s1 antminer-s3 el-m150 el-mini
  284. define Device/gl-inet-6408A-v1
  285. $(Device/tplink-8mlzma)
  286. BOARDNAME := GL-INET
  287. DEVICE_PROFILE := GLINET
  288. TPLINK_HWID := 0x08000001
  289. CONSOLE := ttyATH0,115200
  290. endef
  291. define Device/gl-inet-6416A-v1
  292. $(Device/tplink-16mlzma)
  293. BOARDNAME := GL-INET
  294. DEVICE_PROFILE := GLINET
  295. TPLINK_HWID := 0x08000001
  296. CONSOLE := ttyATH0,115200
  297. endef
  298. TARGET_DEVICES += gl-inet-6408A-v1 gl-inet-6416A-v1
  299. define Device/mc-mac1200r
  300. $(Device/tplink-8mlzma)
  301. BOARDNAME := MC-MAC1200R
  302. DEVICE_PROFILE := MAC1200R
  303. TPLINK_HWID := 0x12000001
  304. endef
  305. TARGET_DEVICES += mc-mac1200r
  306. define Device/minibox-v1
  307. $(Device/tplink-16mlzma)
  308. BOARDNAME := MINIBOX-V1
  309. DEVICE_PROFILE := MINIBOXV1
  310. TPLINK_HWID := 0x3C000201
  311. CONSOLE := ttyATH0,115200
  312. endef
  313. TARGET_DEVICES += minibox-v1
  314. define Device/onion-omega
  315. $(Device/tplink-16mlzma)
  316. BOARDNAME := ONION-OMEGA
  317. DEVICE_PROFILE := OMEGA
  318. TPLINK_HWID := 0x04700001
  319. CONSOLE := ttyATH0,115200
  320. endef
  321. TARGET_DEVICES += onion-omega
  322. define Device/tl-mr10u-v1
  323. $(Device/tplink-4mlzma)
  324. BOARDNAME := TL-MR10U
  325. DEVICE_PROFILE := TLMR10U
  326. TPLINK_HWID := 0x00100101
  327. CONSOLE := ttyATH0,115200
  328. endef
  329. define Device/tl-mr11u-v1
  330. $(Device/tplink-4mlzma)
  331. BOARDNAME := TL-MR11U
  332. DEVICE_PROFILE := TLMR11U
  333. TPLINK_HWID := 0x00110101
  334. CONSOLE := ttyATH0,115200
  335. endef
  336. define Device/tl-mr11u-v2
  337. $(Device/tplink-4mlzma)
  338. BOARDNAME := TL-MR11U
  339. DEVICE_PROFILE := TLMR11U
  340. TPLINK_HWID := 0x00110102
  341. CONSOLE := ttyATH0,115200
  342. endef
  343. define Device/tl-mr12u-v1
  344. $(Device/tplink-4mlzma)
  345. BOARDNAME := TL-MR13U
  346. DEVICE_PROFILE := TLMR12U
  347. TPLINK_HWID := 0x00120101
  348. CONSOLE := ttyATH0,115200
  349. endef
  350. define Device/tl-mr13u-v1
  351. $(Device/tplink-4mlzma)
  352. BOARDNAME := TL-MR13U
  353. DEVICE_PROFILE := TLMR13U
  354. TPLINK_HWID := 0x00130101
  355. CONSOLE := ttyATH0,115200
  356. endef
  357. TARGET_DEVICES += tl-mr10u-v1 tl-mr11u-v1 tl-mr11u-v2 tl-mr12u-v1 tl-mr13u-v1
  358. define Device/tl-mr3020-v1
  359. $(Device/tplink-4mlzma)
  360. BOARDNAME := TL-MR3020
  361. DEVICE_PROFILE := TLMR3020
  362. TPLINK_HWID := 0x30200001
  363. CONSOLE := ttyATH0,115200
  364. endef
  365. define Device/tl-mr3040-v1
  366. $(Device/tplink-4mlzma)
  367. BOARDNAME := TL-MR3040
  368. DEVICE_PROFILE := TLMR3040
  369. TPLINK_HWID := 0x30400001
  370. CONSOLE := ttyATH0,115200
  371. endef
  372. define Device/tl-mr3040-v2
  373. $(Device/tplink-4mlzma)
  374. BOARDNAME := TL-MR3040-v2
  375. DEVICE_PROFILE := TLMR3040
  376. TPLINK_HWID := 0x30400002
  377. CONSOLE := ttyATH0,115200
  378. endef
  379. define Device/tl-mr3220-v2
  380. $(Device/tplink-4mlzma)
  381. BOARDNAME := TL-MR3220-v2
  382. DEVICE_PROFILE := TLMR3220
  383. TPLINK_HWID := 0x32200002
  384. CONSOLE := ttyATH0,115200
  385. endef
  386. define Device/tl-mr3420-v2
  387. $(Device/tplink-4mlzma)
  388. BOARDNAME := TL-MR3420-v2
  389. DEVICE_PROFILE := TLMR3420
  390. TPLINK_HWID := 0x34200002
  391. endef
  392. TARGET_DEVICES += tl-mr3020-v1 tl-mr3040-v1 tl-mr3040-v2 tl-mr3220-v2 tl-mr3420-v2
  393. define Device/tl-wr703n-v1
  394. $(Device/tplink-4mlzma)
  395. BOARDNAME := TL-WR703N
  396. DEVICE_PROFILE := TLWR703
  397. TPLINK_HWID := 0x07030101
  398. CONSOLE := ttyATH0,115200
  399. endef
  400. define Device/tl-wr710n-v1
  401. $(Device/tplink-8mlzma)
  402. BOARDNAME := TL-WR710N
  403. DEVICE_PROFILE := TLWR710
  404. TPLINK_HWID := 0x07100001
  405. CONSOLE := ttyATH0,115200
  406. endef
  407. define Device/tl-wr710n-v2
  408. $(Device/tplink-4mlzma)
  409. BOARDNAME := TL-WR710N
  410. DEVICE_PROFILE := TLWR710
  411. TPLINK_HWID := 0x07100002
  412. CONSOLE := ttyATH0,115200
  413. endef
  414. define Device/tl-wr720n-v3
  415. $(Device/tplink-4mlzma)
  416. BOARDNAME := TL-WR720N-v3
  417. DEVICE_PROFILE := TLWR720
  418. TPLINK_HWID := 0x07200103
  419. CONSOLE := ttyATH0,115200
  420. endef
  421. define Device/tl-wr720n-v4
  422. $(Device/tplink-4mlzma)
  423. BOARDNAME := TL-WR720N-v3
  424. DEVICE_PROFILE := TLWR720
  425. TPLINK_HWID := 0x07200104
  426. CONSOLE := ttyATH0,115200
  427. endef
  428. TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr720n-v3 tl-wr720n-v4
  429. define Device/tl-wr740n-v4
  430. $(Device/tplink-4mlzma)
  431. BOARDNAME := TL-WR741ND-v4
  432. DEVICE_PROFILE := TLWR740
  433. TPLINK_HWID := 0x07400004
  434. CONSOLE := ttyATH0,115200
  435. endef
  436. define Device/tl-wr740n-v5
  437. $(Device/tplink-4mlzma)
  438. BOARDNAME := TL-WR741ND-v4
  439. DEVICE_PROFILE := TLWR740
  440. TPLINK_HWID := 0x07400005
  441. CONSOLE := ttyATH0,115200
  442. endef
  443. define Device/tl-wr740n-v6
  444. $(Device/tplink-4mlzma)
  445. BOARDNAME := TL-WR841N-v9
  446. DEVICE_PROFILE := TLWR740
  447. TPLINK_HWID := 0x07400006
  448. endef
  449. define Device/tl-wr741nd-v1
  450. $(Device/tplink-4m)
  451. BOARDNAME := TL-WR741ND
  452. DEVICE_PROFILE := TLWR741
  453. TPLINK_HWID := 0x07410001
  454. endef
  455. define Device/tl-wr741nd-v2
  456. $(Device/tplink-4m)
  457. BOARDNAME := TL-WR741ND
  458. DEVICE_PROFILE := TLWR741
  459. TPLINK_HWID := 0x07410001
  460. endef
  461. define Device/tl-wr741nd-v4
  462. $(Device/tplink-4mlzma)
  463. BOARDNAME := TL-WR741ND-v4
  464. DEVICE_PROFILE := TLWR741
  465. TPLINK_HWID := 0x07410004
  466. CONSOLE := ttyATH0,115200
  467. endef
  468. define Device/tl-wr741nd-v5
  469. $(Device/tplink-4mlzma)
  470. BOARDNAME := TL-WR741ND-v4
  471. DEVICE_PROFILE := TLWR741
  472. TPLINK_HWID := 0x07400005
  473. CONSOLE := ttyATH0,115200
  474. endef
  475. define Device/tl-wr743nd-v2
  476. $(Device/tplink-4mlzma)
  477. BOARDNAME := TL-WR741ND-v4
  478. DEVICE_PROFILE := TLWR743
  479. TPLINK_HWID := 0x07430002
  480. CONSOLE := ttyATH0,115200
  481. endef
  482. TARGET_DEVICES += tl-wr740n-v4 tl-wr740n-v5 tl-wr740n-v6 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr741nd-v5 tl-wr743nd-v2
  483. define Device/tl-wr841n-v8
  484. $(Device/tplink-4mlzma)
  485. BOARDNAME := TL-WR841N-v8
  486. DEVICE_PROFILE := TLWR841
  487. TPLINK_HWID := 0x08410008
  488. endef
  489. define Device/tl-wr841n-v9
  490. $(Device/tplink-4mlzma)
  491. BOARDNAME := TL-WR841N-v9
  492. DEVICE_PROFILE := TLWR841
  493. TPLINK_HWID := 0x08410009
  494. endef
  495. define Device/tl-wr841n-v10
  496. $(Device/tplink-4mlzma)
  497. BOARDNAME := TL-WR841N-v9
  498. DEVICE_PROFILE := TLWR841
  499. TPLINK_HWID := 0x08410010
  500. endef
  501. define Device/tl-wr841n-v11
  502. $(Device/tplink-4mlzma)
  503. BOARDNAME := TL-WR841N-v11
  504. DEVICE_PROFILE := TLWR841
  505. TPLINK_HWID := 0x08410011
  506. endef
  507. define Device/tl-wr842n-v2
  508. $(Device/tplink-8mlzma)
  509. BOARDNAME := TL-WR842N-v2
  510. DEVICE_PROFILE := TLWR842
  511. TPLINK_HWID := 0x8420002
  512. endef
  513. define Device/tl-wr843nd-v1
  514. $(Device/tplink-4mlzma)
  515. BOARDNAME := TL-WR841N-v8
  516. DEVICE_PROFILE := TLWR843
  517. TPLINK_HWID := 0x08430001
  518. endef
  519. define Device/tl-wr847n-v8
  520. $(Device/tplink-4mlzma)
  521. BOARDNAME := TL-WR841N-v8
  522. DEVICE_PROFILE := TLWR841
  523. TPLINK_HWID := 0x08470008
  524. endef
  525. TARGET_DEVICES += tl-wr841n-v8 tl-wr841n-v9 tl-wr841n-v10 tl-wr841n-v11 tl-wr842n-v2 tl-wr843nd-v1 tl-wr847n-v8
  526. define Device/tl-wr941nd-v5
  527. $(Device/tplink-4mlzma)
  528. BOARDNAME := TL-WR941ND-v5
  529. DEVICE_PROFILE := TLWR941
  530. TPLINK_HWID := 0x09410005
  531. endef
  532. define Device/tl-wr941nd-v6
  533. $(Device/tplink-4mlzma)
  534. BOARDNAME := TL-WR941ND-v6
  535. DEVICE_PROFILE := TLWR941
  536. TPLINK_HWID := 0x09410006
  537. endef
  538. # Chinese version (unlike European) is similar to the TL-WDR3500
  539. define Device/tl-wr941nd-v6-cn
  540. $(Device/tplink-4mlzma)
  541. BOARDNAME := TL-WDR3500
  542. DEVICE_PROFILE := TLWR941
  543. TPLINK_HWID := 0x09410006
  544. endef
  545. TARGET_DEVICES += tl-wr941nd-v5 tl-wr941nd-v6 tl-wr941nd-v6-cn
  546. define Device/tl-wr1041n-v2
  547. $(Device/tplink-4mlzma)
  548. BOARDNAME := TL-WR1041N-v2
  549. DEVICE_PROFILE := TLWR1041
  550. TPLINK_HWID := 0x10410002
  551. endef
  552. TARGET_DEVICES += tl-wr1041n-v2
  553. define Device/tl-wdr4900-v2
  554. $(Device/tplink-8mlzma)
  555. BOARDNAME := TL-WDR4900-v2
  556. DEVICE_PROFILE := TLWDR4900V2
  557. TPLINK_HWID := 0x49000002
  558. endef
  559. TARGET_DEVICES += tl-wdr4900-v2
  560. define Device/tl-wa701nd-v2
  561. $(Device/tplink-4mlzma)
  562. BOARDNAME := TL-WA701ND-v2
  563. DEVICE_PROFILE := TLWA701
  564. TPLINK_HWID := 0x07010002
  565. CONSOLE := ttyATH0,115200
  566. endef
  567. define Device/tl-wa750re-v1
  568. $(Device/tplink-4mlzma)
  569. BOARDNAME := TL-WA750RE
  570. DEVICE_PROFILE := TLWA750
  571. TPLINK_HWID := 0x07500001
  572. endef
  573. TARGET_DEVICES += tl-wa701nd-v2 tl-wa750re-v1
  574. define Device/tl-wa801nd-v2
  575. $(Device/tplink-4mlzma)
  576. BOARDNAME := TL-WA801ND-v2
  577. DEVICE_PROFILE := TLWA801
  578. TPLINK_HWID := 0x08010002
  579. endef
  580. define Device/tl-wa830re-v2
  581. $(Device/tplink-4mlzma)
  582. BOARDNAME := TL-WA830RE-v2
  583. DEVICE_PROFILE := TLWA830
  584. TPLINK_HWID := 0x08300002
  585. endef
  586. define Device/tl-wa850re-v1
  587. $(Device/tplink-4mlzma)
  588. BOARDNAME := TL-WA850RE
  589. DEVICE_PROFILE := TLWA850
  590. TPLINK_HWID := 0x08500001
  591. endef
  592. define Device/tl-wa860re-v1
  593. $(Device/tplink-4mlzma)
  594. BOARDNAME := TL-WA860RE
  595. DEVICE_PROFILE := TLWA860
  596. TPLINK_HWID := 0x08600001
  597. endef
  598. TARGET_DEVICES += tl-wa801nd-v2 tl-wa830re-v2 tl-wa850re-v1 tl-wa860re-v1
  599. define Device/tl-wa901nd-v3
  600. $(Device/tplink-4mlzma)
  601. BOARDNAME := TL-WA901ND-v3
  602. DEVICE_PROFILE := TLWA901
  603. TPLINK_HWID := 0x09010003
  604. endef
  605. define Device/tl-wa901nd-v4
  606. $(Device/tplink-4mlzma)
  607. BOARDNAME := TL-WA901ND-v4
  608. DEVICE_PROFILE := TLWA901
  609. TPLINK_HWID := 0x09010004
  610. endef
  611. TARGET_DEVICES += tl-wa901nd-v3 tl-wa901nd-v4
  612. define Device/tl-wa7210n-v2
  613. $(Device/tplink-4mlzma)
  614. BOARDNAME := TL-WA7210N-v2
  615. DEVICE_PROFILE := TLWA7210
  616. TPLINK_HWID := 0x72100002
  617. CONSOLE := ttyATH0,115200
  618. endef
  619. TARGET_DEVICES += tl-wa7210n-v2
  620. define Device/smart-300
  621. $(Device/tplink-8mlzma)
  622. BOARDNAME := SMART-300
  623. DEVICE_PROFILE := SMART-300
  624. TPLINK_HWID := 0x93410001
  625. endef
  626. TARGET_DEVICES += smart-300
  627. define Device/oolite
  628. $(Device/tplink-16mlzma)
  629. BOARDNAME := GS-OOLITE
  630. DEVICE_PROFILE := OOLITE
  631. TPLINK_HWID := 0x3C000101
  632. CONSOLE := ttyATH0,115200
  633. endef
  634. TARGET_DEVICES += oolite
  635. rootfs_type=$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))
  636. # $(1): rootfs type.
  637. # $(2): board name.
  638. define imgname
  639. $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(call rootfs_type,$(1))
  640. endef
  641. define rootfs_align
  642. $(patsubst %-256k,0x40000,$(patsubst %-128k,0x20000,$(patsubst %-64k,0x10000,$(patsubst squashfs%,0x4,$(patsubst root.%,%,$(1))))))
  643. endef
  644. define sysupname
  645. $(call imgname,$(1),$(2))-sysupgrade.bin
  646. endef
  647. define factoryname
  648. $(call imgname,$(1),$(2))-factory.bin
  649. endef
  650. COMMA:=,
  651. define mkcmdline
  652. $(if $(1),board=$(1) )$(if $(2),console=$(2)$(COMMA)$(3))
  653. endef
  654. define mtdpartsize
  655. $(shell sz=`echo '$(2)' | sed -ne 's/.*[:$(COMMA)]\([0-9]*\)k[@]*[0-9a-zx]*($(1)).*/\1/p'`; [ -n "$$sz" ] && echo $$(($$sz * 1024)))
  656. endef
  657. SINGLE_PROFILES:=
  658. # $(1) : name of image build method to be used, e.g., TPLINK-LZMA, AthLzma.
  659. # $(2) : name of the build template to be used, e.g. 64k, 64kraw, 128k, etc.
  660. # $(3) : name of the profile to be defined.
  661. # $(4) : board name.
  662. # $(5)~$(7) : arguments for $(mkcmdline)
  663. # board=$(1) console=$(2),$(3)
  664. # $(8)~$(14): extra arguments.
  665. define SingleProfile
  666. # $(1): action name, e.g. loader, buildkernel, squashfs, etc.
  667. define Image/Build/Profile/$(3)
  668. $$(call Image/Build/Template/$(2)/$$(1),$(1),$(4),$$(call mkcmdline,$(5),$(6),$(7)),$(8),$(9),$(10),$(11),$(12),$(13),$(14))
  669. endef
  670. SINGLE_PROFILES += $(3)
  671. endef
  672. # $(1), name of the MultiProfile to be added.
  673. # $(2), name of Profiles to be included in the MultiProfile.
  674. define MultiProfile
  675. define Image/Build/Profile/$(1)
  676. $(foreach p,$(2),
  677. $$(call Image/Build/Profile/$p,$$(1))
  678. )
  679. endef
  680. endef
  681. LOADER_MAKE := $(NO_TRACE_MAKE) -C lzma-loader KDIR=$(KDIR)
  682. KDIR_TMP:=$(KDIR)/tmp
  683. VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux
  684. UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage
  685. # $(1): input file.
  686. # $(2): output file.
  687. # $(3): extra arguments for lzma.
  688. define CompressLzma
  689. $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(3) $(2)
  690. endef
  691. define PatchKernel
  692. cp $(KDIR)/vmlinux$(3) $(KDIR_TMP)/vmlinux$(3)-$(1)
  693. $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(3)-$(1) "$(strip $(2))"
  694. endef
  695. define PatchKernel/initramfs
  696. $(call PatchKernel,$(1),$(2),-initramfs)
  697. cp $(KDIR_TMP)/vmlinux-initramfs-$(1) $(call imgname,initramfs,$(1)).bin
  698. endef
  699. # $(1): board name.
  700. # $(2): kernel command line.
  701. # $(3): extra argumetns for lzma.
  702. # $(4): name suffix, e.g. "-initramfs".
  703. define PatchKernelLzma
  704. cp $(KDIR)/vmlinux$(4) $(KDIR_TMP)/vmlinux$(4)-$(1)
  705. $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(4)-$(1) "$(strip $(2))"
  706. $(call CompressLzma,$(KDIR_TMP)/vmlinux$(4)-$(1),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(3))
  707. endef
  708. define PatchKernelGzip
  709. cp $(KDIR)/vmlinux$(3) $(KDIR_TMP)/vmlinux$(3)-$(1)
  710. $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(3)-$(1) "$(strip $(2))"
  711. gzip -9 -c $(KDIR_TMP)/vmlinux$(3)-$(1) > $(KDIR_TMP)/vmlinux$(3)-$(1).bin.gz
  712. endef
  713. ifneq ($(SUBTARGET),mikrotik)
  714. # $(1): compression method of the data.
  715. # $(2): extra arguments.
  716. # $(3): input data file.
  717. # $(4): output file.
  718. define MkuImage
  719. mkimage -A mips -O linux -T kernel -a 0x80060000 -C $(1) $(2) \
  720. -e 0x80060000 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
  721. -d $(3) $(4)
  722. endef
  723. # $(1): board name.
  724. # $(2): kernel command line.
  725. # $(3): extra arguments for lzma.
  726. # $(4): name suffix, e.g. "-initramfs".
  727. # $(5): extra arguments for mkimage.
  728. define MkuImageLzma
  729. $(call PatchKernelLzma,$(1),$(2),$(3),$(4))
  730. $(call MkuImage,lzma,$(5),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(KDIR_TMP)/vmlinux$(4)-$(1).uImage)
  731. endef
  732. define MkuImageLzma/initramfs
  733. $(call PatchKernelLzma,$(1),$(2),$(3),-initramfs)
  734. $(call MkuImage,lzma,$(4),$(KDIR_TMP)/vmlinux-initramfs-$(1).bin.lzma,$(call imgname,initramfs,$(1))-uImage.bin)
  735. endef
  736. define MkuImageGzip
  737. $(call PatchKernelGzip,$(1),$(2))
  738. $(call MkuImage,gzip,,$(KDIR_TMP)/vmlinux-$(1).bin.gz,$(KDIR_TMP)/vmlinux-$(1).uImage)
  739. endef
  740. define MkuImageGzip/initramfs
  741. $(call PatchKernelGzip,$(1),$(2),-initramfs)
  742. $(call MkuImage,gzip,,$(KDIR_TMP)/vmlinux-initramfs-$(1).bin.gz,$(call imgname,initramfs,$(1))-uImage.bin)
  743. endef
  744. define MkuImageOKLI
  745. $(call MkuImage,lzma,-M 0x4f4b4c49,$(KDIR)/vmlinux.bin.lzma,$(KDIR_TMP)/vmlinux-$(1).okli)
  746. endef
  747. endif
  748. # $(1): name of the 1st file.
  749. # $(2): size limit of the 1st file if it is greater than 262144, or
  750. # the erase size of the flash if it is greater than zero and less
  751. # than 262144
  752. # $(3): name of the 2nd file.
  753. # $(4): size limit of the 2nd file if $(2) is greater than 262144, otherwise
  754. # it is the size limit of the output file
  755. # $(5): name of the output file.
  756. # $(6): padding size.
  757. define CatFiles
  758. if [ $(2) -eq 0 ]; then \
  759. filename="$(3)"; fstype=$$$${filename##*\.}; \
  760. case "$$$${fstype}" in \
  761. "jffs2-64k") bs=65536;; \
  762. "jffs2-128k") bs=131072;; \
  763. "jffs2-256k") bs=262144;; \
  764. *) bs=`stat -c%s $(1)`;; \
  765. esac; \
  766. ( dd if=$(1) bs=$$$${bs} conv=sync; cat $(3) ) > $(5); \
  767. if [ -n "$(6)" ]; then \
  768. case "$$$${fstype}" in \
  769. squashfs*) \
  770. padjffs2 $(5) $(6); \
  771. ;; \
  772. esac; \
  773. fi; \
  774. if [ `stat -c%s $(5)` -gt $(4) ]; then \
  775. echo "Warning: $(5) is too big (> $(4) bytes)" >&2; \
  776. rm -f $(5); \
  777. fi; \
  778. else if [ $(2) -gt 262144 ]; then \
  779. if [ `stat -c%s "$(1)"` -gt $(2) ]; then \
  780. echo "Warning: $(1) is too big (> $(2) bytes)" >&2; \
  781. else if [ `stat -c%s $(3)` -gt $(4) ]; then \
  782. echo "Warning: $(3) is too big (> $(4) bytes)" >&2; \
  783. else \
  784. ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \
  785. fi; fi; \
  786. else \
  787. ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \
  788. if [ `stat -c%s $(5)` -gt $(4) ]; then \
  789. echo "Warning: $(5) is too big (> $(4) bytes)" >&2; \
  790. rm -f $(5); \
  791. fi; \
  792. fi; fi
  793. endef
  794. # $(1): rootfs type.
  795. # $(2): board name.
  796. # $(3): kernel image size limit.
  797. # $(4): rootfs image size limit.
  798. # $(5): padding argument for padjffs2.
  799. Sysupgrade/KR=$(call CatFiles,$(2),$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(5)))
  800. Sysupgrade/KRuImage=$(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage,$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(2)),$(5))
  801. Sysupgrade/RKuImage=$(call CatFiles,$(KDIR)/root.$(1),$(4),$(KDIR_TMP)/vmlinux-$(2).uImage,$(3),$(call sysupname,$(1),$(2)))
  802. # $(1): ubinize ini file
  803. # $(2): working directory
  804. # $(3): output file
  805. # $(4): physical erase block size
  806. # $(5): minimum I/O unit size
  807. # $(6): custom options
  808. define ubinize
  809. $(CP) $(1) $(2)
  810. ( cd $(2); $(STAGING_DIR_HOST)/bin/ubinize -o $(3) -p $(4) -m $(5) $(6) $(1))
  811. endef
  812. #
  813. # Embed lzma-compressed kernel inside lzma-loader.
  814. #
  815. # $(1), suffix of output filename, e.g. generic, lowercase board name, etc.
  816. # $(2), suffix of target file to build, e.g. bin, gz, elf
  817. # $(3), kernel command line to pass from lzma-loader to kernel
  818. # $(4), unused here
  819. # $(5), suffix of kernel filename, e.g. -initramfs, or empty
  820. define Image/BuildLoader
  821. -rm -rf $(KDIR)/lzma-loader
  822. $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)"\
  823. LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
  824. LOADER_DATA="$(KDIR)/vmlinux$(5).bin.lzma" BOARD="$(1)" \
  825. compile loader.$(2)
  826. -$(CP) $(KDIR)/loader-$(1).$(2) $(KDIR)/loader-$(1)$(5).$(2)
  827. endef
  828. #
  829. # Embed patched lzma-compressed kernel inside lzma-loader.
  830. #
  831. # Specifying the command line via the lzma-loader doesn't work with some
  832. # models (like the TP-LINK CPE series), so this version first patches the
  833. # command line in the image and then builds the loader around it.
  834. #
  835. # $(1), suffix of output filename, e.g. generic, lowercase board name, etc.
  836. # $(2), suffix of target file to build, e.g. bin, gz, elf
  837. # $(3), kernel command line to pass from lzma-loader to kernel
  838. # $(4), unused here
  839. # $(5), suffix of kernel filename, e.g. -initramfs, or empty
  840. define Image/BuildLoaderPatched
  841. $(call PatchKernelLzma,$(1),$(3))
  842. -rm -rf $(KDIR)/lzma-loader
  843. $(LOADER_MAKE) LOADER=loader-$(1).$(2) \
  844. LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
  845. LOADER_DATA="$(KDIR_TMP)/vmlinux-$(1)$(5).bin.lzma" BOARD="$(1)" \
  846. compile loader.$(2)
  847. -$(CP) $(KDIR)/loader-$(1).$(2) $(KDIR)/loader-$(1)$(5).$(2)
  848. endef
  849. #
  850. # Build lzma-loader alone which will search for lzma-compressed kernel identified by
  851. # uImage header with magic "OKLI" at boot time.
  852. #
  853. # $(4), offset into the flash space to start searching uImage magic "OKLI".
  854. # $(5), size of search range starting at $(4). With 0 as the value, uImage
  855. # header is expected to be at precisely $(4)
  856. define Image/BuildLoaderAlone
  857. -rm -rf $(KDIR)/lzma-loader
  858. $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)" \
  859. LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
  860. BOARD="$(1)" FLASH_OFFS=$(4) FLASH_MAX=$(5) \
  861. compile loader.$(2)
  862. endef
  863. define Build/Clean
  864. $(LOADER_MAKE) clean
  865. endef
  866. alfa_ap120c_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,13312k(rootfs),1536k(kernel),1152k(unknown)ro,64k(art)ro;spi0.1:-(unknown)
  867. alfa_ap96_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13312k(rootfs),2048k(kernel),512k(caldata)ro,15360k@0x80000(firmware)
  868. alfa_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1600k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware)
  869. alfa_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,15936k(firmware),64k(nvram),64k(art)ro
  870. all0258n_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),6272k(firmware),1536k(failsafe),64k(art)
  871. all0315n_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env),13568k(firmware),2048k(failsafe),256k(art)ro
  872. ap81_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,5120k(rootfs),2688k(kernel),64k(art)ro,7808k@0x50000(firmware)
  873. ap83_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,128k(u-boot-env)ro,4096k(rootfs),3648k(kernel),64k(art)ro,7744k@0x60000(firmware)
  874. ap96_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1728k(kernel),64k(art)ro,7872k@0x40000(firmware)
  875. ap113_mtd_layout=mtdparts=spi0.0:64k(u-boot),3008k(rootfs),896k(uImage),64k(NVRAM),64k(ART),3904k@0x10000(firmware)
  876. ap121_mtdlayout_2M=mtdparts=spi0.0:64k(u-boot)ro,1216k(rootfs),704k(kernel),64k(art)ro,1920k@0x10000(firmware)
  877. ap121_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2752k(rootfs),896k(kernel),64k(nvram),64k(art)ro,3648k@0x50000(firmware)
  878. ap132_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art),7808k@0x50000(firmware)
  879. ap135_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
  880. ap136_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(mib0),64k(art)ro,7744k@0x50000(firmware)
  881. bxu2000n2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),8448k(rootfs),6016k(user),64k(cfg),64k(oem),64k(art)ro
  882. cameo_ap81_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(config)ro,3840k(firmware),64k(art)ro
  883. cameo_ap91_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,3712k(firmware),64k(mac)ro,64k(art)ro
  884. cameo_ap99_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,3520k(firmware),64k(mac)ro,192k(lp)ro,64k(art)ro
  885. cameo_ap121_mtdlayout=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k(nvram)ro,192k(language)ro,3648k(firmware)
  886. cameo_ap121_mtdlayout_8M=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k(nvram)ro,256k(language)ro,7680k@0x80000(firmware)
  887. cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
  888. cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
  889. cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
  890. cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k@0xa0000(firmware)
  891. cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k@0x40000(firmware)
  892. eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
  893. db120_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware)
  894. dgl_5500_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro
  895. dlan_pro_500_wp_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(Config1)ro,64k(Config2)ro,7680k@0x70000(firmware),64k(art)ro
  896. dlan_pro_1200_ac_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(Config1)ro,64k(Config2)ro,15872k@0x70000(firmware),64k(art)ro
  897. cameo_ap94_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,1600k(unknown)ro,64k@0x7f0000(caldata_copy)
  898. cameo_ap94_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7808k(firmware),64k(caldata)ro,64k@0x660000(caldata_orig),6208k@0x50000(firmware_orig)
  899. esr900_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k@0x40000(firmware)
  900. esr1750_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k@0x40000(firmware)
  901. epg5000_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k@0x40000(firmware)
  902. ew-dorin_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),3712k(firmware),64k(art)
  903. ew-dorin_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
  904. f9k1115v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),14464k(rootfs),1408k(kernel),64k(nvram)ro,64k(envram)ro,64k(art)ro,15872k@0x50000(firmware)
  905. dlrtdev_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,640k(certs),960k(unknown)ro,64k@0x7f0000(caldata_copy)
  906. dlrtdev_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7168k(firmware),640k(certs),64k(caldata)ro,64k@0x660000(caldata_orig),6208k@0x50000(firmware_orig)
  907. dragino2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,16000k(firmware),64k(config)ro,64k(art)ro
  908. dw33d_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware);ar934x-nfc:96m(rootfs_data),32m(backup)ro
  909. hiwifi_hc6361_mtdlayout=mtdparts=spi0.0:64k(u-boot)ro,64k(bdinfo)ro,1280k(kernel),14848k(rootfs),64k(backup)ro,64k(art)ro,16128k@0x20000(firmware)
  910. mr12_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x80000(firmware)
  911. mr16_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x80000(firmware)
  912. pb92_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2752k(rootfs),896k(kernel),64k(nvram),64k(art)ro,3648k@0x50000(firmware)
  913. planex_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),128k(art)ro
  914. ubntxm_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
  915. uap_pro_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1536k(kernel),14208k(rootfs),256k(cfg)ro,64k(EEPROM)ro,15744k@0x50000(firmware)
  916. ubdev_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7488k(firmware),64k(certs),256k(cfg)ro,64k(EEPROM)ro
  917. whrhpg300n_mtdlayout=mtdparts=spi0.0:248k(u-boot)ro,8k(u-boot-env)ro,3712k(firmware),64k(art)ro
  918. wlr8100_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),14080k(rootfs),192k(unknown)ro,64k(art)ro,384k(unknown2)ro,15488k@0x40000(firmware)
  919. wpj344_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
  920. wpj531_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
  921. wpj558_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
  922. wndap360_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1728k(kernel),6016k(rootfs),64k(nvram)ro,64k(art)ro,7744k@0x50000(firmware)
  923. wnr2200_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro
  924. wnr2000v3_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmware),64k(art)ro
  925. wnr2000v4_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,3776k(firmware),64k(art)ro
  926. r6100_mtdlayout=mtdparts=ar934x-nfc:128k(u-boot)ro,256k(caldata),256k(caldata-backup),512k(config),512k(pot),2048k(kernel),122240k(ubi),25600k@0x1a0000(firmware),2048k(language),3072k(traffic_meter)
  927. wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata),512k(pot),2048k(language),512k(config),3072k(traffic_meter),2048k(kernel),23552k(ubi),25600k@0x6c0000(firmware),256k(caldata_backup),-(reserved)
  928. zcn1523h_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6208k(rootfs),1472k(kernel),64k(configure)ro,64k(mfg)ro,64k(art)ro,7680k@0x50000(firmware)
  929. mynet_n600_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro
  930. mynet_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro
  931. zyx_nbg6716_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(env)ro,64k(RFdata)ro,-(nbu);ar934x-nfc:2048k(zyxel_rfsd),2048k(romd),1024k(header),2048k(kernel),-(ubi)
  932. qihoo_c301_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),64k(devdata),64k(devconf),15744k(firmware),64k(warm_start),64k(action_image_config),64k(radiocfg)ro;spi0.1:15360k(upgrade2),1024k(privatedata)
  933. define Image/BuildKernel
  934. cp $(KDIR)/vmlinux.elf $(VMLINUX).elf
  935. cp $(KDIR)/vmlinux $(VMLINUX).bin
  936. dd if=$(KDIR)/vmlinux.bin.lzma of=$(VMLINUX).lzma bs=65536 conv=sync
  937. dd if=$(KDIR)/vmlinux.bin.gz of=$(VMLINUX).gz bs=65536 conv=sync
  938. $(call MkuImage,gzip,,$(KDIR)/vmlinux.bin.gz,$(UIMAGE)-gzip.bin)
  939. $(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(UIMAGE)-lzma.bin)
  940. cp $(KDIR)/loader-generic.elf $(VMLINUX)-lzma.elf
  941. -mkdir -p $(KDIR_TMP)
  942. $(call Image/Build/Profile/$(IMAGE_PROFILE),buildkernel)
  943. endef
  944. define Image/BuildKernel/Initramfs
  945. cp $(KDIR)/vmlinux-initramfs.elf $(VMLINUX)-initramfs.elf
  946. cp $(KDIR)/vmlinux-initramfs $(VMLINUX)-initramfs.bin
  947. dd if=$(KDIR)/vmlinux-initramfs.bin.lzma of=$(VMLINUX)-initramfs.lzma bs=65536 conv=sync
  948. dd if=$(KDIR)/vmlinux-initramfs.bin.gz of=$(VMLINUX)-initramfs.gz bs=65536 conv=sync
  949. $(call MkuImage,gzip,,$(KDIR)/vmlinux-initramfs.bin.gz,$(UIMAGE)-initramfs-gzip.bin)
  950. $(call MkuImage,lzma,,$(KDIR)/vmlinux-initramfs.bin.lzma,$(UIMAGE)-initramfs-lzma.bin)
  951. cp $(KDIR)/loader-generic-initramfs.elf $(VMLINUX)-initramfs-lzma.elf
  952. $(call Image/Build/Initramfs)
  953. endef
  954. Image/Build/WRT400N/buildkernel=$(call MkuImageLzma,$(2),$(3))
  955. define Image/Build/WRT400N
  956. $(call Sysupgrade/KRuImage,$(1),$(2),1310720,6488064)
  957. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  958. wrt400n $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR)/root.$(1) $(call factoryname,$(1),$(2)); \
  959. fi
  960. endef
  961. define Image/Build/CameoAP94/buildkernel
  962. $(call MkuImageLzma,$(2),$(3) $(4))
  963. $(call MkuImageLzma,$(2)-fat,$(3) $(5))
  964. endef
  965. define Image/Build/CameoAP94
  966. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  967. $(eval fwsize_fat=$(call mtdpartsize,firmware,$(5)))
  968. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
  969. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  970. ( \
  971. dd if=$(call sysupname,$(1),$(2)); \
  972. echo -n "$(6)"; \
  973. ) > $(call imgname,$(1),$(2))-backup-loader.bin; \
  974. if [ `stat -c%s $(call sysupname,$(1),$(2))` -gt 4194304 ]; then \
  975. echo "Warning: $(call sysupname,$(1),$(2)) is too big" >&2; \
  976. else \
  977. ( \
  978. dd if=$(call sysupname,$(1),$(2)) bs=4096k conv=sync; \
  979. echo -n "$(7)"; \
  980. ) > $(call factoryname,$(1),$(2)); \
  981. fi; \
  982. fi
  983. $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2)-fat.uImage,0,$(KDIR)/root.$(1),$$$$(($(fwsize_fat)-4*64*1024)),$(KDIR_TMP)/$(2)-fat.bin,64)
  984. if [ -e "$(KDIR_TMP)/$(2)-fat.bin" ]; then \
  985. echo -n "" > $(KDIR_TMP)/$(2)-fat.dummy; \
  986. sh $(TOPDIR)/scripts/combined-image.sh \
  987. "$(KDIR_TMP)/$(2)-fat.bin" \
  988. "$(KDIR_TMP)/$(2)-fat.dummy" \
  989. $(call sysupname,$(1),$(2)-fat); \
  990. fi
  991. endef
  992. define Image/Build/WZRHP
  993. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(3)-4*$(4)*1024)),$(4))
  994. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  995. ( \
  996. echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
  997. dd if=$(call sysupname,$(1),$(2)); \
  998. ) > $(call imgname,$(1),$(2))-tftp.bin; \
  999. buffalo-enc -p $(5) -v 1.99 \
  1000. -i $(call sysupname,$(1),$(2)) \
  1001. -o $(KDIR_TMP)/$(2).enc; \
  1002. buffalo-tag -b $(5) -p $(5) -a ath -v 1.99 -m 1.01 -l mlang8 \
  1003. -w 3 -c 0x80041000 -d 0x801e8000 -f 1 -r M_ \
  1004. -i $(KDIR_TMP)/$(2).enc \
  1005. -o $(call factoryname,$(1),$(2)); \
  1006. fi
  1007. endef
  1008. Image/Build/WZRHP64K/buildkernel=$(call MkuImageLzma,$(2),$(3))
  1009. Image/Build/WZRHP64K/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  1010. Image/Build/WZRHP64K=$(call Image/Build/WZRHP,$(1),$(2),33095680,64,$(4))
  1011. Image/Build/WZRHP128K/buildkernel=$(call MkuImageLzma,$(2),$(3))
  1012. Image/Build/WZRHP128K/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  1013. Image/Build/WZRHP128K=$(call Image/Build/WZRHP,$(1),$(2),33030144,128,$(4))
  1014. Image/Build/WHRHPG300N/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  1015. Image/Build/WHRHPG300N/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  1016. define Image/Build/WHRHPG300N
  1017. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  1018. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
  1019. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  1020. ( \
  1021. echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
  1022. dd if=$(call sysupname,$(1),$(2)); \
  1023. ) > $(call imgname,$(1),$(2))-tftp.bin; \
  1024. buffalo-enc -p $(5) -v 1.99 \
  1025. -i $(call sysupname,$(1),$(2)) \
  1026. -o $(KDIR_TMP)/$(2).enc; \
  1027. buffalo-tag -b $(5) -p $(5) -a ath -v 1.99 -m 1.01 -l mlang8 \
  1028. -w 3 -c 0x80041000 -d 0x801e8000 -f 1 -r M_ \
  1029. -i $(KDIR_TMP)/$(2).enc \
  1030. -o $(call factoryname,$(1),$(2)); \
  1031. fi
  1032. endef
  1033. define Image/Build/Cameo
  1034. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  1035. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
  1036. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  1037. factory_size=$$$$(($(fwsize) - $(6))); \
  1038. ( \
  1039. dd if=$(call sysupname,$(1),$(2)) bs=$$$${factory_size} conv=sync; \
  1040. echo -n $(5); \
  1041. ) > $(call factoryname,$(1),$(2)); \
  1042. fi
  1043. endef
  1044. Image/Build/CameoAP81/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap81_mtdlayout))
  1045. Image/Build/CameoAP81=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap81_mtdlayout),$(4),65536)
  1046. Image/Build/CameoAP81/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap81_mtdlayout))
  1047. Image/Build/CameoAP91/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap91_mtdlayout))
  1048. Image/Build/CameoAP91=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap91_mtdlayout),$(4),65536)
  1049. Image/Build/CameoAP91/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap91_mtdlayout))
  1050. Image/Build/CameoAP99/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap99_mtdlayout))
  1051. Image/Build/CameoAP99=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap99_mtdlayout),$(4),65536)
  1052. Image/Build/CameoAP99/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap99_mtdlayout))
  1053. Image/Build/CameoAP123_4M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap123_mtdlayout_4M))
  1054. Image/Build/CameoAP123_4M=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap123_mtdlayout_4M),$(4),26)
  1055. Image/Build/CameoAP123_4M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap123_mtdlayout_4M))
  1056. Image/Build/CameoAP135/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  1057. Image/Build/CameoAP135=$(call Image/Build/Cameo,$(1),$(2),$(3),$(4),$(5),26)
  1058. Image/Build/CameoAP135/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  1059. Image/Build/CameoDB120/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_db120_mtdlayout))
  1060. Image/Build/CameoDB120=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_db120_mtdlayout),$(4),26)
  1061. Image/Build/CameoDB120/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_db120_mtdlayout))
  1062. Image/Build/CameoDB120_8M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_db120_mtdlayout_8M))
  1063. Image/Build/CameoDB120_8M=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_db120_mtdlayout_8M),$(4),26)
  1064. Image/Build/CameoDB120_8M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_db120_mtdlayout_8M))
  1065. define Image/Build/CameoHornet
  1066. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  1067. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
  1068. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  1069. for r in $(7); do \
  1070. [ -n "$$$$r" ] && dashr="-$$$$r" || dashr=; \
  1071. [ -z "$$$$r" ] && r="DEF"; \
  1072. mkcameofw -M HORNET -R "$$$$r" -S $(5) -V $(6) -c \
  1073. -K $(8) -I $(fwsize) \
  1074. -k "$(call sysupname,$(1),$(2))" \
  1075. -o $(call imgname,$(1),$(2))-factory$$$$dashr.bin; \
  1076. true; \
  1077. done; \
  1078. fi
  1079. endef
  1080. Image/Build/CameoAP121/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap121_mtdlayout))
  1081. Image/Build/CameoAP121=$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo_ap121_mtdlayout),$(4),$(5),$(6),0xe0000)
  1082. Image/Build/CameoAP121/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap121_mtdlayout))
  1083. Image/Build/CameoAP121_8M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap121_mtdlayout_8M))
  1084. Image/Build/CameoAP121_8M=$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo_ap121_mtdlayout_8M),$(4),$(5),$(6),0x100000)
  1085. Image/Build/CameoAP121_8M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap121_mtdlayout_8M))
  1086. define Image/Build/dLAN
  1087. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  1088. $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
  1089. $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
  1090. $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
  1091. if [ -e "$(call factoryname,$(1),$(2))" ]; then \
  1092. dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
  1093. of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
  1094. dd if=$(KDIR)/root.$(1) \
  1095. of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
  1096. fi
  1097. endef
  1098. Image/Build/dLANLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  1099. Image/Build/dLANLzma=$(call Image/Build/dLAN,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
  1100. Image/Build/dLANLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  1101. define Image/Build/Ath
  1102. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  1103. $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
  1104. $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
  1105. $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
  1106. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  1107. dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
  1108. of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
  1109. dd if=$(KDIR)/root.$(1) \
  1110. of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
  1111. fi
  1112. endef
  1113. Image/Build/AthGzip/buildkernel=$(call MkuImageGzip,$(2),$(3) $(4))
  1114. Image/Build/AthGzip=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
  1115. Image/Build/AthGzip/initramfs=$(call MkuImageGzip/initramfs,$(2),$(3) $(4))
  1116. Image/Build/AthLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  1117. Image/Build/AthLzma=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
  1118. Image/Build/AthLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  1119. Image/Build/Belkin/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  1120. Image/Build/Belkin/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  1121. define Image/Build/Belkin
  1122. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  1123. $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
  1124. $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
  1125. $(call Sysupgrade/RKuImage,$(1),$(2),$(kernsize),$(rootsize))
  1126. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  1127. edimax_fw_header -m $(5) -v "OpenWrt$(REVISION)" \
  1128. -n "uImage" \
  1129. -i $(KDIR_TMP)/vmlinux-$(2).uImage \
  1130. -o $(KDIR_TMP)/$(2)-uImage; \
  1131. edimax_fw_header -m $(5) -v "OpenWrt$(REVISION)" \
  1132. -n "rootfs" \
  1133. -i $(KDIR)/root.$(1) \
  1134. -o $(KDIR_TMP)/$(2)-rootfs; \
  1135. ( \
  1136. dd if=$(KDIR_TMP)/$(2)-rootfs; \
  1137. dd if=$(KDIR_TMP)/$(2)-uImage; \
  1138. ) > "$(call factoryname,$(1),$(2))"; \
  1139. fi
  1140. endef
  1141. define Image/Build/EnGenius
  1142. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  1143. $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
  1144. $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
  1145. $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
  1146. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  1147. dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
  1148. of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
  1149. dd if=$(KDIR)/root.$(1) \
  1150. of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
  1151. mksenaofw -e $(call sysupname,$(1),$(2)) \
  1152. -o $(call imgname,$(1),$(2))-factory.dlf \
  1153. -r 0x101 -p $(7) -t 2; \
  1154. fi
  1155. endef
  1156. Image/Build/EnGenius/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  1157. Image/Build/EnGenius/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  1158. define MkuImageHiWiFi
  1159. # Field ih_name needs to start with "tw150v1"
  1160. mkimage -A mips -O linux -T kernel -a 0x80060000 -C $(1) $(2) \
  1161. -e 0x80060000 -n 'tw150v1 MIPS OpenWrt Linux-$(LINUX_VERSION)' \
  1162. -d $(3) $(4)
  1163. endef
  1164. define MkuImageLzmaHiWiFi
  1165. $(call PatchKernelLzma,$(1),$(2),$(3),$(4))
  1166. $(call MkuImageHiWiFi,lzma,$(5),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(KDIR_TMP)/vmlinux$(4)-$(1).uImage)
  1167. endef
  1168. Image/Build/HiWiFi/buildkernel=$(call MkuImageLzmaHiWiFi,$(2),$(3) $(4))
  1169. Image/Build/HiWiFi=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
  1170. Image/Build/HiWiFi/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  1171. Image/Build/PB4X/buildkernel=$(call PatchKernelLzma,$(2),$(3))
  1172. define Image/Build/PB4X
  1173. dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma \
  1174. of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync
  1175. dd if=$(KDIR)/root.$(1) \
  1176. of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync
  1177. -sh $(TOPDIR)/scripts/combined-image.sh \
  1178. "$(call imgname,kernel,$(2)).bin" \
  1179. "$(call imgname,$(1),$(2)-rootfs).bin" \
  1180. $(call sysupname,$(1),$(2))
  1181. endef
  1182. Image/Build/MyLoader/buildkernel=$(call PatchKernelLzma,$(2),$(3))
  1183. Image/Build/MyLoader/initramfs=$(call PatchKernel/initramfs,$(2),$(3))
  1184. define Image/Build/MyLoader
  1185. $(eval fwsize=$(shell echo $$(($(4)-0x30000-4*64*1024))))
  1186. $(eval fwimage=$(KDIR_TMP)/$(2)-$(5)-firmware.bin)
  1187. $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).bin.lzma,65536,$(KDIR)/root.$(1),$(fwsize),$(fwimage))
  1188. if [ -e "$(fwimage)" ]; then \
  1189. $(STAGING_DIR_HOST)/bin/mkmylofw -B $(2) -s $(4) -v \
  1190. -p0x00030000:0:al:0x80060000:firmware:$(fwimage) \
  1191. $(call imgname,$(1),$(2))-$(5)-factory.img; \
  1192. echo -n "" > $(KDIR_TMP)/empty.bin; \
  1193. sh $(TOPDIR)/scripts/combined-image.sh \
  1194. $(fwimage) $(KDIR_TMP)/empty.bin \
  1195. $(call imgname,$(1),$(2))-$(5)-sysupgrade.bin; \
  1196. fi
  1197. endef
  1198. Image/Build/UAPPRO/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(uap_pro_mtdlayout))
  1199. define Image/Build/UAPPRO/buildkernel
  1200. $(call MkuImageLzma,$(2),$(3) $(uap_pro_mtdlayout))
  1201. -rm -rf $(KDIR_TMP)/$(2)
  1202. mkdir -p $(KDIR_TMP)/$(2)/image
  1203. cp $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR_TMP)/$(2)/image/kernel0
  1204. $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
  1205. --pad --big-endian --squash-uids -v -e 64KiB \
  1206. -o $(KDIR_TMP)/$(2)-kernel.jffs2 \
  1207. -d $(KDIR_TMP)/$(2)/image \
  1208. 2>&1 1>/dev/null | awk '/^.+$$$$/'
  1209. -rm -rf $(KDIR_TMP)/$(2)
  1210. $(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR_TMP)/$(2)-kernel.jffs2 -J 64
  1211. endef
  1212. define Image/Build/UAPPRO
  1213. $(call CatFiles,$(KDIR_TMP)/$(2)-kernel.jffs2,1572864,$(KDIR)/root.$(1),14548992,$(call sysupname,$(1),$(2)))
  1214. -$(STAGING_DIR_HOST)/bin/mkfwimage2 -f 0x9f000000 \
  1215. -v $(5).$(6).v6.0.0-OpenWrt-$(REVISION) \
  1216. -p jffs2:0x50000:0xf60000:0:0:$(call sysupname,$(1),$(2)) \
  1217. -o $(call factoryname,$(1),$(2))
  1218. endef
  1219. # $(4) = board (XS2, XS5, RS, XM)
  1220. # $(5) = series (BZ, XM, XW)
  1221. # $(6) = chip (ar7240, ar934x)
  1222. define Image/Build/UBNT2
  1223. $(eval fwsize=$(call mtdpartsize,firmware,$(3)))
  1224. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
  1225. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  1226. dd if=$(call sysupname,$(1),$(2)) of=$(KDIR_TMP)/$(2)-mtdpart-kernel.bin bs=1024k count=1; \
  1227. dd if=$(call sysupname,$(1),$(2)) of=$(KDIR_TMP)/$(2)-mtdpart-rootfs.bin bs=1024k skip=1; \
  1228. $(STAGING_DIR_HOST)/bin/mkfwimage \
  1229. -B $(4) -v $(5).$(6).v6.0.0-OpenWrt-$(REVISION) \
  1230. -k $(KDIR_TMP)/$(2)-mtdpart-kernel.bin \
  1231. -r $(KDIR_TMP)/$(2)-mtdpart-rootfs.bin \
  1232. -o $(call factoryname,$(1),$(2)); \
  1233. fi
  1234. endef
  1235. Image/Build/UBNTXM/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(ubntxm_mtdlayout))
  1236. Image/Build/UBNTXM/buildkernel=$(call MkuImageLzma,$(2),$(3) $(ubntxm_mtdlayout))
  1237. Image/Build/UBNTXM=$(call Image/Build/UBNT2,$(1),$(2),$(ubntxm_mtdlayout),$(4),$(5),$(6),$(7))
  1238. Image/Build/UBDEV/buildkernel=$(call MkuImageLzma,$(2),$(3) $(ubdev_mtdlayout))
  1239. Image/Build/UBDEV=$(call Image/Build/UBNT2,$(1),$(2),$(ubdev_mtdlayout),$(4),$(5),$(6),$(7))
  1240. Image/Build/UBNT/buildkernel=$(call PatchKernelLzma,$(2),$(3))
  1241. define Image/Build/UBNT
  1242. dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma of=$(KDIR_TMP)/vmlinux-$(2).lzma bs=64k conv=sync
  1243. -$(STAGING_DIR_HOST)/bin/mkfwimage \
  1244. -B $(4) -v $(5).$(6).OpenWrt.$(REVISION) \
  1245. -k $(KDIR_TMP)/vmlinux-$(2).lzma \
  1246. -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
  1247. -o $(call factoryname,$(1),$(2))
  1248. -sh $(TOPDIR)/scripts/combined-image.sh \
  1249. "$(KDIR_TMP)/vmlinux-$(2).lzma" \
  1250. "$(BIN_DIR)/$(IMG_PREFIX)-root.$(1)" \
  1251. $(call sysupname,$(1),$(2))
  1252. endef
  1253. Image/Build/Planex/initramfs=$(call MkuImageGzip/initramfs,$(2),$(3) $(planex_mtdlayout))
  1254. Image/Build/Planex/loader=$(call Image/BuildLoaderAlone,$(1),gz,$(2) $(planex_mtdlayout),0x52000,0)
  1255. define Image/Build/Planex/buildkernel
  1256. [ -e "$(KDIR)/loader-$(2).gz" ]
  1257. $(call MkuImageOKLI,$(2))
  1258. ( \
  1259. dd if=$(KDIR)/loader-$(2).gz bs=8128 count=1 conv=sync; \
  1260. dd if=$(KDIR_TMP)/vmlinux-$(2).okli; \
  1261. ) > $(KDIR_TMP)/kernel-$(2).bin
  1262. $(call MkuImage,gzip,,$(KDIR_TMP)/kernel-$(2).bin,$(KDIR_TMP)/vmlinux-$(2).uImage)
  1263. endef
  1264. define Image/Build/Planex
  1265. $(eval fwsize=$(call mtdpartsize,firmware,$(planex_mtdlayout)))
  1266. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
  1267. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  1268. $(STAGING_DIR_HOST)/bin/mkplanexfw \
  1269. -B $(2) \
  1270. -v 2.00.00 \
  1271. -i $(call sysupname,$(1),$(2)) \
  1272. -o $(call factoryname,$(1),$(2)); \
  1273. fi
  1274. endef
  1275. Image/Build/ALFA/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  1276. Image/Build/ALFA/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  1277. define Image/Build/ALFA
  1278. $(call Sysupgrade/RKuImage,$(1),$(2),$(5),$(6))
  1279. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  1280. rm -rf $(KDIR)/$(1); \
  1281. mkdir -p $(KDIR)/$(1); \
  1282. cd $(KDIR)/$(1); \
  1283. cp $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR)/$(1)/$(7); \
  1284. cp $(KDIR)/root.$(1) $(KDIR)/$(1)/$(8); \
  1285. $(TAR) zcf $(call factoryname,$(1),$(2)) -C $(KDIR)/$(1) $(7) $(8); \
  1286. ( \
  1287. echo WRM7222C | dd bs=32 count=1 conv=sync; \
  1288. echo -ne '\xfe'; \
  1289. ) >> $(call factoryname,$(1),$(2)); \
  1290. fi
  1291. endef
  1292. Image/Build/Seama/loader=$(call Image/BuildLoader,$(1),bin,$(2) $(3),0x80060000)
  1293. define Image/Build/Seama
  1294. [ -e "$(KDIR)/loader-$(2).bin" ]
  1295. $(call CompressLzma,$(KDIR)/loader-$(2).bin,$(KDIR_TMP)/loader-$(2).bin.lzma)
  1296. -rm -f $(KDIR_TMP)/image-$(2).tmp
  1297. $(call CatFiles,$(KDIR_TMP)/loader-$(2).bin.lzma,$$$$(($(6) - 64)),$(KDIR)/root.$(1),$(7),$(KDIR_TMP)/image-$(2).tmp)
  1298. [ -e "$(KDIR_TMP)/image-$(2).tmp" ] && { \
  1299. head -c -4 "$(KDIR_TMP)/image-$(2).tmp" > "$(KDIR_TMP)/image-$(2).no-jffs2mark.tmp"; \
  1300. $(STAGING_DIR_HOST)/bin/seama \
  1301. -i $(KDIR_TMP)/image-$(2).no-jffs2mark.tmp \
  1302. -m "dev=/dev/mtdblock/1" -m "type=firmware"; \
  1303. $(STAGING_DIR_HOST)/bin/seama \
  1304. -s $(call imgname,$(1),$(2))-factory.bin \
  1305. -m "signature=$(5)" \
  1306. -i $(KDIR_TMP)/image-$(2).no-jffs2mark.tmp.seama; \
  1307. tail -c 4 "$(KDIR_TMP)/image-$(2).tmp" >> $(call imgname,$(1),$(2))-factory.bin; \
  1308. }
  1309. cat $(KDIR_TMP)/loader-$(2).bin.lzma > $(KDIR_TMP)/image-$(2)-sysupgrade.tmp
  1310. $(STAGING_DIR_HOST)/bin/seama \
  1311. -i $(KDIR_TMP)/image-$(2)-sysupgrade.tmp \
  1312. -m "dev=/dev/mtdblock/1" -m "type=firmware"
  1313. $(call CatFiles,$(KDIR_TMP)/image-$(2)-sysupgrade.tmp.seama,$(6),$(KDIR)/root.$(1),$(7),$(call sysupname,$(1),$(2)))
  1314. endef
  1315. define Image/Build/Seama/initramfs
  1316. $(call PatchKernelLzma,$(2),$(3) $(4),,-initramfs)
  1317. $(STAGING_DIR_HOST)/bin/seama \
  1318. -i $(KDIR_TMP)/vmlinux-initramfs-$(2).bin.lzma \
  1319. -m "dev=/dev/mtdblock/1" -m "type=firmware"
  1320. cat $(KDIR_TMP)/vmlinux-initramfs-$(2).bin.lzma.seama > $(call imgname,initramfs,$(2))-seama.bin
  1321. endef
  1322. Image/Build/Senao/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  1323. Image/Build/Senao/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  1324. define Image/Build/Senao
  1325. mkdir -p $(KDIR_TMP)/$(2)/
  1326. touch $(KDIR_TMP)/$(2)/FWINFO-OpenWrt-$(REVISION)-$(2)
  1327. -$(CP) ./$(2)/* $(KDIR_TMP)/$(2)/
  1328. dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
  1329. of=$(KDIR_TMP)/$(2)/openwrt-senao-$(2)-uImage-lzma.bin bs=64k conv=sync
  1330. dd if=$(KDIR)/root.$(1) \
  1331. of=$(KDIR_TMP)/$(2)/openwrt-senao-$(2)-root.$(1) bs=64k conv=sync
  1332. ( \
  1333. cd $(KDIR_TMP)/$(2)/; \
  1334. $(TAR) -cz -f $(call factoryname,$(1),$(2)) * \
  1335. )
  1336. -rm -rf $(KDIR_TMP)/$(2)/
  1337. -sh $(TOPDIR)/scripts/combined-image.sh \
  1338. $(KDIR_TMP)/vmlinux-$(2).uImage \
  1339. $(KDIR)/root.$(1) \
  1340. $(call sysupname,$(1),$(2))
  1341. endef
  1342. Image/Build/TPLINKOLD/loader=$(call Image/BuildLoaderAlone,$(1),gz,$(2),0x22000,0)
  1343. define Image/Build/TPLINKOLD
  1344. [ -e "$(KDIR)/loader-$(2).gz" ]
  1345. $(call MkuImageOKLI,$(2))
  1346. ( \
  1347. dd if=$(KDIR)/loader-$(2).gz bs=7680 count=1 conv=sync; \
  1348. dd if=$(KDIR_TMP)/vmlinux-$(2).okli conv=sync; \
  1349. ) > $(KDIR_TMP)/kernel-$(2).bin
  1350. -$(STAGING_DIR_HOST)/bin/mktplinkfw \
  1351. -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION)\
  1352. -X 0x40000 \
  1353. -k $(KDIR_TMP)/kernel-$(2).bin \
  1354. -r $(KDIR)/root.$(1) \
  1355. -o $(call factoryname,$(1),$(2))
  1356. -$(STAGING_DIR_HOST)/bin/mktplinkfw \
  1357. -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s\
  1358. -X 0x40000 \
  1359. -k $(KDIR_TMP)/kernel-$(2).bin \
  1360. -r $(KDIR)/root.$(1) \
  1361. -o $(call sysupname,$(1),$(2))
  1362. endef
  1363. define Image/Build/TPLINKOLD/initramfs
  1364. $(call Image/BuildLoader,$(2),gz,$(3),0x80060000,-initramfs)
  1365. -$(STAGING_DIR_HOST)/bin/mktplinkfw -c \
  1366. -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s\
  1367. -k $(KDIR)/loader-$(2)-initramfs.gz \
  1368. -o $(call imgname,$(1),$(2))-initramfs-uImage.bin
  1369. endef
  1370. Image/Build/TPLINK/loader=$(call Image/BuildLoaderAlone,$(1),gz,$(2),0x22000,0)
  1371. define Image/Build/TPLINK
  1372. [ -e "$(KDIR)/loader-$(2).gz" ]
  1373. $(call MkuImageOKLI,$(2))
  1374. ( \
  1375. dd if=$(KDIR)/loader-$(2).gz bs=7680 count=1 conv=sync; \
  1376. dd if=$(KDIR_TMP)/vmlinux-$(2).okli conv=sync; \
  1377. ) > $(KDIR_TMP)/kernel-$(2).bin
  1378. -$(STAGING_DIR_HOST)/bin/mktplinkfw \
  1379. -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION)\
  1380. -X 0x40000 \
  1381. -k $(KDIR_TMP)/kernel-$(2).bin \
  1382. -r $(KDIR)/root.$(1) \
  1383. -a $(call rootfs_align,$(1)) -j \
  1384. -o $(call factoryname,$(1),$(2))
  1385. -$(STAGING_DIR_HOST)/bin/mktplinkfw \
  1386. -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s\
  1387. -X 0x40000 \
  1388. -k $(KDIR_TMP)/kernel-$(2).bin \
  1389. -r $(KDIR)/root.$(1) \
  1390. -a $(call rootfs_align,$(1)) -j \
  1391. -o $(call sysupname,$(1),$(2))
  1392. endef
  1393. define Image/Build/TPLINK/initramfs
  1394. $(call Image/BuildLoader,$(2),gz,$(3),0x80060000,-initramfs)
  1395. -$(STAGING_DIR_HOST)/bin/mktplinkfw -c \
  1396. -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s\
  1397. -k $(KDIR)/loader-$(2)-initramfs.gz \
  1398. -o $(call imgname,$(1),$(2))-uImage.bin
  1399. endef
  1400. Image/Build/TPLINK-LZMA/buildkernel=$(call PatchKernelLzma,$(2),$(3))
  1401. define Image/Build/TPLINK-LZMA
  1402. -$(STAGING_DIR_HOST)/bin/mktplinkfw \
  1403. -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) \
  1404. -X 0x40000 \
  1405. -k $(KDIR_TMP)/vmlinux-$(2).bin.lzma \
  1406. -r $(KDIR)/root.$(1) \
  1407. -a $(call rootfs_align,$(1)) -j \
  1408. -o $(call factoryname,$(1),$(2))
  1409. -$(STAGING_DIR_HOST)/bin/mktplinkfw \
  1410. -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) -s \
  1411. -X 0x40000 \
  1412. -k $(KDIR_TMP)/vmlinux-$(2).bin.lzma \
  1413. -r $(KDIR)/root.$(1) \
  1414. -a $(call rootfs_align,$(1)) -j \
  1415. -o $(call sysupname,$(1),$(2))
  1416. endef
  1417. define Image/Build/TPLINK-LZMA/initramfs
  1418. $(call PatchKernelLzma,$(2),$(3),,-initramfs)
  1419. -$(STAGING_DIR_HOST)/bin/mktplinkfw -c \
  1420. -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) -s \
  1421. -k $(KDIR_TMP)/vmlinux-initramfs-$(2).bin.lzma \
  1422. -o $(call imgname,$(1),$(2))-uImage.bin
  1423. endef
  1424. Image/Build/TPLINK-SAFELOADER/loader = $(call Image/BuildLoaderPatched,$(1),elf,$(2) $(3))
  1425. define Image/Build/TPLINK-SAFELOADER
  1426. [ -e "$(KDIR)/loader-$(2).elf" ]
  1427. -$(STAGING_DIR_HOST)/bin/tplink-safeloader \
  1428. -B $(5) \
  1429. -k $(KDIR)/loader-$(2).elf \
  1430. -r $(KDIR)/root.$(1) \
  1431. -V $(REVISION) \
  1432. -j \
  1433. -o $(call factoryname,$(1),$(2))
  1434. -$(STAGING_DIR_HOST)/bin/tplink-safeloader \
  1435. -B $(5) \
  1436. -k $(KDIR)/loader-$(2).elf \
  1437. -r $(KDIR)/root.$(1) \
  1438. -V $(REVISION) \
  1439. -j -S \
  1440. -o $(call sysupname,$(1),$(2))
  1441. endef
  1442. define Image/Build/CyberTAN
  1443. echo -n '' > $(KDIR_TMP)/empty.bin
  1444. $(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/image.tmp \
  1445. -f $(KDIR_TMP)/vmlinux-$(2).uImage -F $(KDIR_TMP)/empty.bin \
  1446. -x 32 -a 0x10000 -x -32 -f $(KDIR)/root.$(1)
  1447. -$(STAGING_DIR_HOST)/bin/addpattern -B $(2) -v v$(5) \
  1448. -i $(KDIR)/image.tmp \
  1449. -o $(call sysupname,$(1),$(2))
  1450. $(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/image.tmp -f $(KDIR_TMP)/vmlinux-$(2).uImage \
  1451. -x 32 -a 0x10000 -x -32 -f $(KDIR)/root.$(1)
  1452. -$(STAGING_DIR_HOST)/bin/addpattern -B $(2) -v v$(5) -g \
  1453. -i $(KDIR)/image.tmp \
  1454. -o $(call factoryname,$(1),$(2))
  1455. rm $(KDIR)/image.tmp
  1456. endef
  1457. Image/Build/CyberTANGZIP/loader=$(call Image/BuildLoader,$(1),gz,$(2),0x80060000)
  1458. Image/Build/CyberTANGZIP/buildkernel=$(call MkuImage,gzip,,$(KDIR)/loader-$(2).gz,$(KDIR_TMP)/vmlinux-$(2).uImage)
  1459. Image/Build/CyberTANGZIP=$(call Image/Build/CyberTAN,$(1),$(2),$(3),$(4),$(5))
  1460. Image/Build/CyberTANLZMA/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  1461. Image/Build/CyberTANLZMA=$(call Image/Build/CyberTAN,$(1),$(2),$(3),$(4),$(5))
  1462. Image/Build/Netgear/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
  1463. define Image/Build/Netgear/buildkernel
  1464. $(call MkuImageLzma,$(2),$(3) $(4),-d20,,-M $(5))
  1465. -rm -rf $(KDIR_TMP)/$(2)
  1466. mkdir -p $(KDIR_TMP)/$(2)/image
  1467. cat $(KDIR_TMP)/vmlinux-$(2).uImage > $(KDIR_TMP)/$(2)/image/uImage
  1468. $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
  1469. $(KDIR_TMP)/$(2) $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp1 \
  1470. -noappend -root-owned -be -b 65536
  1471. ( \
  1472. cat $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp1; \
  1473. dd if=/dev/zero bs=1k count=1 \
  1474. ) > $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp2
  1475. mkimage -A mips -O linux -T filesystem -C none -M $(5) \
  1476. -a 0xbf070000 -e 0xbf070000 \
  1477. -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
  1478. -d $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp2 \
  1479. $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs
  1480. endef
  1481. define Image/Build/Netgear
  1482. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  1483. $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage.squashfs,0,$(KDIR)/root.$(1),$(fwsize),$(call sysupname,$(1),$(2)),64)
  1484. if [ -e $(call sysupname,$(1),$(2)) ]; then \
  1485. for r in $(7) ; do \
  1486. [ -n "$$$$r" ] && dashr="-$$$$r" || dashr= ; \
  1487. $(STAGING_DIR_HOST)/bin/mkdniimg \
  1488. -B $(6) -v OpenWrt.$(REVISION) -r "$$$$r" $(8) \
  1489. -i $(call sysupname,$(1),$(2)) \
  1490. -o $(call imgname,$(1),$(2))-factory$$$$dashr.img; \
  1491. done; \
  1492. fi
  1493. endef
  1494. Image/Build/NetgearLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
  1495. Image/Build/NetgearLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4),-d20,,-M $(5))
  1496. define Image/Build/NetgearLzma
  1497. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  1498. $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage,0,$(KDIR)/root.$(1),$(fwsize),$(call sysupname,$(1),$(2)),64)
  1499. endef
  1500. Image/Build/NetgearNAND/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
  1501. # $(1): (empty)
  1502. # $(2): Board name (small caps)
  1503. # $(3): Kernel board specific cmdline
  1504. # $(4): Kernel mtdparts definition
  1505. # $(5): U-Boot magic
  1506. define Image/Build/NetgearNAND/buildkernel
  1507. $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
  1508. $(call PatchKernelLzma,$(2),$(3) $(4),-d20)
  1509. dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma \
  1510. of=$(KDIR_TMP)/vmlinux-$(2).bin.tmp \
  1511. bs=$$$$(($(kernelsize)-131072-2*64-1)) \
  1512. count=1 conv=sync
  1513. $(call MkuImage,lzma,-M $(5),$(KDIR_TMP)/vmlinux-$(2).bin.tmp,$(KDIR_TMP)/vmlinux-$(2).uImage)
  1514. echo -ne '\xff' >> $(KDIR_TMP)/vmlinux-$(2).uImage
  1515. # create a fake rootfs image
  1516. dd if=/dev/zero of=$(KDIR_TMP)/fakeroot-$(2) bs=131072 count=1
  1517. mkimage -A mips -O linux -T filesystem -C none \
  1518. -a 0xbf070000 -e 0xbf070000 \
  1519. -n 'MIPS OpenWrt fakeroot' \
  1520. -d $(KDIR_TMP)/fakeroot-$(2) \
  1521. -M $(5) \
  1522. $(KDIR_TMP)/fakeroot-$(2).uImage
  1523. # append the fake rootfs image to the kernel, it will reside in the last
  1524. # erase block of the kernel partition
  1525. cat $(KDIR_TMP)/fakeroot-$(2).uImage >> $(KDIR_TMP)/vmlinux-$(2).uImage
  1526. endef
  1527. # $(1): rootfs image suffix
  1528. # $(2): Board name (small caps)
  1529. # $(3): Kernel board specific cmdline
  1530. # $(4): Kernel mtdparts definition
  1531. # $(5): U-Boot magic
  1532. # $(6): Board name (upper caps)
  1533. # $(7): firmware region code (not used yet)
  1534. # $(8): DNI Hardware version
  1535. # $(9): suffix of the configuration file for ubinize
  1536. define Image/Build/NetgearNAND
  1537. $(eval firmwaresize=$(call mtdpartsize,firmware,$(4)))
  1538. $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
  1539. $(eval imageraw=$(KDIR_TMP)/$(2)-raw.img)
  1540. $(CP) $(KDIR)/root.squashfs-raw $(KDIR_TMP)/root.squashfs
  1541. echo -ne '\xde\xad\xc0\xde' > $(KDIR_TMP)/jffs2.eof
  1542. $(call ubinize,ubinize-$(9).ini,$(KDIR_TMP),$(KDIR_TMP)/$(2)-root.ubi,128KiB,2048,-E 5)
  1543. ( \
  1544. dd if=$(KDIR_TMP)/vmlinux-$(2).uImage; \
  1545. dd if=$(KDIR_TMP)/$(2)-root.ubi \
  1546. ) > $(imageraw)
  1547. $(STAGING_DIR_HOST)/bin/mkdniimg \
  1548. -B $(6) -v OpenWrt.$(REVISION) -r "$$$$r" $(8) \
  1549. -i $(imageraw) \
  1550. -o $(call imgname,ubi,$(2))-factory.img
  1551. $(call Image/Build/SysupgradeNAND,$(2),squashfs,$(KDIR_TMP)/vmlinux-$(2).uImage)
  1552. endef
  1553. ifdef CONFIG_PACKAGE_uboot-ar71xx-nbg460n_550n_550nh
  1554. Image/Build/ZyXEL/buildkernel=$(call MkuImageLzma,$(2),$(3))
  1555. define Image/Build/ZyXEL
  1556. $(call Sysupgrade/KRuImage,$(1),$(2),917504,2752512)
  1557. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  1558. if [ ! -f $(BIN_DIR)/$(IMG_PREFIX)-$(2)-u-boot.bin ]; then \
  1559. echo "Warning: $(IMG_PREFIX)-$(2)-u-boot.bin not found" >&2; \
  1560. else \
  1561. $(STAGING_DIR_HOST)/bin/mkzynfw \
  1562. -B $(4) \
  1563. -b $(BIN_DIR)/$(IMG_PREFIX)-$(2)-u-boot.bin \
  1564. -r $(call sysupname,$(1),$(2)):0x10000 \
  1565. -o $(call factoryname,$(1),$(2)); \
  1566. fi; fi
  1567. endef
  1568. endif
  1569. define Image/Build/ZyXELNAND/buildkernel
  1570. $(eval kernelsize=$(call mtdpartsize,kernel,$(5)))
  1571. $(call MkuImageLzma,$(2),$(3) $(5) $(6))
  1572. mkdir -p $(KDIR_TMP)/$(2)/image/boot
  1573. cp $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR_TMP)/$(2)/image/boot/vmlinux.lzma.uImage
  1574. $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
  1575. --pad=$(kernelsize) --big-endian --squash-uids -v -e 128KiB \
  1576. -o $(KDIR_TMP)/$(2)-kernel.jffs2 \
  1577. -d $(KDIR_TMP)/$(2)/image \
  1578. 2>&1 1>/dev/null | awk '/^.+$$$$/'
  1579. -rm -rf $(KDIR_TMP)/$(2)
  1580. endef
  1581. define Image/Build/ZyXELNAND
  1582. if [ "$(1)" != "squashfs" ]; then \
  1583. echo Only squashfs is supported; \
  1584. return 0; \
  1585. fi
  1586. $(eval firmwaresize=$(call mtdpartsize,firmware,$(4)))
  1587. $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
  1588. $(eval imageraw=$(KDIR_TMP)/$(2)-raw.img)
  1589. $(CP) $(KDIR)/root.$(1) $(KDIR_TMP)/ubi_root.img
  1590. $(call ubinize,ubinize-$(2).ini,$(KDIR_TMP),$(KDIR_TMP)/$(2)-root.ubi,128KiB,2048,-E 5)
  1591. ( \
  1592. dd if=$(KDIR_TMP)/$(2)-kernel.jffs2; \
  1593. dd if=$(KDIR_TMP)/$(2)-root.ubi \
  1594. ) > $(imageraw)
  1595. dd if=$(imageraw) of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory.bin \
  1596. bs=128k conv=sync
  1597. $(call Image/Build/SysupgradeNAND,$(2),squashfs,$(KDIR_TMP)/$(2)-kernel.jffs2)
  1598. endef
  1599. Image/Build/OpenMesh/buildkernel=$(call MkuImageLzma,$(2))
  1600. define Image/Build/OpenMesh
  1601. -sh $(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \
  1602. "$(4)" \
  1603. "$(BUILD_DIR)/fwupgrade.cfg-$(4)" \
  1604. "$(KDIR_TMP)/vmlinux-$(2).uImage" \
  1605. "$(KDIR)/root.$(1)"
  1606. -sh $(TOPDIR)/scripts/combined-ext-image.sh \
  1607. "$(4)" "$(call factoryname,$(1),$(2))" \
  1608. "$(BUILD_DIR)/fwupgrade.cfg-$(4)" "fwupgrade.cfg" \
  1609. "$(KDIR_TMP)/vmlinux-$(2).uImage" "kernel" \
  1610. "$(KDIR)/root.$(1)" "rootfs"
  1611. if [ -e "$(call factoryname,$(1),$(2))" ]; then \
  1612. cp "$(call factoryname,$(1),$(2))" "$(call sysupname,$(1),$(2))"; \
  1613. fi
  1614. endef
  1615. Image/Build/Zcomax/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  1616. Image/Build/Zcomax/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  1617. define Image/Build/Zcomax
  1618. $(call Sysupgrade/RKuImage,$(1),$(2),1507328,6356992)
  1619. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  1620. $(STAGING_DIR_HOST)/bin/mkzcfw \
  1621. -B $(2) \
  1622. -k $(KDIR_TMP)/vmlinux-$(2).uImage \
  1623. -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
  1624. -o $(call imgname,$(1),$(2))-factory.img; \
  1625. fi
  1626. endef
  1627. # $(1): template name to be defined, etc. squashfs-only, 64k, 64kraw, etc.
  1628. # $(2): jffs2 blocksize.
  1629. define Jffs2Template
  1630. define Image/Build/Template/$(1)/jffs2-$(2)
  1631. $$(call Image/Build/$$(1),jffs2-$(2),$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
  1632. endef
  1633. endef
  1634. # $(1): template name to be defined.
  1635. # $(2): squashfs suffix to be used.
  1636. # $(3): jffs2 suffix to be used.
  1637. define BuildTemplate
  1638. # $(1) : name of build method.
  1639. # $(2) : board name.
  1640. # $(3) : kernel command line.
  1641. # $(4)~$(8): extra arguments.
  1642. define Image/Build/Template/$(1)/initramfs
  1643. $$(call Image/Build/$$(1)/initramfs,initramfs,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
  1644. endef
  1645. define Image/Build/Template/$(1)/loader
  1646. $$(call Image/Build/$$(1)/loader,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
  1647. endef
  1648. define Image/Build/Template/$(1)/buildkernel
  1649. $$(call Image/Build/$$(1)/buildkernel,,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
  1650. endef
  1651. define Image/Build/Template/$(1)/squashfs
  1652. $$(call Image/Build/$$(1),squashfs$(2),$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
  1653. endef
  1654. $(if $(3),$(foreach bs,$(3),$(eval $(call Jffs2Template,$(1),$(bs)))))
  1655. endef
  1656. $(eval $(call BuildTemplate,squashfs-only))
  1657. $(eval $(call BuildTemplate,64k,-64k,64k))
  1658. $(eval $(call BuildTemplate,64kraw,-raw,64k))
  1659. $(eval $(call BuildTemplate,64kraw-nojffs,-raw))
  1660. $(eval $(call BuildTemplate,128k,,128k))
  1661. $(eval $(call BuildTemplate,128kraw,-raw,128k))
  1662. $(eval $(call BuildTemplate,256k,,256k))
  1663. $(eval $(call BuildTemplate,all,,64k 128k 256k))
  1664. ifeq ($(SUBTARGET),generic)
  1665. $(eval $(call SingleProfile,ALFA,64k,ALFANX,alfa-nx,ALFA-NX,ttyS0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,vmlinux.gz.uImage,pb9x-2.6.31-jffs2))
  1666. $(eval $(call SingleProfile,ALFA,64k,HORNETUB,hornet-ub,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,kernel_image,rootfs_image))
  1667. $(eval $(call SingleProfile,ALFA,64k,TUBE2H8M,tube2h-8M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,kernel.image,rootfs.image))
  1668. $(eval $(call SingleProfile,AthGzip,64k,AP81,ap81,AP81,ttyS0,115200,$$(ap81_mtdlayout),RKuImage))
  1669. $(eval $(call SingleProfile,AthGzip,64k,AP83,ap83,AP83,ttyS0,115200,$$(ap83_mtdlayout),RKuImage))
  1670. $(eval $(call SingleProfile,AthGzip,64k,AP96,ap96,AP96,ttyS0,115200,$$(ap96_mtdlayout),RKuImage))
  1671. $(eval $(call SingleProfile,AthGzip,64k,WNDAP360,wndap360,WNDAP360,ttyS0,9600,$$(wndap360_mtdlayout),KRuImage))
  1672. $(eval $(call SingleProfile,AthLzma,64k,ALFAAP96,alfa-ap96,ALFA-AP96,ttyS0,115200,$$(alfa_ap96_mtdlayout),RKuImage))
  1673. $(eval $(call SingleProfile,AthLzma,64k,ALFAAP120C,alfa-ap120c,ALFA-AP120C,ttyS0,115200,$$(alfa_ap120c_mtdlayout),RKuImage))
  1674. $(eval $(call SingleProfile,AthLzma,64k,ALL0258N,all0258n,ALL0258N,ttyS0,115200,$$(all0258n_mtdlayout),KRuImage,65536))
  1675. $(eval $(call SingleProfile,AthLzma,256k,ALL0315N,all0315n,ALL0315N,ttyS0,115200,$$(all0315n_mtdlayout),KRuImage,262144))
  1676. $(eval $(call SingleProfile,AthLzma,64k,AP113,ap113,AP113,ttyS0,115200,$$(ap113_mtd_layout),RK))
  1677. $(eval $(call SingleProfile,AthLzma,64k,AP121_2M,ap121-2M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_2M),RKuImage))
  1678. $(eval $(call SingleProfile,AthLzma,64k,AP121_4M,ap121-4M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_4M),RKuImage))
  1679. $(eval $(call SingleProfile,AthLzma,64k,AP121MINI,ap121-mini,AP121-MINI,ttyATH0,115200,$$(ap121_mtdlayout_4M),RKuImage))
  1680. $(eval $(call SingleProfile,AthLzma,64k,AP132,ap132,AP132,ttyS0,115200,$$(ap132_mtdlayout),KRuImage))
  1681. $(eval $(call SingleProfile,AthLzma,64k,AP135,ap135-020,AP135-020,ttyS0,115200,$$(ap135_mtdlayout),RKuImage))
  1682. $(eval $(call SingleProfile,AthLzma,64k,AP136_010,ap136-010,AP136-010,ttyS0,115200,$$(ap136_mtdlayout),RKuImage))
  1683. $(eval $(call SingleProfile,AthLzma,64k,AP136_020,ap136-020,AP136-020,ttyS0,115200,$$(ap136_mtdlayout),RKuImage))
  1684. $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
  1685. $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
  1686. $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
  1687. $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
  1688. $(eval $(call SingleProfile,AthLzma,64k,DW33D,domywifi-dw33d,DW33D,ttyS0,115200,$$(dw33d_mtdlayout) mem=256M,RKuImage))
  1689. $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
  1690. $(eval $(call SingleProfile,AthLzma,64k,EWDORINRT,ew-dorin-router,EW-DORIN-ROUTER,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
  1691. $(eval $(call SingleProfile,AthLzma,64k,EWDORIN16M,ew-dorin-16M,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_16M),KRuImage,65536))
  1692. $(eval $(call SingleProfile,AthLzma,64k,HORNETUBx2,hornet-ub-x2,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
  1693. $(eval $(call SingleProfile,AthLzma,64k,MR12,mr12,MR12,ttyS0,115200,$$(mr12_mtdlayout),RKuImage))
  1694. $(eval $(call SingleProfile,AthLzma,64k,MR16,mr16,MR16,ttyS0,115200,$$(mr16_mtdlayout),RKuImage))
  1695. $(eval $(call SingleProfile,AthLzma,64k,PB92,pb92,PB92,ttyS0,115200,$$(pb92_mtdlayout),KRuImage))
  1696. $(eval $(call SingleProfile,AthLzma,64k,TUBE2H16M,tube2h-16M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
  1697. $(eval $(call SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$(wlr8100_mtdlayout),KRuImage))
  1698. $(eval $(call SingleProfile,AthLzma,64k,WPJ344_16M,wpj344-16M,WPJ344,ttyS0,115200,$$(wpj344_mtdlayout_16M),KRuImage,65536))
  1699. $(eval $(call SingleProfile,AthLzma,64k,WPJ531_16M,wpj531-16M,WPJ531,ttyS0,115200,$$(wpj531_mtdlayout_16M),KRuImage,65536))
  1700. $(eval $(call SingleProfile,AthLzma,64k,WPJ558_16M,wpj558-16M,WPJ558,ttyS0,115200,$$(wpj558_mtdlayout_16M),KRuImage,65536))
  1701. $(eval $(call SingleProfile,Belkin,64k,F9K1115V2,f9k1115v2,F9K1115V2,ttyS0,115200,$$(f9k1115v2_mtdlayout),BR-6679BAC))
  1702. $(eval $(call SingleProfile,CameoAP91,64kraw,DIR600A1,dir-600-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-00"))
  1703. $(eval $(call SingleProfile,CameoAP91,64kraw,DIR601A1,dir-601-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-02"))
  1704. $(eval $(call SingleProfile,CameoAP91,64kraw,FR54RTR,fr-54rtr,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-01"))
  1705. $(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E1,dir-615-e1,DIR-615-E1,ttyS0,115200,"AP93-AR7240-RT-081028-00"))
  1706. $(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E4,dir-615-e4,DIR-615-E4,ttyS0,115200,"AP99-AR7240-RT-091105-05"))
  1707. $(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I1,dir-615-i1,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-1012I1-00"))
  1708. $(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I3,dir-615-i3,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-101214-00"))
  1709. $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,A02RBW300N,a02-rb-w300n,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-03"))
  1710. $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,DIR615C1,dir-615-c1,DIR-615-C1,ttyS0,115200,"AP81-AR9130-RT-070614-02"))
  1711. $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW632BRP,tew-632brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-00"))
  1712. $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_FW,tew-652brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-080609-05"))
  1713. $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_RECOVERY,tew-652brp-recovery,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-02"))
  1714. $(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,TEW712BR,tew-712br,TEW-712BR,ttyATH0,115200,"HORNET-RT-TEW712BR-3",1.99,""))
  1715. $(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,DIR601B1,dir-601-b1,TEW-712BR,ttyATH0,115200,"HORNET-RT-DIR601B1-3",2.99.99,"" "NA"))
  1716. $(eval $(call SingleProfile,CameoAP121_8M,64kraw-nojffs,DIR505A1,dir-505-a1,DIR-505-A1,ttyATH0,115200,"HORNET-PACKET-DIR505A1-3",1.99.99,""))
  1717. $(eval $(call SingleProfile,CameoAP135,64kraw,DGL5500A1,dgl-5500-a1,DGL-5500-A1,ttyS0,115200,$$(dgl_5500_mtdlayout),"00AP135AR9558-RT-130508-00"))
  1718. $(eval $(call SingleProfile,CameoDB120,64kraw,DHP1565A1,dhp-1565-a1,DHP-1565-A1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
  1719. $(eval $(call SingleProfile,CameoDB120,64kraw,DIR825C1,dir-825-c1,DIR-825-C1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
  1720. $(eval $(call SingleProfile,CameoDB120,64kraw,DIR835A1,dir-835-a1,DIR-835-A1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
  1721. $(eval $(call SingleProfile,CameoDB120_8M,64kraw,TEW732BR,tew-732br,TEW-732BR,ttyS0,115200,"00DB120AR9341-RT-120906-NA"))
  1722. $(eval $(call SingleProfile,CyberTANGZIP,64k,WRT160NL,wrt160nl,WRT160NL,ttyS0,115200,,1.00.01))
  1723. $(eval $(call SingleProfile,CyberTANGZIP,64k,E2100L,e2100l,E2100L,ttyS0,115200,,1.00.01))
  1724. $(eval $(call SingleProfile,CyberTANLZMA,64k,MYNETREXT,mynet-rext,MYNET-REXT,ttyS0,115200,$$(mynet_rext_mtdlayout) root=31:2,1.00.01))
  1725. $(eval $(call SingleProfile,CameoAP94,64kraw,DIR825B1,dir-825-b1,DIR-825-B1,ttyS0,115200,$$(cameo_ap94_mtdlayout),$$(cameo_ap94_mtdlayout_fat),01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
  1726. $(eval $(call SingleProfile,CameoAP94,64kraw,TEW673GRU,tew-673gru,TEW-673GRU,ttyS0,115200,$$(cameo_ap94_mtdlayout),$$(cameo_ap94_mtdlayout_fat),01AP94-AR7161-RT-080619-01,00AP94-AR7161-RT-080619-01))
  1727. $(eval $(call SingleProfile,CameoAP94,64kraw,DLRTDEV01,dlrtdev01,DIR-825-B1,ttyS0,115200,$$(dlrtdev_mtdlayout),$$(dlrtdev_mtdlayout_fat),01AP94-AR7161-RT-080619-00,00AP94-AR7161-RT-080619-00))
  1728. $(eval $(call SingleProfile,dLANLzma,64k,dLAN_pro_500_wp,dlan-pro-500-wp,dLAN-pro-500-wp,ttyS0,115200,$$(dlan_pro_500_wp_mtdlayout) mem=128M,KRuImage,64k))
  1729. $(eval $(call SingleProfile,dLANLzma,64k,dLAN_pro_1200_ac,dlan-pro-1200-ac,dLAN-pro-1200-ac,ttyS0,115200,$$(dlan_pro_1200_ac_mtdlayout) mem=128M,KRuImage,64k))
  1730. $(eval $(call SingleProfile,EnGenius,64k,ESR900,esr900,ESR900,ttyS0,115200,$$(esr900_mtdlayout),KRuImage,,0x4e))
  1731. $(eval $(call SingleProfile,EnGenius,64k,ESR1750,esr1750,ESR1750,ttyS0,115200,$$(esr1750_mtdlayout),KRuImage,,0x61))
  1732. $(eval $(call SingleProfile,EnGenius,64k,EPG5000,epg5000,EPG5000,ttyS0,115200,$$(epg5000_mtdlayout),KRuImage,,0x71))
  1733. $(eval $(call SingleProfile,HiWiFi,64k,HIWIFI_HC6361,hiwifi-hc6361,HiWiFi-HC6361,ttyATH0,115200,$$(hiwifi_hc6361_mtdlayout),KRuImage))
  1734. $(eval $(call SingleProfile,MyLoader,64k,WP543_2M,wp543,,ttyS0,115200,0x200000,2M))
  1735. $(eval $(call SingleProfile,MyLoader,64k,WP543_4M,wp543,,ttyS0,115200,0x400000,4M))
  1736. $(eval $(call SingleProfile,MyLoader,64k,WP543_8M,wp543,,ttyS0,115200,0x800000,8M))
  1737. $(eval $(call SingleProfile,MyLoader,64k,WP543_16M,wp543,,ttyS0,115200,0x1000000,16M))
  1738. $(eval $(call SingleProfile,MyLoader,64k,WPE72_4M,wpe72,,ttyS0,115200,0x400000,4M))
  1739. $(eval $(call SingleProfile,MyLoader,64k,WPE72_8M,wpe72,,ttyS0,115200,0x800000,8M))
  1740. $(eval $(call SingleProfile,MyLoader,64k,WPE72_16M,wpe72,,ttyS0,115200,0x1000000,16M))
  1741. $(eval $(call SingleProfile,Netgear,64kraw,WNR2000V3,wnr2000v3,WNR2000V3,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303033,WNR2000V3,"" NA,-H 29763551+04+32))
  1742. $(eval $(call SingleProfile,NetgearLzma,64kraw,WNR2000V4,wnr2000v4,WNR2000V4,ttyS0,115200,$$(wnr2000v4_mtdlayout),0x32303034,WNR2000V4,"" NA,))
  1743. $(eval $(call SingleProfile,Netgear,64kraw,WNR2200,wnr2200,WNR2200,ttyS0,115200,$$(wnr2200_mtdlayout),0x32323030,wnr2200,"" NA,))
  1744. $(eval $(call SingleProfile,Netgear,64kraw,REALWNR612V2,wnr612v2,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,WNR612V2,"",))
  1745. $(eval $(call SingleProfile,Netgear,64kraw,N150R,n150r,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,N150R,"",))
  1746. $(eval $(call SingleProfile,Netgear,64kraw,REALWNR1000V2,wnr1000v2,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303031,WNR1000V2,"",))
  1747. $(eval $(call SingleProfile,Netgear,64kraw,WNR1000V2_VC,wnr1000v2-vc,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303030,WNR1000V2-VC,"",))
  1748. $(eval $(call SingleProfile,Netgear,64kraw,WPN824N,wpn824n,WPN824N,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31313030,WPN824N,"" NA,))
  1749. $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2p,,,,OM2P))
  1750. $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5P,om5p,,,,OM5P))
  1751. $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5PAC,om5pac,,,,OM5PAC))
  1752. $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR600,mr600,,,,MR600))
  1753. $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR900,mr900,,,,MR900))
  1754. $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR1750,mr1750,,,,MR1750))
  1755. $(eval $(call SingleProfile,PB4X,128k,ALL0305,all0305,ALL0305,ttyS0,115200))
  1756. $(eval $(call SingleProfile,PB4X,128k,EAP7660D,eap7660d,EAP7660D,ttyS0,115200))
  1757. $(eval $(call SingleProfile,PB4X,64k,JA76PF,ja76pf,JA76PF,ttyS0,115200))
  1758. $(eval $(call SingleProfile,PB4X,64k,JA76PF2,ja76pf2,JA76PF2,ttyS0,115200))
  1759. $(eval $(call SingleProfile,PB4X,64k,JWAP003,jwap003,JWAP003,ttyS0,115200))
  1760. $(eval $(call SingleProfile,PB4X,64k,PB42,pb42,PB42,ttyS0,115200))
  1761. $(eval $(call SingleProfile,PB4X,64k,PB44,pb44,PB44,ttyS0,115200))
  1762. $(eval $(call SingleProfile,Planex,64kraw,MZKW04NU,mzk-w04nu,MZK-W04NU,ttyS0,115200))
  1763. $(eval $(call SingleProfile,Planex,64kraw,MZKW300NH,mzk-w300nh,MZK-W300NH,ttyS0,115200))
  1764. $(eval $(call SingleProfile,Seama,64k,MYNETN600,mynet-n600,MYNET-N600,ttyS0,115200,$$(mynet_n600_mtdlayout),wrgnd16_wd_db600,1310720,16187392))
  1765. $(eval $(call SingleProfile,Seama,64k,MYNETN750,mynet-n750,MYNET-N750,ttyS0,115200,$$(mynet_n600_mtdlayout),wrgnd13_wd_av,1310720,16187392))
  1766. $(eval $(call SingleProfile,Seama,64k,QIHOO360,qihoo-c301,QIHOO-C301,ttyS0,115200,$$(qihoo_c301_mtdlayout),wrgac26_qihoo360_360rg,1310720,16121856))
  1767. $(eval $(call SingleProfile,Senao,squashfs-only,EAP300V2,eap300v2,EAP300V2,ttyS0,115200,$$(eap300v2_mtdlayout)))
  1768. $(eval $(call SingleProfile,TPLINKOLD,squashfs-only,TLWR841NV15,tl-wr841nd-v1.5,TL-WR841N-v1.5,ttyS0,115200,0x08410002,2,4M))
  1769. $(eval $(call SingleProfile,TPLINK,64kraw,RNXN360RT,rnx-n360rt,TL-WR941ND,ttyS0,115200,0x09410002,0x00420001,4M))
  1770. $(eval $(call SingleProfile,TPLINK,64kraw,TLMR3220V1,tl-mr3220-v1,TL-MR3220,ttyS0,115200,0x32200001,1,4M))
  1771. $(eval $(call SingleProfile,TPLINK,64kraw,TLMR3420V1,tl-mr3420-v1,TL-MR3420,ttyS0,115200,0x34200001,1,4M))
  1772. $(eval $(call SingleProfile,TPLINK,64kraw,TLWA701NV1,tl-wa701n-v1,TL-WA901ND,ttyS0,115200,0x07010001,1,4M))
  1773. $(eval $(call SingleProfile,TPLINK,64kraw,TLWA730REV1,tl-wa730rev1,TL-WA901ND,ttyS0,115200,0x07300001,1,4M))
  1774. $(eval $(call SingleProfile,TPLINK,64kraw,TLWA7510NV1,tl-wa7510n,TL-WA7510N,ttyS0,115200,0x75100001,1,4M))
  1775. $(eval $(call SingleProfile,TPLINK,64kraw,TLWA801NV1,tl-wa801nd-v1,TL-WA901ND,ttyS0,115200,0x08010001,1,4M))
  1776. $(eval $(call SingleProfile,TPLINK,64kraw,TLWA830RV1,tl-wa830re-v1,TL-WA901ND,ttyS0,115200,0x08300010,1,4M))
  1777. $(eval $(call SingleProfile,TPLINK,64kraw,TLWA901NV1,tl-wa901nd-v1,TL-WA901ND,ttyS0,115200,0x09010001,1,4M))
  1778. $(eval $(call SingleProfile,TPLINK,64kraw,TLWA901NV2,tl-wa901nd-v2,TL-WA901ND-v2,ttyS0,115200,0x09010002,1,4M))
  1779. $(eval $(call SingleProfile,TPLINK,64kraw,TLWR740NV1,tl-wr740n-v1,TL-WR741ND,ttyS0,115200,0x07400001,1,4M))
  1780. $(eval $(call SingleProfile,TPLINK,64kraw,TLWR740NV3,tl-wr740n-v3,TL-WR741ND,ttyS0,115200,0x07400003,1,4M))
  1781. $(eval $(call SingleProfile,TPLINK,64kraw,TLWR743NV1,tl-wr743nd-v1,TL-WR741ND,ttyS0,115200,0x07430001,1,4M))
  1782. $(eval $(call SingleProfile,TPLINK,64kraw,TLWR841NV3,tl-wr841nd-v3,TL-WR941ND,ttyS0,115200,0x08410003,3,4M))
  1783. $(eval $(call SingleProfile,TPLINK,64kraw,TLWR841NV5,tl-wr841nd-v5,TL-WR741ND,ttyS0,115200,0x08410005,1,4M))
  1784. $(eval $(call SingleProfile,TPLINK,64kraw,TLWR841NV7,tl-wr841nd-v7,TL-WR841N-v7,ttyS0,115200,0x08410007,1,4M))
  1785. $(eval $(call SingleProfile,TPLINK,64kraw,TLWR842V1,tl-wr842n-v1,TL-MR3420,ttyS0,115200,0x08420001,1,8M))
  1786. $(eval $(call SingleProfile,TPLINK,64kraw,TLWR941NV2,tl-wr941nd-v2,TL-WR941ND,ttyS0,115200,0x09410002,2,4M))
  1787. $(eval $(call SingleProfile,TPLINK,64kraw,TLWR941NV3,tl-wr941nd-v3,TL-WR941ND,ttyS0,115200,0x09410002,2,4M))
  1788. $(eval $(call SingleProfile,TPLINK,64kraw,TLWR941NV4,tl-wr941nd-v4,TL-WR741ND,ttyS0,115200,0x09410004,1,4M))
  1789. $(eval $(call SingleProfile,TPLINK,64kraw,TLWR1043V1,tl-wr1043nd-v1,TL-WR1043ND,ttyS0,115200,0x10430001,1,8M))
  1790. $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V2,tl-wr1043nd-v2,TL-WR1043ND-v2,ttyS0,115200,0x10430002,1,8M))
  1791. $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR1043V3,tl-wr1043nd-v3,TL-WR1043ND-v2,ttyS0,115200,0x10430003,1,8M))
  1792. $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLWR2543,tl-wr2543-v1,TL-WR2543N,ttyS0,115200,0x25430001,1,8Mlzma,-v 3.13.99))
  1793. $(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510))
  1794. $(eval $(call SingleProfile,UAPPRO,64k,UAPPRO,ubnt-uap-pro,UAP-PRO,ttyS0,115200,BZ,BZ,ar934x))
  1795. $(eval $(call SingleProfile,UAPPRO,64k,UBNTUNIFIOUTDOORPLUS,ubnt-unifi-outdoor-plus,UBNT-UOP,ttyS0,115200,BZ,BZ,ar7240))
  1796. $(eval $(call SingleProfile,UBDEV,64kraw,UBDEV01,ubdev01,UBNT-UF,ttyS0,115200,UBDEV01,XM,ar7240))
  1797. $(eval $(call SingleProfile,UBNT,64k,UBNTRS,ubnt-rs,UBNT-RS,ttyS0,115200,RS,RSx,ar7100))
  1798. $(eval $(call SingleProfile,UBNT,64k,UBNTRSPRO,ubnt-rspro,UBNT-RSPRO,ttyS0,115200,RSPRO,RSPRO,ar7100pro))
  1799. $(eval $(call SingleProfile,UBNT,64k,UBNTLSSR71,ubnt-ls-sr71,UBNT-LS-SR71,ttyS0,115200,LS-SR71,LS-SR71,ar7100))
  1800. $(eval $(call SingleProfile,UBNTXM,64kraw,RW2458N,rw2458n,RW2458N,ttyS0,115200,XM,XM,ar7240))
  1801. $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTAIRROUTER,ubnt-airrouter,UBNT-AR,ttyS0,115200,XM,XM,ar7240))
  1802. $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTBULLETM,ubnt-bullet-m,UBNT-BM,ttyS0,115200,XM,XM,ar7240))
  1803. $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTROCKETM,ubnt-rocket-m,UBNT-RM,ttyS0,115200,XM,XM,ar7240))
  1804. $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTROCKETMXW,ubnt-rocket-m-xw,UBNT-RM-XW,ttyS0,115200,XM,XW,ar934x))
  1805. $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTNANOM,ubnt-nano-m,UBNT-NM,ttyS0,115200,XM,XM,ar7240))
  1806. $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTUNIFI,ubnt-unifi,UBNT-UF,ttyS0,115200,XM,BZ,ar7240))
  1807. $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTUNIFIOUTDOOR,ubnt-unifi-outdoor,UBNT-U20,ttyS0,115200,XM,BZ,ar7240))
  1808. $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTNANOMXW,ubnt-nano-m-xw,UBNT-NM-XW,ttyS0,115200,XM,XW,ar934x))
  1809. $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTLOCOXW,ubnt-loco-m-xw,UBNT-LOCO-XW,ttyS0,115200,XM,XW,ar934x))
  1810. $(eval $(call SingleProfile,UBNTXM,64kraw,UBNTAIRGW,ubnt-air-gateway,UBNT-AGW,ttyATH0,115200,XM,AirGW,ar933x))
  1811. $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N))
  1812. $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPG300N,whr-hp-g300n,WHR-HP-G300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-G300N))
  1813. $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPGN,whr-hp-gn,WHR-HP-GN,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-GN))
  1814. $(eval $(call SingleProfile,WHRHPG300N,64kraw,WLAEAG300N,wlae-ag300n,WLAE-AG300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WLAE-AG300N))
  1815. $(eval $(call SingleProfile,WRT400N,64k,WRT400N,wrt400n,WRT400N,ttyS0,115200))
  1816. $(eval $(call SingleProfile,WZRHP128K,128kraw,WZRHPG300NH,wzr-hp-g300nh,WZR-HP-G300NH,ttyS0,115200,WZR-HP-G300NH))
  1817. $(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPG300NH2,wzr-hp-g300nh2,WZR-HP-G300NH2,ttyS0,115200,WZR-HP-G300NH2))
  1818. $(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPAG300H,wzr-hp-ag300h,WZR-HP-AG300H,ttyS0,115200,WZR-HP-AG300H))
  1819. $(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPG450H,wzr-hp-g450h,WZR-HP-G450H,ttyS0,115200,WZR-HP-AG450H))
  1820. $(eval $(call SingleProfile,WZRHP64K,64kraw,WZR600DHP,wzr-600dhp,WZR-HP-AG300H,ttyS0,115200,WZR-600DHP))
  1821. $(eval $(call SingleProfile,WZRHP64K,64kraw,WZR450HP2,wzr-450hp2,WZR-450HP2,ttyS0,115200,WZR-450HP2))
  1822. $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H28,zcn-1523h-2-8,ZCN-1523H-2,ttyS0,115200,$$(zcn1523h_mtdlayout)))
  1823. $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H516,zcn-1523h-5-16,ZCN-1523H-5,ttyS0,115200,$$(zcn1523h_mtdlayout)))
  1824. $(eval $(call SingleProfile,ZyXEL,64k,NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG460N,ttyS0,115200,NBG-460N))
  1825. $(eval $(call MultiProfile,AP121,AP121_2M AP121_4M))
  1826. $(eval $(call MultiProfile,DIR615IX,DIR615I1 DIR615I3))
  1827. $(eval $(call MultiProfile,AP136,AP136_010 AP136_020))
  1828. $(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT EWDORIN16M))
  1829. $(eval $(call MultiProfile,OPENMESH,OM2P OM5P OM5PAC MR600 MR900 MR1750))
  1830. $(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY))
  1831. $(eval $(call MultiProfile,TLMR3220,TLMR3220V1))
  1832. $(eval $(call MultiProfile,TLMR3420,TLMR3420V1))
  1833. $(eval $(call MultiProfile,TLWA701,TLWA701NV1))
  1834. $(eval $(call MultiProfile,TLWA730RE,TLWA730REV1))
  1835. $(eval $(call MultiProfile,TLWA801,TLWA801NV1))
  1836. $(eval $(call MultiProfile,TLWA830,TLWA830RV1))
  1837. $(eval $(call MultiProfile,TLWA901,TLWA901NV1 TLWA901NV2))
  1838. $(eval $(call MultiProfile,TLWA7510,TLWA7510NV1))
  1839. $(eval $(call MultiProfile,TLWR740,TLWR740NV1 TLWR740NV3))
  1840. $(eval $(call MultiProfile,TLWR741,TLWR741NV1 TLWR741NV2))
  1841. $(eval $(call MultiProfile,TLWR743,TLWR743NV1))
  1842. $(eval $(call MultiProfile,TLWR841,TLWR841NV15 TLWR841NV3 TLWR841NV5 TLWR841NV7))
  1843. $(eval $(call MultiProfile,TLWR842,TLWR842V1))
  1844. $(eval $(call MultiProfile,TLWR941,TLWR941NV2 TLWR941NV3 TLWR941NV4))
  1845. $(eval $(call MultiProfile,TLWR1043,TLWR1043V1 TLWR1043V2 TLWR1043V3))
  1846. $(eval $(call MultiProfile,TLWDR4300,TLWDR3500V1 TLWDR3600V1 TLWDR4300V1 TLWDR4300V1IL TLWDR4310V1 MW4530RV1))
  1847. $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
  1848. $(eval $(call MultiProfile,UBNT,UBNTAIRROUTER UBNTRS UBNTRSPRO UBNTLSSR71 UBNTBULLETM UBNTROCKETM UBNTROCKETMXW UBNTNANOM UBNTNANOMXW UBNTLOCOXW UBNTUNIFI UBNTUNIFIOUTDOOR UBNTUNIFIOUTDOORPLUS UAPPRO UBNTAIRGW))
  1849. $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
  1850. $(eval $(call MultiProfile,WNR1000V2,REALWNR1000V2 WNR1000V2_VC))
  1851. $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))
  1852. $(eval $(call MultiProfile,WPE72,WPE72_4M WPE72_8M WPE72_16M))
  1853. $(eval $(call MultiProfile,WPJ344,WPJ344_16M))
  1854. $(eval $(call MultiProfile,WPJ531,WPJ531_16M))
  1855. $(eval $(call MultiProfile,WPJ558,WPJ558_16M))
  1856. $(eval $(call MultiProfile,Minimal,$(SINGLE_PROFILES)))
  1857. $(eval $(call MultiProfile,Madwifi,EAP7660D UBNTRS UBNTRSPRO UBNTLSSR71 WP543))
  1858. endif # ifeq ($(SUBTARGET),generic)
  1859. ifeq ($(SUBTARGET),nand)
  1860. $(eval $(call SingleProfile,NetgearNAND,64k,WNDR3700V4,wndr3700v4,WNDR3700_V4,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR3700v4,"",-H 29763948+128+128,wndr4300))
  1861. $(eval $(call SingleProfile,NetgearNAND,64k,WNDR4300V1,wndr4300,WNDR4300,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR4300,"",-H 29763948+0+128+128+2x2+3x3,wndr4300))
  1862. $(eval $(call SingleProfile,NetgearNAND,64k,R6100,r6100,R6100,ttyS0,115200,$$(r6100_mtdlayout),0x36303030,R6100,"",-H 29764434+0+128+128+2x2+2x2,wndr4300))
  1863. $(eval $(call SingleProfile,ZyXELNAND,128k,NBG6716,nbg6716,NBG6716,ttyS0,115200,NBG6716,$$(zyx_nbg6716_mtdlayout),mem=256M))
  1864. $(eval $(call MultiProfile,WNDR4300,WNDR3700V4 WNDR4300V1))
  1865. endif # ifeq ($(SUBTARGET),nand)
  1866. $(eval $(call MultiProfile,Default,$(SINGLE_PROFILES)))
  1867. define Image/Build/squashfs
  1868. cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-raw
  1869. cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-64k
  1870. $(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR)/root.squashfs-64k 64
  1871. cp $(KDIR)/root.squashfs-64k $(BIN_DIR)/$(IMG_PREFIX)-root.squashfs-64k
  1872. $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
  1873. dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
  1874. endef
  1875. define Image/Build/jffs2
  1876. dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
  1877. endef
  1878. define Image/Build/Initramfs
  1879. $(call Image/Build/Profile/$(IMAGE_PROFILE),initramfs)
  1880. endef
  1881. define Image/Prepare
  1882. gzip -9 -c $(KDIR)/vmlinux > $(KDIR)/vmlinux.bin.gz
  1883. $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
  1884. ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  1885. gzip -9 -c $(KDIR)/vmlinux-initramfs > $(KDIR)/vmlinux-initramfs.bin.gz
  1886. $(call CompressLzma,$(KDIR)/vmlinux-initramfs,$(KDIR)/vmlinux-initramfs.bin.lzma)
  1887. $(call Image/BuildLoader,generic,elf,,,-initramfs)
  1888. endif
  1889. $(call Image/BuildLoader,generic,elf)
  1890. $(call Image/Build/Profile/$(if $(CONFIG_IB),Default,$(IMAGE_PROFILE)),loader)
  1891. endef
  1892. # $(1): filesystem type.
  1893. define Image/Build
  1894. $(call Image/Build/$(call rootfs_type,$(1)),$(1))
  1895. $(call Image/Build/Profile/$(IMAGE_PROFILE),$(1))
  1896. endef
  1897. $(eval $(call BuildImage))