legacy.mk 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216
  1. rootfs_type=$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))
  2. # $(1): rootfs type.
  3. # $(2): board name.
  4. define imgname
  5. $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(call rootfs_type,$(1))
  6. endef
  7. define rootfs_align
  8. $(patsubst %-256k,0x40000,$(patsubst %-128k,0x20000,$(patsubst %-64k,0x10000,$(patsubst squashfs%,0x4,$(patsubst root.%,%,$(1))))))
  9. endef
  10. define sysupname
  11. $(call imgname,$(1),$(2))-sysupgrade.bin
  12. endef
  13. define factoryname
  14. $(call imgname,$(1),$(2))-factory.bin
  15. endef
  16. COMMA:=,
  17. define mkcmdline
  18. $(if $(1),board=$(1) )$(if $(2),console=$(2)$(COMMA)$(3))
  19. endef
  20. define mtdpartsize
  21. $(shell sz=`echo '$(2)' | sed -ne 's/.*[:$(COMMA)]\([0-9]*\)k[@]*[0-9a-zx]*($(1)).*/\1/p'`; [ -n "$$sz" ] && echo $$(($$sz * 1024)))
  22. endef
  23. SINGLE_PROFILES:=
  24. # $(1) : name of image build method to be used, e.g., AthLzma.
  25. # $(2) : name of the build template to be used, e.g. 64k, 64kraw, 128k, etc.
  26. # $(3) : name of the profile to be defined.
  27. # $(4) : board name.
  28. # $(5)~$(7) : arguments for $(mkcmdline)
  29. # board=$(1) console=$(2),$(3)
  30. # $(8)~$(14): extra arguments.
  31. define SingleProfile
  32. # $(1): action name, e.g. loader, buildkernel, squashfs, etc.
  33. define Image/Build/Profile/$(3)
  34. $$(call Image/Build/Template/$(2)/$$(1),$(1),$(4),$$(call mkcmdline,$(5),$(6),$(7)),$(8),$(9),$(10),$(11),$(12),$(13),$(14))
  35. endef
  36. SINGLE_PROFILES += $(3)
  37. endef
  38. # $(1), name of the MultiProfile to be added.
  39. # $(2), name of Profiles to be included in the MultiProfile.
  40. define MultiProfile
  41. define Image/Build/Profile/$(1)
  42. $(foreach p,$(2),
  43. $$(call Image/Build/Profile/$p,$$(1))
  44. )
  45. endef
  46. endef
  47. LOADER_MAKE := $(NO_TRACE_MAKE) -C lzma-loader KDIR=$(KDIR)
  48. VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux
  49. UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage
  50. # $(1): input file.
  51. # $(2): output file.
  52. # $(3): extra arguments for lzma.
  53. define CompressLzma
  54. $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(3) $(2)
  55. endef
  56. define PatchKernel
  57. cp $(KDIR)/vmlinux$(3) $(KDIR_TMP)/vmlinux$(3)-$(1)
  58. $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(3)-$(1) "$(strip $(2))"
  59. endef
  60. define PatchKernel/initramfs
  61. $(call PatchKernel,$(1),$(2),-initramfs)
  62. cp $(KDIR_TMP)/vmlinux-initramfs-$(1) $(call imgname,initramfs,$(1)).bin
  63. endef
  64. # $(1): board name.
  65. # $(2): kernel command line.
  66. # $(3): extra argumetns for lzma.
  67. # $(4): name suffix, e.g. "-initramfs".
  68. define PatchKernelLzma
  69. cp $(KDIR)/vmlinux$(4) $(KDIR_TMP)/vmlinux$(4)-$(1)
  70. $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(4)-$(1) "$(strip $(2))"
  71. $(call CompressLzma,$(KDIR_TMP)/vmlinux$(4)-$(1),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(3))
  72. endef
  73. define PatchKernelGzip
  74. cp $(KDIR)/vmlinux$(3) $(KDIR_TMP)/vmlinux$(3)-$(1)
  75. $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(3)-$(1) "$(strip $(2))"
  76. gzip -9n -c $(KDIR_TMP)/vmlinux$(3)-$(1) > $(KDIR_TMP)/vmlinux$(3)-$(1).bin.gz
  77. endef
  78. ifneq ($(SUBTARGET),mikrotik)
  79. # $(1): compression method of the data.
  80. # $(2): extra arguments.
  81. # $(3): input data file.
  82. # $(4): output file.
  83. define MkuImage
  84. mkimage -A mips -O linux -T kernel -a 0x80060000 -C $(1) $(2) \
  85. -e 0x80060000 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
  86. -d $(3) $(4)
  87. endef
  88. # $(1): board name.
  89. # $(2): kernel command line.
  90. # $(3): extra arguments for lzma.
  91. # $(4): name suffix, e.g. "-initramfs".
  92. # $(5): extra arguments for mkimage.
  93. define MkuImageLzma
  94. $(call PatchKernelLzma,$(1),$(2),$(3),$(4))
  95. $(call MkuImage,lzma,$(5),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(KDIR_TMP)/vmlinux$(4)-$(1).uImage)
  96. endef
  97. define MkuImageLzma/initramfs
  98. $(call PatchKernelLzma,$(1),$(2),$(3),-initramfs)
  99. $(call MkuImage,lzma,$(4),$(KDIR_TMP)/vmlinux-initramfs-$(1).bin.lzma,$(call imgname,initramfs,$(1))-uImage.bin)
  100. endef
  101. define MkuImageGzip
  102. $(call PatchKernelGzip,$(1),$(2))
  103. $(call MkuImage,gzip,,$(KDIR_TMP)/vmlinux-$(1).bin.gz,$(KDIR_TMP)/vmlinux-$(1).uImage)
  104. endef
  105. define MkuImageGzip/initramfs
  106. $(call PatchKernelGzip,$(1),$(2),-initramfs)
  107. $(call MkuImage,gzip,,$(KDIR_TMP)/vmlinux-initramfs-$(1).bin.gz,$(call imgname,initramfs,$(1))-uImage.bin)
  108. endef
  109. define MkuImageOKLI
  110. $(call MkuImage,lzma,-M 0x4f4b4c49,$(KDIR)/vmlinux.bin.lzma,$(KDIR_TMP)/vmlinux-$(1).okli)
  111. endef
  112. endif
  113. # $(1): name of the 1st file.
  114. # $(2): size limit of the 1st file if it is greater than 262144, or
  115. # the erase size of the flash if it is greater than zero and less
  116. # than 262144
  117. # $(3): name of the 2nd file.
  118. # $(4): size limit of the 2nd file if $(2) is greater than 262144, otherwise
  119. # it is the size limit of the output file
  120. # $(5): name of the output file.
  121. # $(6): padding size.
  122. define CatFiles
  123. if [ $(2) -eq 0 ]; then \
  124. filename="$(3)"; fstype=$$$${filename##*\.}; \
  125. case "$$$${fstype}" in \
  126. "jffs2-64k") bs=65536;; \
  127. "jffs2-128k") bs=131072;; \
  128. "jffs2-256k") bs=262144;; \
  129. *) bs=`stat -c%s $(1)`;; \
  130. esac; \
  131. ( dd if=$(1) bs=$$$${bs} conv=sync; cat $(3) ) > $(5); \
  132. if [ -n "$(6)" ]; then \
  133. case "$$$${fstype}" in \
  134. squashfs*) \
  135. padjffs2 $(5) $(6); \
  136. ;; \
  137. esac; \
  138. fi; \
  139. if [ `stat -c%s $(5)` -gt $(4) ]; then \
  140. echo "Warning: $(5) is too big (> $(4) bytes)" >&2; \
  141. rm -f $(5); \
  142. fi; \
  143. else if [ $(2) -gt 262144 ]; then \
  144. if [ `stat -c%s "$(1)"` -gt $(2) ]; then \
  145. echo "Warning: $(1) is too big (> $(2) bytes)" >&2; \
  146. else if [ `stat -c%s $(3)` -gt $(4) ]; then \
  147. echo "Warning: $(3) is too big (> $(4) bytes)" >&2; \
  148. else \
  149. ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \
  150. fi; fi; \
  151. else \
  152. ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \
  153. if [ `stat -c%s $(5)` -gt $(4) ]; then \
  154. echo "Warning: $(5) is too big (> $(4) bytes)" >&2; \
  155. rm -f $(5); \
  156. fi; \
  157. fi; fi
  158. endef
  159. # $(1): rootfs type.
  160. # $(2): board name.
  161. # $(3): kernel image size limit.
  162. # $(4): rootfs image size limit.
  163. # $(5): padding argument for padjffs2.
  164. Sysupgrade/KR=$(call CatFiles,$(2),$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(5)))
  165. Sysupgrade/KRuImage=$(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage,$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(2)),$(5))
  166. Sysupgrade/RKuImage=$(call CatFiles,$(KDIR)/root.$(1),$(4),$(KDIR_TMP)/vmlinux-$(2).uImage,$(3),$(call sysupname,$(1),$(2)))
  167. # $(1): ubinize ini file
  168. # $(2): working directory
  169. # $(3): output file
  170. # $(4): physical erase block size
  171. # $(5): minimum I/O unit size
  172. # $(6): custom options
  173. define ubinize
  174. $(CP) $(1) $(2)
  175. ( cd $(2); $(STAGING_DIR_HOST)/bin/ubinize -o $(3) -p $(4) -m $(5) $(6) $(1))
  176. endef
  177. #
  178. # Embed lzma-compressed kernel inside lzma-loader.
  179. #
  180. # $(1), suffix of output filename, e.g. generic, lowercase board name, etc.
  181. # $(2), suffix of target file to build, e.g. bin, gz, elf
  182. # $(3), kernel command line to pass from lzma-loader to kernel
  183. # $(4), unused here
  184. # $(5), suffix of kernel filename, e.g. -initramfs, or empty
  185. define Image/BuildLoader
  186. -rm -rf $(KDIR)/lzma-loader
  187. $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)"\
  188. LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
  189. LOADER_DATA="$(KDIR)/vmlinux$(5).bin.lzma" BOARD="$(1)" \
  190. compile loader.$(2)
  191. -$(CP) $(KDIR)/loader-$(1).$(2) $(KDIR)/loader-$(1)$(5).$(2)
  192. endef
  193. #
  194. # Build lzma-loader alone which will search for lzma-compressed kernel identified by
  195. # uImage header with magic "OKLI" at boot time.
  196. #
  197. # $(4), offset into the flash space to start searching uImage magic "OKLI".
  198. # $(5), size of search range starting at $(4). With 0 as the value, uImage
  199. # header is expected to be at precisely $(4)
  200. define Image/BuildLoaderAlone
  201. -rm -rf $(KDIR)/lzma-loader
  202. $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)" \
  203. LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
  204. BOARD="$(1)" FLASH_OFFS=$(4) FLASH_MAX=$(5) \
  205. compile loader.$(2)
  206. endef
  207. define Build/Clean
  208. $(LOADER_MAKE) clean
  209. endef
  210. 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)
  211. 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)
  212. 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)
  213. alfa_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,15936k(firmware),64k(nvram),64k(art)ro
  214. all0258n_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),6272k(firmware),1536k(failsafe),64k(art)
  215. all0315n_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env),13568k(firmware),2048k(failsafe),256k(art)ro
  216. anonabox_pro_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
  217. ap81_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,5120k(rootfs),2688k(kernel),64k(art)ro,7808k@0x50000(firmware)
  218. ap83_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,128k(u-boot-env)ro,4096k(rootfs),3648k(kernel),64k(art)ro,7744k@0x60000(firmware)
  219. ap96_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1728k(kernel),64k(art)ro,7872k@0x40000(firmware)
  220. ap113_mtd_layout=mtdparts=spi0.0:64k(u-boot),3008k(rootfs),896k(uImage),64k(NVRAM),64k(ART),3904k@0x10000(firmware)
  221. ap121_mtdlayout_2M=mtdparts=spi0.0:64k(u-boot)ro,1216k(rootfs),704k(kernel),64k(art)ro,1920k@0x10000(firmware)
  222. ap121_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2448k(rootfs),1200k(kernel),64k(nvram),64k(art)ro,3648k@0x50000(firmware)
  223. ap121_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)
  224. ap121_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,10944k(rootfs),4992k(kernel),64k(nvram),64k(art)ro,15936k@0x50000(firmware)
  225. ap132_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art),7808k@0x50000(firmware)
  226. ap135_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
  227. 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)
  228. ap143_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1472k(kernel),64k(art)ro,7744k@0x50000(firmware)
  229. ap143_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
  230. ap147_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art),16000k@0x50000(firmware)
  231. ap152_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
  232. 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
  233. cameo_ap81_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(config)ro,3840k(firmware),64k(art)ro
  234. cameo_ap91_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,3712k(firmware),64k(mac)ro,64k(art)ro
  235. cameo_ap99_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,3520k(firmware),64k(mac)ro,192k(lp)ro,64k(art)ro
  236. cameo_ap121_mtdlayout=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k(nvram)ro,192k(language)ro,3648k(firmware)
  237. 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)
  238. cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
  239. cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
  240. cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
  241. 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)
  242. eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
  243. 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)
  244. 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
  245. dlan_hotspot_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(Config1)ro,64k(Config2)ro,7872k@0x40000(firmware),64k(art)ro
  246. 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
  247. 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
  248. cameo_ap94_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,1600k(unknown)ro,64k@0x7f0000(caldata_copy)
  249. 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)
  250. 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)
  251. 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)
  252. 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)
  253. ew-dorin_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),3712k(firmware),64k(art)
  254. ew-dorin_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
  255. 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)
  256. 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)
  257. 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)
  258. dragino2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,16000k(firmware),64k(config)ro,64k(art)ro
  259. mr12_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x80000(firmware)
  260. mr16_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x80000(firmware)
  261. 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)
  262. planex_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),128k(art)ro
  263. ubntxm_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
  264. 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)
  265. ubdev_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7488k(firmware),64k(certs),256k(cfg)ro,64k(EEPROM)ro
  266. whrhpg300n_mtdlayout=mtdparts=spi0.0:248k(u-boot)ro,8k(u-boot-env)ro,3712k(firmware),64k(art)ro
  267. 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)
  268. wpj342_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
  269. wpj344_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
  270. dr344_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)
  271. wpj531_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
  272. wpj558_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
  273. 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)
  274. wnr2200_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro
  275. wnr2000v3_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmware),64k(art)ro
  276. wnr2000v4_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,3776k(firmware),64k(art)ro
  277. 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)
  278. tew823dru_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
  279. 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)
  280. 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)
  281. 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
  282. mynet_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro
  283. 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)
  284. 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)
  285. yun_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6464k(rootfs),1280k(kernel),64k(nvram),64k(art),7744k@0x50000(firmware)
  286. yun_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14656k(rootfs),1280k(kernel),64k(nvram),64k(art),15936k@0x50000(firmware)
  287. wrtnode2q_mtdlayout=mtdparts=spi0.0:192k(u-boot),64k(u-boot-env),64k(art),1472k(kernel),14592k(rootfs),16064k@0x50000(firmware),16384k@0x0(fullflash)
  288. define Image/BuildKernel
  289. cp $(KDIR)/vmlinux.elf $(VMLINUX).elf
  290. cp $(KDIR)/vmlinux $(VMLINUX).bin
  291. dd if=$(KDIR)/vmlinux.bin.lzma of=$(VMLINUX).lzma bs=65536 conv=sync
  292. dd if=$(KDIR)/vmlinux.bin.gz of=$(VMLINUX).gz bs=65536 conv=sync
  293. $(call MkuImage,gzip,,$(KDIR)/vmlinux.bin.gz,$(UIMAGE)-gzip.bin)
  294. $(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(UIMAGE)-lzma.bin)
  295. cp $(KDIR)/loader-generic.elf $(VMLINUX)-lzma.elf
  296. -mkdir -p $(KDIR_TMP)
  297. $(call Image/Build/Profile/$(IMAGE_PROFILE),buildkernel)
  298. endef
  299. define Image/BuildKernel/Initramfs
  300. cp $(KDIR)/vmlinux-initramfs.elf $(VMLINUX)-initramfs.elf
  301. cp $(KDIR)/vmlinux-initramfs $(VMLINUX)-initramfs.bin
  302. dd if=$(KDIR)/vmlinux-initramfs.bin.lzma of=$(VMLINUX)-initramfs.lzma bs=65536 conv=sync
  303. dd if=$(KDIR)/vmlinux-initramfs.bin.gz of=$(VMLINUX)-initramfs.gz bs=65536 conv=sync
  304. $(call MkuImage,gzip,,$(KDIR)/vmlinux-initramfs.bin.gz,$(UIMAGE)-initramfs-gzip.bin)
  305. $(call MkuImage,lzma,,$(KDIR)/vmlinux-initramfs.bin.lzma,$(UIMAGE)-initramfs-lzma.bin)
  306. cp $(KDIR)/loader-generic-initramfs.elf $(VMLINUX)-initramfs-lzma.elf
  307. $(call Image/Build/Initramfs)
  308. endef
  309. Image/Build/WRT400N/buildkernel=$(call MkuImageLzma,$(2),$(3))
  310. define Image/Build/WRT400N
  311. $(call Sysupgrade/KRuImage,$(1),$(2),1310720,6488064)
  312. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  313. wrt400n $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR)/root.$(1) $(call factoryname,$(1),$(2)); \
  314. fi
  315. endef
  316. define Image/Build/CameoAP94/buildkernel
  317. $(call MkuImageLzma,$(2),$(3) $(4))
  318. $(call MkuImageLzma,$(2)-fat,$(3) $(5))
  319. endef
  320. define Image/Build/CameoAP94
  321. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  322. $(eval fwsize_fat=$(call mtdpartsize,firmware,$(5)))
  323. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
  324. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  325. ( \
  326. dd if=$(call sysupname,$(1),$(2)); \
  327. echo -n "$(6)"; \
  328. ) > $(call imgname,$(1),$(2))-backup-loader.bin; \
  329. if [ `stat -c%s $(call sysupname,$(1),$(2))` -gt 4194304 ]; then \
  330. echo "Warning: $(call sysupname,$(1),$(2)) is too big" >&2; \
  331. else \
  332. ( \
  333. dd if=$(call sysupname,$(1),$(2)) bs=4096k conv=sync; \
  334. echo -n "$(7)"; \
  335. ) > $(call factoryname,$(1),$(2)); \
  336. fi; \
  337. fi
  338. $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2)-fat.uImage,0,$(KDIR)/root.$(1),$$$$(($(fwsize_fat)-4*64*1024)),$(KDIR_TMP)/$(2)-fat.bin,64)
  339. if [ -e "$(KDIR_TMP)/$(2)-fat.bin" ]; then \
  340. echo -n "" > $(KDIR_TMP)/$(2)-fat.dummy; \
  341. sh $(TOPDIR)/scripts/combined-image.sh \
  342. "$(KDIR_TMP)/$(2)-fat.bin" \
  343. "$(KDIR_TMP)/$(2)-fat.dummy" \
  344. $(call sysupname,$(1),$(2)-fat); \
  345. fi
  346. endef
  347. define Image/Build/WZRHP
  348. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(3)-4*$(4)*1024)),$(4))
  349. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  350. ( \
  351. echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
  352. dd if=$(call sysupname,$(1),$(2)); \
  353. ) > $(call imgname,$(1),$(2))-tftp.bin; \
  354. buffalo-enc -p $(5) -v 1.99 \
  355. -i $(call sysupname,$(1),$(2)) \
  356. -o $(KDIR_TMP)/$(2).enc; \
  357. buffalo-tag -b $(5) -p $(5) -a ath -v 1.99 -m 1.01 -l mlang8 \
  358. -w 3 -c 0x80041000 -d 0x801e8000 -f 1 -r M_ \
  359. -i $(KDIR_TMP)/$(2).enc \
  360. -o $(call factoryname,$(1),$(2)); \
  361. fi
  362. endef
  363. Image/Build/WZRHP64K/buildkernel=$(call MkuImageLzma,$(2),$(3))
  364. Image/Build/WZRHP64K/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  365. Image/Build/WZRHP64K=$(call Image/Build/WZRHP,$(1),$(2),33095680,64,$(4))
  366. Image/Build/WZRHP128K/buildkernel=$(call MkuImageLzma,$(2),$(3))
  367. Image/Build/WZRHP128K/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  368. Image/Build/WZRHP128K=$(call Image/Build/WZRHP,$(1),$(2),33030144,128,$(4))
  369. Image/Build/WHRHPG300N/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  370. Image/Build/WHRHPG300N/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  371. define Image/Build/WHRHPG300N
  372. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  373. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
  374. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  375. ( \
  376. echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
  377. dd if=$(call sysupname,$(1),$(2)); \
  378. ) > $(call imgname,$(1),$(2))-tftp.bin; \
  379. buffalo-enc -p $(5) -v 1.99 \
  380. -i $(call sysupname,$(1),$(2)) \
  381. -o $(KDIR_TMP)/$(2).enc; \
  382. buffalo-tag -b $(5) -p $(5) -a ath -v 1.99 -m 1.01 -l mlang8 \
  383. -w 3 -c 0x80041000 -d 0x801e8000 -f 1 -r M_ \
  384. -i $(KDIR_TMP)/$(2).enc \
  385. -o $(call factoryname,$(1),$(2)); \
  386. fi
  387. endef
  388. define Image/Build/Cameo
  389. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  390. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
  391. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  392. factory_size=$$$$(($(fwsize) - $(6))); \
  393. ( \
  394. dd if=$(call sysupname,$(1),$(2)) bs=$$$${factory_size} conv=sync; \
  395. echo -n $(5); \
  396. ) > $(call factoryname,$(1),$(2)); \
  397. fi
  398. endef
  399. Image/Build/CameoAP81/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap81_mtdlayout))
  400. Image/Build/CameoAP81=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap81_mtdlayout),$(4),65536)
  401. Image/Build/CameoAP81/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap81_mtdlayout))
  402. Image/Build/CameoAP91/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap91_mtdlayout))
  403. Image/Build/CameoAP91=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap91_mtdlayout),$(4),65536)
  404. Image/Build/CameoAP91/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap91_mtdlayout))
  405. Image/Build/CameoAP99/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap99_mtdlayout))
  406. Image/Build/CameoAP99=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap99_mtdlayout),$(4),65536)
  407. Image/Build/CameoAP99/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap99_mtdlayout))
  408. Image/Build/CameoAP123_4M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap123_mtdlayout_4M))
  409. Image/Build/CameoAP123_4M=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap123_mtdlayout_4M),$(4),26)
  410. Image/Build/CameoAP123_4M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap123_mtdlayout_4M))
  411. Image/Build/CameoAP135/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  412. Image/Build/CameoAP135=$(call Image/Build/Cameo,$(1),$(2),$(3),$(4),$(5),26)
  413. Image/Build/CameoAP135/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  414. Image/Build/CameoDB120/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_db120_mtdlayout))
  415. Image/Build/CameoDB120=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_db120_mtdlayout),$(4),26)
  416. Image/Build/CameoDB120/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_db120_mtdlayout))
  417. Image/Build/CameoDB120_8M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_db120_mtdlayout_8M))
  418. Image/Build/CameoDB120_8M=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_db120_mtdlayout_8M),$(4),26)
  419. Image/Build/CameoDB120_8M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_db120_mtdlayout_8M))
  420. define Image/Build/CameoHornet
  421. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  422. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
  423. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  424. for r in $(7); do \
  425. [ -n "$$$$r" ] && dashr="-$$$$r" || dashr=; \
  426. [ -z "$$$$r" ] && r="DEF"; \
  427. mkcameofw -M HORNET -R "$$$$r" -S $(5) -V $(6) -c \
  428. -K $(8) -I $(fwsize) \
  429. -k "$(call sysupname,$(1),$(2))" \
  430. -o $(call imgname,$(1),$(2))-factory$$$$dashr.bin; \
  431. true; \
  432. done; \
  433. fi
  434. endef
  435. Image/Build/CameoAP121/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap121_mtdlayout))
  436. Image/Build/CameoAP121=$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo_ap121_mtdlayout),$(4),$(5),$(6),0xe0000)
  437. Image/Build/CameoAP121/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap121_mtdlayout))
  438. Image/Build/CameoAP121_8M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap121_mtdlayout_8M))
  439. Image/Build/CameoAP121_8M=$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo_ap121_mtdlayout_8M),$(4),$(5),$(6),0x100000)
  440. Image/Build/CameoAP121_8M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap121_mtdlayout_8M))
  441. define Image/Build/dLAN
  442. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  443. $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
  444. $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
  445. $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
  446. if [ -e "$(call factoryname,$(1),$(2))" ]; then \
  447. dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
  448. of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
  449. dd if=$(KDIR)/root.$(1) \
  450. of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
  451. fi
  452. endef
  453. Image/Build/dLANLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  454. Image/Build/dLANLzma=$(call Image/Build/dLAN,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
  455. Image/Build/dLANLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  456. define Image/Build/Ath
  457. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  458. $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
  459. $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
  460. $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
  461. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  462. dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
  463. of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
  464. dd if=$(KDIR)/root.$(1) \
  465. of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
  466. fi
  467. endef
  468. Image/Build/AthGzip/buildkernel=$(call MkuImageGzip,$(2),$(3) $(4))
  469. Image/Build/AthGzip=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
  470. Image/Build/AthGzip/initramfs=$(call MkuImageGzip/initramfs,$(2),$(3) $(4))
  471. Image/Build/AthLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  472. Image/Build/AthLzma=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
  473. Image/Build/AthLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  474. Image/Build/Belkin/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  475. Image/Build/Belkin/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  476. define Image/Build/Belkin
  477. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  478. $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
  479. $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
  480. $(call Sysupgrade/RKuImage,$(1),$(2),$(kernsize),$(rootsize))
  481. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  482. edimax_fw_header -m $(5) -v "OpenWrt$(REVISION)" \
  483. -n "uImage" \
  484. -i $(KDIR_TMP)/vmlinux-$(2).uImage \
  485. -o $(KDIR_TMP)/$(2)-uImage; \
  486. edimax_fw_header -m $(5) -v "OpenWrt$(REVISION)" \
  487. -n "rootfs" \
  488. -i $(KDIR)/root.$(1) \
  489. -o $(KDIR_TMP)/$(2)-rootfs; \
  490. ( \
  491. dd if=$(KDIR_TMP)/$(2)-rootfs; \
  492. dd if=$(KDIR_TMP)/$(2)-uImage; \
  493. ) > "$(call factoryname,$(1),$(2))"; \
  494. fi
  495. endef
  496. define Image/Build/EnGenius
  497. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  498. $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
  499. $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
  500. $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
  501. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  502. dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
  503. of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
  504. dd if=$(KDIR)/root.$(1) \
  505. of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
  506. mksenaofw -e $(call sysupname,$(1),$(2)) \
  507. -o $(call imgname,$(1),$(2))-factory.dlf \
  508. -r 0x101 -p $(7) -t 2; \
  509. fi
  510. endef
  511. Image/Build/EnGenius/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  512. Image/Build/EnGenius/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  513. Image/Build/PB4X/buildkernel=$(call PatchKernelLzma,$(2),$(3))
  514. define Image/Build/PB4X
  515. dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma \
  516. of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync
  517. dd if=$(KDIR)/root.$(1) \
  518. of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync
  519. -sh $(TOPDIR)/scripts/combined-image.sh \
  520. "$(call imgname,kernel,$(2)).bin" \
  521. "$(call imgname,$(1),$(2)-rootfs).bin" \
  522. $(call sysupname,$(1),$(2))
  523. endef
  524. Image/Build/MyLoader/buildkernel=$(call PatchKernelLzma,$(2),$(3))
  525. Image/Build/MyLoader/initramfs=$(call PatchKernel/initramfs,$(2),$(3))
  526. define Image/Build/MyLoader
  527. $(eval fwsize=$(shell echo $$(($(4)-0x30000-4*64*1024))))
  528. $(eval fwimage=$(KDIR_TMP)/$(2)-$(5)-firmware.bin)
  529. $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).bin.lzma,65536,$(KDIR)/root.$(1),$(fwsize),$(fwimage))
  530. if [ -e "$(fwimage)" ]; then \
  531. $(STAGING_DIR_HOST)/bin/mkmylofw -B $(2) -s $(4) -v \
  532. -p0x00030000:0:al:0x80060000:firmware:$(fwimage) \
  533. $(call imgname,$(1),$(2))-$(5)-factory.img; \
  534. echo -n "" > $(KDIR_TMP)/empty.bin; \
  535. sh $(TOPDIR)/scripts/combined-image.sh \
  536. $(fwimage) $(KDIR_TMP)/empty.bin \
  537. $(call imgname,$(1),$(2))-$(5)-sysupgrade.bin; \
  538. fi
  539. endef
  540. Image/Build/Planex/initramfs=$(call MkuImageGzip/initramfs,$(2),$(3) $(planex_mtdlayout))
  541. Image/Build/Planex/loader=$(call Image/BuildLoaderAlone,$(1),gz,$(2) $(planex_mtdlayout),0x52000,0)
  542. define Image/Build/Planex/buildkernel
  543. [ -e "$(KDIR)/loader-$(2).gz" ]
  544. $(call MkuImageOKLI,$(2))
  545. ( \
  546. dd if=$(KDIR)/loader-$(2).gz bs=8128 count=1 conv=sync; \
  547. dd if=$(KDIR_TMP)/vmlinux-$(2).okli; \
  548. ) > $(KDIR_TMP)/kernel-$(2).bin
  549. $(call MkuImage,gzip,,$(KDIR_TMP)/kernel-$(2).bin,$(KDIR_TMP)/vmlinux-$(2).uImage)
  550. endef
  551. define Image/Build/Planex
  552. $(eval fwsize=$(call mtdpartsize,firmware,$(planex_mtdlayout)))
  553. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
  554. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  555. $(STAGING_DIR_HOST)/bin/mkplanexfw \
  556. -B $(2) \
  557. -v 2.00.00 \
  558. -i $(call sysupname,$(1),$(2)) \
  559. -o $(call factoryname,$(1),$(2)); \
  560. fi
  561. endef
  562. Image/Build/ALFA/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  563. Image/Build/ALFA/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  564. define Image/Build/ALFA
  565. $(call Sysupgrade/RKuImage,$(1),$(2),$(5),$(6))
  566. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  567. rm -rf $(KDIR)/$(1); \
  568. mkdir -p $(KDIR)/$(1); \
  569. cd $(KDIR)/$(1); \
  570. cp $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR)/$(1)/$(7); \
  571. cp $(KDIR)/root.$(1) $(KDIR)/$(1)/$(8); \
  572. $(TAR) zcf $(call factoryname,$(1),$(2)) -C $(KDIR)/$(1) $(7) $(8); \
  573. ( \
  574. echo WRM7222C | dd bs=32 count=1 conv=sync; \
  575. echo -ne '\xfe'; \
  576. ) >> $(call factoryname,$(1),$(2)); \
  577. fi
  578. endef
  579. Image/Build/Seama/loader=$(call Image/BuildLoader,$(1),bin,$(2) $(3),0x80060000)
  580. define Image/Build/Seama
  581. [ -e "$(KDIR)/loader-$(2).bin" ]
  582. $(call CompressLzma,$(KDIR)/loader-$(2).bin,$(KDIR_TMP)/loader-$(2).bin.lzma)
  583. -rm -f $(KDIR_TMP)/image-$(2).tmp
  584. $(call CatFiles,$(KDIR_TMP)/loader-$(2).bin.lzma,$$$$(($(6) - 64)),$(KDIR)/root.$(1),$(7),$(KDIR_TMP)/image-$(2).tmp)
  585. [ -e "$(KDIR_TMP)/image-$(2).tmp" ] && { \
  586. head -c -4 "$(KDIR_TMP)/image-$(2).tmp" > "$(KDIR_TMP)/image-$(2).no-jffs2mark.tmp"; \
  587. $(STAGING_DIR_HOST)/bin/seama \
  588. -i $(KDIR_TMP)/image-$(2).no-jffs2mark.tmp \
  589. -m "dev=/dev/mtdblock/1" -m "type=firmware"; \
  590. $(STAGING_DIR_HOST)/bin/seama \
  591. -s $(call imgname,$(1),$(2))-factory.bin \
  592. -m "signature=$(5)" \
  593. -i $(KDIR_TMP)/image-$(2).no-jffs2mark.tmp.seama; \
  594. tail -c 4 "$(KDIR_TMP)/image-$(2).tmp" >> $(call imgname,$(1),$(2))-factory.bin; \
  595. }
  596. cat $(KDIR_TMP)/loader-$(2).bin.lzma > $(KDIR_TMP)/image-$(2)-sysupgrade.tmp
  597. $(STAGING_DIR_HOST)/bin/seama \
  598. -i $(KDIR_TMP)/image-$(2)-sysupgrade.tmp \
  599. -m "dev=/dev/mtdblock/1" -m "type=firmware"
  600. $(call CatFiles,$(KDIR_TMP)/image-$(2)-sysupgrade.tmp.seama,$(6),$(KDIR)/root.$(1),$(7),$(call sysupname,$(1),$(2)))
  601. endef
  602. define Image/Build/Seama/initramfs
  603. $(call PatchKernelLzma,$(2),$(3) $(4),,-initramfs)
  604. $(STAGING_DIR_HOST)/bin/seama \
  605. -i $(KDIR_TMP)/vmlinux-initramfs-$(2).bin.lzma \
  606. -m "dev=/dev/mtdblock/1" -m "type=firmware"
  607. cat $(KDIR_TMP)/vmlinux-initramfs-$(2).bin.lzma.seama > $(call imgname,initramfs,$(2))-seama.bin
  608. endef
  609. Image/Build/Senao/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  610. Image/Build/Senao/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  611. define Image/Build/Senao
  612. mkdir -p $(KDIR_TMP)/$(2)/
  613. touch $(KDIR_TMP)/$(2)/FWINFO-OpenWrt-$(REVISION)-$(2)
  614. -$(CP) ./$(2)/* $(KDIR_TMP)/$(2)/
  615. dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
  616. of=$(KDIR_TMP)/$(2)/openwrt-senao-$(2)-uImage-lzma.bin bs=64k conv=sync
  617. dd if=$(KDIR)/root.$(1) \
  618. of=$(KDIR_TMP)/$(2)/openwrt-senao-$(2)-root.$(1) bs=64k conv=sync
  619. ( \
  620. cd $(KDIR_TMP)/$(2)/; \
  621. $(TAR) -cz -f $(call factoryname,$(1),$(2)) * \
  622. )
  623. -rm -rf $(KDIR_TMP)/$(2)/
  624. -sh $(TOPDIR)/scripts/combined-image.sh \
  625. $(KDIR_TMP)/vmlinux-$(2).uImage \
  626. $(KDIR)/root.$(1) \
  627. $(call sysupname,$(1),$(2))
  628. endef
  629. define Image/Build/CyberTAN
  630. echo -n '' > $(KDIR_TMP)/empty.bin
  631. $(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/image.tmp \
  632. -f $(KDIR_TMP)/vmlinux-$(2).uImage -F $(KDIR_TMP)/empty.bin \
  633. -x 32 -a 0x10000 -x -32 -f $(KDIR)/root.$(1)
  634. -$(STAGING_DIR_HOST)/bin/addpattern -B $(2) -v v$(5) \
  635. -i $(KDIR)/image.tmp \
  636. -o $(call sysupname,$(1),$(2))
  637. $(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/image.tmp -f $(KDIR_TMP)/vmlinux-$(2).uImage \
  638. -x 32 -a 0x10000 -x -32 -f $(KDIR)/root.$(1)
  639. -$(STAGING_DIR_HOST)/bin/addpattern -B $(2) -v v$(5) -g \
  640. -i $(KDIR)/image.tmp \
  641. -o $(call factoryname,$(1),$(2))
  642. rm $(KDIR)/image.tmp
  643. endef
  644. Image/Build/CyberTANGZIP/loader=$(call Image/BuildLoader,$(1),gz,$(2),0x80060000)
  645. Image/Build/CyberTANGZIP/buildkernel=$(call MkuImage,gzip,,$(KDIR)/loader-$(2).gz,$(KDIR_TMP)/vmlinux-$(2).uImage)
  646. Image/Build/CyberTANGZIP=$(call Image/Build/CyberTAN,$(1),$(2),$(3),$(4),$(5))
  647. Image/Build/CyberTANLZMA/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  648. Image/Build/CyberTANLZMA=$(call Image/Build/CyberTAN,$(1),$(2),$(3),$(4),$(5))
  649. Image/Build/Netgear/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
  650. define Image/Build/Netgear/buildkernel
  651. $(call MkuImageLzma,$(2),$(3) $(4),-d20,,-M $(5))
  652. -rm -rf $(KDIR_TMP)/$(2)
  653. mkdir -p $(KDIR_TMP)/$(2)/image
  654. cat $(KDIR_TMP)/vmlinux-$(2).uImage > $(KDIR_TMP)/$(2)/image/uImage
  655. $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
  656. $(KDIR_TMP)/$(2) $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp1 \
  657. -noappend -root-owned -be -b 65536 \
  658. $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
  659. ( \
  660. cat $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp1; \
  661. dd if=/dev/zero bs=1k count=1 \
  662. ) > $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp2
  663. mkimage -A mips -O linux -T filesystem -C none -M $(5) \
  664. -a 0xbf070000 -e 0xbf070000 \
  665. -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
  666. -d $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp2 \
  667. $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs
  668. endef
  669. define Image/Build/Netgear
  670. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  671. $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage.squashfs,0,$(KDIR)/root.$(1),$(fwsize),$(call sysupname,$(1),$(2)),64)
  672. if [ -e $(call sysupname,$(1),$(2)) ]; then \
  673. for r in $(7) ; do \
  674. [ -n "$$$$r" ] && dashr="-$$$$r" || dashr= ; \
  675. $(STAGING_DIR_HOST)/bin/mkdniimg \
  676. -B $(6) -v OpenWrt.$(REVISION) -r "$$$$r" $(8) \
  677. -i $(call sysupname,$(1),$(2)) \
  678. -o $(call imgname,$(1),$(2))-factory$$$$dashr.img; \
  679. done; \
  680. fi
  681. endef
  682. Image/Build/NetgearLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
  683. Image/Build/NetgearLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4),-d20,,-M $(5))
  684. define Image/Build/NetgearLzma
  685. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  686. $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage,0,$(KDIR)/root.$(1),$(fwsize),$(call sysupname,$(1),$(2)),64)
  687. endef
  688. Image/Build/NetgearNAND/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
  689. # $(1): (empty)
  690. # $(2): Board name (small caps)
  691. # $(3): Kernel board specific cmdline
  692. # $(4): Kernel mtdparts definition
  693. # $(5): U-Boot magic
  694. define Image/Build/NetgearNAND/buildkernel
  695. $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
  696. $(call PatchKernelLzma,$(2),$(3) $(4),-d20)
  697. dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma \
  698. of=$(KDIR_TMP)/vmlinux-$(2).bin.tmp \
  699. bs=$$$$(($(kernelsize)-131072-2*64-1)) \
  700. count=1 conv=sync
  701. $(call MkuImage,lzma,-M $(5),$(KDIR_TMP)/vmlinux-$(2).bin.tmp,$(KDIR_TMP)/vmlinux-$(2).uImage)
  702. echo -ne '\xff' >> $(KDIR_TMP)/vmlinux-$(2).uImage
  703. # create a fake rootfs image
  704. dd if=/dev/zero of=$(KDIR_TMP)/fakeroot-$(2) bs=131072 count=1
  705. mkimage -A mips -O linux -T filesystem -C none \
  706. -a 0xbf070000 -e 0xbf070000 \
  707. -n 'MIPS OpenWrt fakeroot' \
  708. -d $(KDIR_TMP)/fakeroot-$(2) \
  709. -M $(5) \
  710. $(KDIR_TMP)/fakeroot-$(2).uImage
  711. # append the fake rootfs image to the kernel, it will reside in the last
  712. # erase block of the kernel partition
  713. cat $(KDIR_TMP)/fakeroot-$(2).uImage >> $(KDIR_TMP)/vmlinux-$(2).uImage
  714. endef
  715. # $(1): rootfs image suffix
  716. # $(2): Board name (small caps)
  717. # $(3): Kernel board specific cmdline
  718. # $(4): Kernel mtdparts definition
  719. # $(5): U-Boot magic
  720. # $(6): Board name (upper caps)
  721. # $(7): firmware region code (not used yet)
  722. # $(8): DNI Hardware version
  723. # $(9): suffix of the configuration file for ubinize
  724. define Image/Build/NetgearNAND
  725. $(eval firmwaresize=$(call mtdpartsize,firmware,$(4)))
  726. $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
  727. $(eval imageraw=$(KDIR_TMP)/$(2)-raw.img)
  728. $(CP) $(KDIR)/root.squashfs-raw $(KDIR_TMP)/root.squashfs
  729. echo -ne '\xde\xad\xc0\xde' > $(KDIR_TMP)/jffs2.eof
  730. $(call ubinize,ubinize-$(9).ini,$(KDIR_TMP),$(KDIR_TMP)/$(2)-root.ubi,128KiB,2048,-E 5)
  731. ( \
  732. dd if=$(KDIR_TMP)/vmlinux-$(2).uImage; \
  733. dd if=$(KDIR_TMP)/$(2)-root.ubi \
  734. ) > $(imageraw)
  735. $(STAGING_DIR_HOST)/bin/mkdniimg \
  736. -B $(6) -v OpenWrt.$(REVISION) -r "$$$$r" $(8) \
  737. -i $(imageraw) \
  738. -o $(call imgname,ubi,$(2))-factory.img
  739. $(call Image/Build/SysupgradeNAND,$(2),squashfs,$(KDIR_TMP)/vmlinux-$(2).uImage)
  740. endef
  741. ifdef CONFIG_PACKAGE_uboot-ar71xx-nbg460n_550n_550nh
  742. Image/Build/ZyXEL/buildkernel=$(call MkuImageLzma,$(2),$(3))
  743. define Image/Build/ZyXEL
  744. $(call Sysupgrade/KRuImage,$(1),$(2),917504,2752512)
  745. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  746. if [ ! -f $(BIN_DIR)/$(IMG_PREFIX)-$(2)-u-boot.bin ]; then \
  747. echo "Warning: $(IMG_PREFIX)-$(2)-u-boot.bin not found" >&2; \
  748. else \
  749. $(STAGING_DIR_HOST)/bin/mkzynfw \
  750. -B $(4) \
  751. -b $(BIN_DIR)/$(IMG_PREFIX)-$(2)-u-boot.bin \
  752. -r $(call sysupname,$(1),$(2)):0x10000 \
  753. -o $(call factoryname,$(1),$(2)); \
  754. fi; fi
  755. endef
  756. endif
  757. define Image/Build/ZyXELNAND/buildkernel
  758. $(eval kernelsize=$(call mtdpartsize,kernel,$(5)))
  759. $(call MkuImageLzma,$(2),$(3) $(5) $(6))
  760. mkdir -p $(KDIR_TMP)/$(2)/image/boot
  761. cp $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR_TMP)/$(2)/image/boot/vmlinux.lzma.uImage
  762. $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
  763. --pad=$(kernelsize) --big-endian --squash-uids -v -e 128KiB \
  764. -o $(KDIR_TMP)/$(2)-kernel.jffs2 \
  765. -d $(KDIR_TMP)/$(2)/image \
  766. 2>&1 1>/dev/null | awk '/^.+$$$$/'
  767. -rm -rf $(KDIR_TMP)/$(2)
  768. endef
  769. define Image/Build/ZyXELNAND
  770. if [ "$(1)" != "squashfs" ]; then \
  771. echo Only squashfs is supported; \
  772. return 0; \
  773. fi
  774. $(eval firmwaresize=$(call mtdpartsize,firmware,$(4)))
  775. $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
  776. $(eval imageraw=$(KDIR_TMP)/$(2)-raw.img)
  777. $(CP) $(KDIR)/root.$(1) $(KDIR_TMP)/ubi_root.img
  778. $(call ubinize,ubinize-$(2).ini,$(KDIR_TMP),$(KDIR_TMP)/$(2)-root.ubi,128KiB,2048,-E 5)
  779. ( \
  780. dd if=$(KDIR_TMP)/$(2)-kernel.jffs2; \
  781. dd if=$(KDIR_TMP)/$(2)-root.ubi \
  782. ) > $(imageraw)
  783. dd if=$(imageraw) of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory.bin \
  784. bs=128k conv=sync
  785. $(call Image/Build/SysupgradeNAND,$(2),squashfs,$(KDIR_TMP)/$(2)-kernel.jffs2)
  786. endef
  787. Image/Build/OpenMesh/buildkernel=$(call MkuImageLzma,$(2))
  788. Image/Build/OpenMesh/initramfs=$(call MkuImageLzma/initramfs,$(2),)
  789. define Image/Build/OpenMesh
  790. -sh $(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \
  791. "$(4)" \
  792. "$(BUILD_DIR)/fwupgrade.cfg-$(4)" \
  793. "$(KDIR_TMP)/vmlinux-$(2).uImage" \
  794. "$(KDIR)/root.$(1)"
  795. -sh $(TOPDIR)/scripts/combined-ext-image.sh \
  796. "$(4)" "$(call factoryname,$(1),$(2))" \
  797. "$(BUILD_DIR)/fwupgrade.cfg-$(4)" "fwupgrade.cfg" \
  798. "$(KDIR_TMP)/vmlinux-$(2).uImage" "kernel" \
  799. "$(KDIR)/root.$(1)" "rootfs"
  800. if [ -e "$(call factoryname,$(1),$(2))" ]; then \
  801. cp "$(call factoryname,$(1),$(2))" "$(call sysupname,$(1),$(2))"; \
  802. fi
  803. endef
  804. Image/Build/Zcomax/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  805. Image/Build/Zcomax/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  806. define Image/Build/Zcomax
  807. $(call Sysupgrade/RKuImage,$(1),$(2),1507328,6356992)
  808. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  809. $(STAGING_DIR_HOST)/bin/mkzcfw \
  810. -B $(2) \
  811. -k $(KDIR_TMP)/vmlinux-$(2).uImage \
  812. -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
  813. -o $(call imgname,$(1),$(2))-factory.img; \
  814. fi
  815. endef
  816. # $(1): template name to be defined, etc. squashfs-only, 64k, 64kraw, etc.
  817. # $(2): jffs2 blocksize.
  818. define Jffs2Template
  819. define Image/Build/Template/$(1)/jffs2-$(2)
  820. $$(call Image/Build/$$(1),jffs2-$(2),$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
  821. endef
  822. endef
  823. # $(1): template name to be defined.
  824. # $(2): squashfs suffix to be used.
  825. # $(3): jffs2 suffix to be used.
  826. define BuildTemplate
  827. # $(1) : name of build method.
  828. # $(2) : board name.
  829. # $(3) : kernel command line.
  830. # $(4)~$(8): extra arguments.
  831. define Image/Build/Template/$(1)/initramfs
  832. $$(call Image/Build/$$(1)/initramfs,initramfs,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
  833. endef
  834. define Image/Build/Template/$(1)/loader
  835. $$(call Image/Build/$$(1)/loader,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
  836. endef
  837. define Image/Build/Template/$(1)/buildkernel
  838. $$(call Image/Build/$$(1)/buildkernel,,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
  839. endef
  840. define Image/Build/Template/$(1)/squashfs
  841. $$(call Image/Build/$$(1),squashfs$(2),$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
  842. endef
  843. $(if $(3),$(foreach bs,$(3),$(eval $(call Jffs2Template,$(1),$(bs)))))
  844. endef
  845. $(eval $(call BuildTemplate,squashfs-only))
  846. $(eval $(call BuildTemplate,64k,-64k,64k))
  847. $(eval $(call BuildTemplate,64kraw,-raw,64k))
  848. $(eval $(call BuildTemplate,64kraw-nojffs,-raw))
  849. $(eval $(call BuildTemplate,128k,,128k))
  850. $(eval $(call BuildTemplate,128kraw,-raw,128k))
  851. $(eval $(call BuildTemplate,256k,,256k))
  852. $(eval $(call BuildTemplate,all,,64k 128k 256k))
  853. ifeq ($(SUBTARGET),generic)
  854. $(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))
  855. $(eval $(call SingleProfile,ALFA,64k,HORNETUB,hornet-ub,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,kernel_image,rootfs_image))
  856. $(eval $(call SingleProfile,ALFA,64k,TUBE2H8M,tube2h-8M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,kernel.image,rootfs.image))
  857. $(eval $(call SingleProfile,AthGzip,64k,AP81,ap81,AP81,ttyS0,115200,$$(ap81_mtdlayout),RKuImage))
  858. $(eval $(call SingleProfile,AthGzip,64k,AP83,ap83,AP83,ttyS0,115200,$$(ap83_mtdlayout),RKuImage))
  859. $(eval $(call SingleProfile,AthGzip,64k,AP96,ap96,AP96,ttyS0,115200,$$(ap96_mtdlayout),RKuImage))
  860. $(eval $(call SingleProfile,AthGzip,64k,WNDAP360,wndap360,WNDAP360,ttyS0,9600,$$(wndap360_mtdlayout),KRuImage))
  861. $(eval $(call SingleProfile,AthLzma,64k,ALFAAP120C,alfa-ap120c,ALFA-AP120C,ttyS0,115200,$$(alfa_ap120c_mtdlayout),RKuImage))
  862. $(eval $(call SingleProfile,AthLzma,64k,ALFAAP96,alfa-ap96,ALFA-AP96,ttyS0,115200,$$(alfa_ap96_mtdlayout),RKuImage))
  863. $(eval $(call SingleProfile,AthLzma,64k,ALL0258N,all0258n,ALL0258N,ttyS0,115200,$$(all0258n_mtdlayout),KRuImage,65536))
  864. $(eval $(call SingleProfile,AthLzma,256k,ALL0315N,all0315n,ALL0315N,ttyS0,115200,$$(all0315n_mtdlayout),KRuImage,262144))
  865. $(eval $(call SingleProfile,AthLzma,64k,ANONABOX_PRO,anonabox-pro-16M,ANONABOX_PRO,ttyS0,115200,$$(anonabox_pro_mtdlayout_16M),RKuImage))
  866. $(eval $(call SingleProfile,AthLzma,64k,AP113,ap113,AP113,ttyS0,115200,$$(ap113_mtd_layout),RK))
  867. $(eval $(call SingleProfile,AthLzma,64k,AP121_2M,ap121-2M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_2M),RKuImage))
  868. $(eval $(call SingleProfile,AthLzma,64k,AP121_4M,ap121-4M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_4M),RKuImage))
  869. $(eval $(call SingleProfile,AthLzma,64k,AP121_8M,ap121-8M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_8M),RKuImage))
  870. $(eval $(call SingleProfile,AthLzma,64k,AP121_16M,ap121-16M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_16M),RKuImage))
  871. $(eval $(call SingleProfile,AthLzma,64k,AP121MINI,ap121-mini,AP121-MINI,ttyATH0,115200,$$(ap121_mtdlayout_4M),RKuImage))
  872. $(eval $(call SingleProfile,AthLzma,64k,AP132,ap132,AP132,ttyS0,115200,$$(ap132_mtdlayout),KRuImage))
  873. $(eval $(call SingleProfile,AthLzma,64k,AP135,ap135-020,AP135-020,ttyS0,115200,$$(ap135_mtdlayout),RKuImage))
  874. $(eval $(call SingleProfile,AthLzma,64k,AP136_010,ap136-010,AP136-010,ttyS0,115200,$$(ap136_mtdlayout),RKuImage))
  875. $(eval $(call SingleProfile,AthLzma,64k,AP136_020,ap136-020,AP136-020,ttyS0,115200,$$(ap136_mtdlayout),RKuImage))
  876. $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(ap143_mtdlayout_8M),RKuImage))
  877. $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
  878. $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
  879. $(eval $(call SingleProfile,AthLzma,64k,AP152_16M,ap152-16M,AP152,ttyS0,115200,$$(ap152_mtdlayout_16M),RKuImage))
  880. $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
  881. $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
  882. $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
  883. $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
  884. $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
  885. $(eval $(call SingleProfile,AthLzma,64k,EWDORINRT,ew-dorin-router,EW-DORIN-ROUTER,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
  886. $(eval $(call SingleProfile,AthLzma,64k,EWDORIN16M,ew-dorin-16M,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_16M),KRuImage,65536))
  887. $(eval $(call SingleProfile,AthLzma,64k,HORNETUBx2,hornet-ub-x2,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
  888. $(eval $(call SingleProfile,AthLzma,64k,MR12,mr12,MR12,ttyS0,115200,$$(mr12_mtdlayout),RKuImage))
  889. $(eval $(call SingleProfile,AthLzma,64k,MR16,mr16,MR16,ttyS0,115200,$$(mr16_mtdlayout),RKuImage))
  890. $(eval $(call SingleProfile,AthLzma,64k,PB92,pb92,PB92,ttyS0,115200,$$(pb92_mtdlayout),KRuImage))
  891. $(eval $(call SingleProfile,AthLzma,64k,TUBE2H16M,tube2h-16M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
  892. $(eval $(call SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$(wlr8100_mtdlayout),KRuImage))
  893. $(eval $(call SingleProfile,AthLzma,64k,WPJ342_16M,wpj342-16M,WPJ342,ttyS0,115200,$$(wpj342_mtdlayout_16M),KRuImage,65536))
  894. $(eval $(call SingleProfile,AthLzma,64k,WPJ344_16M,wpj344-16M,WPJ344,ttyS0,115200,$$(wpj344_mtdlayout_16M),KRuImage,65536))
  895. $(eval $(call SingleProfile,AthLzma,64k,DR344,dr344,DR344,ttyS0,115200,$$(dr344_mtdlayout),RKuImage))
  896. $(eval $(call SingleProfile,AthLzma,64k,WPJ531_16M,wpj531-16M,WPJ531,ttyS0,115200,$$(wpj531_mtdlayout_16M),KRuImage,65536))
  897. $(eval $(call SingleProfile,AthLzma,64k,WPJ558_16M,wpj558-16M,WPJ558,ttyS0,115200,$$(wpj558_mtdlayout_16M),KRuImage,65536))
  898. $(eval $(call SingleProfile,AthLzma,64k,WRTNODE2Q,wrtnode2q,WRTNODE2Q,ttyS0,115200,$$(wrtnode2q_mtdlayout),KRuImage))
  899. $(eval $(call SingleProfile,AthLzma,64k,YUN_8M,yun-8M,Yun,ttyATH0,250000,$$(yun_mtdlayout_8M),RKuImage))
  900. $(eval $(call SingleProfile,AthLzma,64k,YUN_16M,yun-16M,Yun,ttyATH0,250000,$$(yun_mtdlayout_16M),RKuImage))
  901. $(eval $(call SingleProfile,Belkin,64k,F9K1115V2,f9k1115v2,F9K1115V2,ttyS0,115200,$$(f9k1115v2_mtdlayout),BR-6679BAC))
  902. $(eval $(call SingleProfile,CameoAP91,64kraw,DIR600A1,dir-600-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-00"))
  903. $(eval $(call SingleProfile,CameoAP91,64kraw,DIR601A1,dir-601-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-02"))
  904. $(eval $(call SingleProfile,CameoAP91,64kraw,FR54RTR,fr-54rtr,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-01"))
  905. $(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E1,dir-615-e1,DIR-615-E1,ttyS0,115200,"AP93-AR7240-RT-081028-00"))
  906. $(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E4,dir-615-e4,DIR-615-E4,ttyS0,115200,"AP99-AR7240-RT-091105-05"))
  907. $(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I1,dir-615-i1,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-1012I1-00"))
  908. $(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I3,dir-615-i3,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-101214-00"))
  909. $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,A02RBW300N,a02-rb-w300n,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-03"))
  910. $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,DIR615C1,dir-615-c1,DIR-615-C1,ttyS0,115200,"AP81-AR9130-RT-070614-02"))
  911. $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW632BRP,tew-632brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-00"))
  912. $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_FW,tew-652brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-080609-05"))
  913. $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_RECOVERY,tew-652brp-recovery,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-02"))
  914. $(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,TEW712BR,tew-712br,TEW-712BR,ttyATH0,115200,"HORNET-RT-TEW712BR-3",1.99,""))
  915. $(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,DIR601B1,dir-601-b1,TEW-712BR,ttyATH0,115200,"HORNET-RT-DIR601B1-3",2.99.99,"" "NA"))
  916. $(eval $(call SingleProfile,CameoAP121_8M,64kraw-nojffs,DIR505A1,dir-505-a1,DIR-505-A1,ttyATH0,115200,"HORNET-PACKET-DIR505A1-3",1.99.99,""))
  917. $(eval $(call SingleProfile,CameoAP135,64kraw,DGL5500A1,dgl-5500-a1,DGL-5500-A1,ttyS0,115200,$$(dgl_5500_mtdlayout),"00AP135AR9558-RT-130508-00"))
  918. $(eval $(call SingleProfile,CameoAP135,64kraw,TEW823DRU,tew-823dru,TEW-823DRU,ttyS0,115200,$$(tew823dru_mtdlayout) mem=256M,"00AP135AR9558-RT-131129-00"))
  919. $(eval $(call SingleProfile,CameoDB120,64kraw,DHP1565A1,dhp-1565-a1,DHP-1565-A1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
  920. $(eval $(call SingleProfile,CameoDB120,64kraw,DIR825C1,dir-825-c1,DIR-825-C1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
  921. $(eval $(call SingleProfile,CameoDB120,64kraw,DIR835A1,dir-835-a1,DIR-835-A1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
  922. $(eval $(call SingleProfile,CameoDB120_8M,64kraw,TEW732BR,tew-732br,TEW-732BR,ttyS0,115200,"00DB120AR9341-RT-120906-NA"))
  923. $(eval $(call SingleProfile,CyberTANGZIP,64k,WRT160NL,wrt160nl,WRT160NL,ttyS0,115200,,1.00.01))
  924. $(eval $(call SingleProfile,CyberTANGZIP,64k,E2100L,e2100l,E2100L,ttyS0,115200,,1.00.01))
  925. $(eval $(call SingleProfile,CyberTANLZMA,64k,MYNETREXT,mynet-rext,MYNET-REXT,ttyS0,115200,$$(mynet_rext_mtdlayout) root=31:2,1.00.01))
  926. $(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))
  927. $(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))
  928. $(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))
  929. $(eval $(call SingleProfile,dLANLzma,64k,dLAN_Hotspot,dlan-hotspot,dLAN-Hotspot,ttyATH0,115200,$$(dlan_hotspot_mtdlayout) mem=64M,KRuImage,65536))
  930. $(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,65536))
  931. $(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,65536))
  932. $(eval $(call SingleProfile,EnGenius,64k,ESR900,esr900,ESR900,ttyS0,115200,$$(esr900_mtdlayout),KRuImage,,0x4e))
  933. $(eval $(call SingleProfile,EnGenius,64k,ESR1750,esr1750,ESR1750,ttyS0,115200,$$(esr1750_mtdlayout),KRuImage,,0x61))
  934. $(eval $(call SingleProfile,EnGenius,64k,EPG5000,epg5000,EPG5000,ttyS0,115200,$$(epg5000_mtdlayout),KRuImage,,0x71))
  935. $(eval $(call SingleProfile,MyLoader,64k,WP543_2M,wp543,,ttyS0,115200,0x200000,2M))
  936. $(eval $(call SingleProfile,MyLoader,64k,WP543_4M,wp543,,ttyS0,115200,0x400000,4M))
  937. $(eval $(call SingleProfile,MyLoader,64k,WP543_8M,wp543,,ttyS0,115200,0x800000,8M))
  938. $(eval $(call SingleProfile,MyLoader,64k,WP543_16M,wp543,,ttyS0,115200,0x1000000,16M))
  939. $(eval $(call SingleProfile,MyLoader,64k,WPE72_4M,wpe72,,ttyS0,115200,0x400000,4M))
  940. $(eval $(call SingleProfile,MyLoader,64k,WPE72_8M,wpe72,,ttyS0,115200,0x800000,8M))
  941. $(eval $(call SingleProfile,MyLoader,64k,WPE72_16M,wpe72,,ttyS0,115200,0x1000000,16M))
  942. $(eval $(call SingleProfile,Netgear,64kraw,WNR2000V3,wnr2000v3,WNR2000V3,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303033,WNR2000V3,"" NA,-H 29763551+04+32))
  943. $(eval $(call SingleProfile,NetgearLzma,64kraw,WNR2000V4,wnr2000v4,WNR2000V4,ttyS0,115200,$$(wnr2000v4_mtdlayout),0x32303034,WNR2000V4,"" NA,))
  944. $(eval $(call SingleProfile,Netgear,64kraw,WNR2200,wnr2200,WNR2200,ttyS0,115200,$$(wnr2200_mtdlayout),0x32323030,wnr2200,"" NA,))
  945. $(eval $(call SingleProfile,Netgear,64kraw,REALWNR612V2,wnr612v2,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,WNR612V2,"",))
  946. $(eval $(call SingleProfile,Netgear,64kraw,N150R,n150r,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,N150R,"",))
  947. $(eval $(call SingleProfile,Netgear,64kraw,REALWNR1000V2,wnr1000v2,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303031,WNR1000V2,"",))
  948. $(eval $(call SingleProfile,Netgear,64kraw,WNR1000V2_VC,wnr1000v2-vc,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303030,WNR1000V2-VC,"",))
  949. $(eval $(call SingleProfile,Netgear,64kraw,WPN824N,wpn824n,WPN824N,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31313030,WPN824N,"" NA,))
  950. $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2p,,,,OM2P))
  951. $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5P,om5p,,,,OM5P))
  952. $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5PAC,om5pac,,,,OM5PAC))
  953. $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR600,mr600,,,,MR600))
  954. $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR900,mr900,,,,MR900))
  955. $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR1750,mr1750,,,,MR1750))
  956. $(eval $(call SingleProfile,PB4X,128k,ALL0305,all0305,ALL0305,ttyS0,115200))
  957. $(eval $(call SingleProfile,PB4X,128k,EAP7660D,eap7660d,EAP7660D,ttyS0,115200))
  958. $(eval $(call SingleProfile,PB4X,64k,JA76PF,ja76pf,JA76PF,ttyS0,115200))
  959. $(eval $(call SingleProfile,PB4X,64k,JA76PF2,ja76pf2,JA76PF2,ttyS0,115200))
  960. $(eval $(call SingleProfile,PB4X,64k,JWAP003,jwap003,JWAP003,ttyS0,115200))
  961. $(eval $(call SingleProfile,PB4X,64k,PB42,pb42,PB42,ttyS0,115200))
  962. $(eval $(call SingleProfile,PB4X,64k,PB44,pb44,PB44,ttyS0,115200))
  963. $(eval $(call SingleProfile,Planex,64kraw,MZKW04NU,mzk-w04nu,MZK-W04NU,ttyS0,115200))
  964. $(eval $(call SingleProfile,Planex,64kraw,MZKW300NH,mzk-w300nh,MZK-W300NH,ttyS0,115200))
  965. $(eval $(call SingleProfile,Seama,64k,MYNETN600,mynet-n600,MYNET-N600,ttyS0,115200,$$(mynet_n600_mtdlayout),wrgnd16_wd_db600,65536,16187392))
  966. $(eval $(call SingleProfile,Seama,64k,MYNETN750,mynet-n750,MYNET-N750,ttyS0,115200,$$(mynet_n600_mtdlayout),wrgnd13_wd_av,65536,16187392))
  967. $(eval $(call SingleProfile,Seama,64k,QIHOO360,qihoo-c301,QIHOO-C301,ttyS0,115200,$$(qihoo_c301_mtdlayout),wrgac26_qihoo360_360rg,65536,16121856))
  968. $(eval $(call SingleProfile,Senao,squashfs-only,EAP300V2,eap300v2,EAP300V2,ttyS0,115200,$$(eap300v2_mtdlayout)))
  969. $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N))
  970. $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPG300N,whr-hp-g300n,WHR-HP-G300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-G300N))
  971. $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPGN,whr-hp-gn,WHR-HP-GN,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-GN))
  972. $(eval $(call SingleProfile,WHRHPG300N,64kraw,WLAEAG300N,wlae-ag300n,WLAE-AG300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WLAE-AG300N))
  973. $(eval $(call SingleProfile,WRT400N,64k,WRT400N,wrt400n,WRT400N,ttyS0,115200))
  974. $(eval $(call SingleProfile,WZRHP128K,128kraw,WZRHPG300NH,wzr-hp-g300nh,WZR-HP-G300NH,ttyS0,115200,WZR-HP-G300NH))
  975. $(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPG300NH2,wzr-hp-g300nh2,WZR-HP-G300NH2,ttyS0,115200,WZR-HP-G300NH2))
  976. $(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPAG300H,wzr-hp-ag300h,WZR-HP-AG300H,ttyS0,115200,WZR-HP-AG300H))
  977. $(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPG450H,wzr-hp-g450h,WZR-HP-G450H,ttyS0,115200,WZR-HP-AG450H))
  978. $(eval $(call SingleProfile,WZRHP64K,64kraw,WZR600DHP,wzr-600dhp,WZR-HP-AG300H,ttyS0,115200,WZR-600DHP))
  979. $(eval $(call SingleProfile,WZRHP64K,64kraw,WZR450HP2,wzr-450hp2,WZR-450HP2,ttyS0,115200,WZR-450HP2))
  980. $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H28,zcn-1523h-2-8,ZCN-1523H-2,ttyS0,115200,$$(zcn1523h_mtdlayout)))
  981. $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H516,zcn-1523h-5-16,ZCN-1523H-5,ttyS0,115200,$$(zcn1523h_mtdlayout)))
  982. $(eval $(call SingleProfile,ZyXEL,64k,NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG460N,ttyS0,115200,NBG-460N))
  983. $(eval $(call MultiProfile,AP121,AP121_2M AP121_4M AP121_8M AP121_16M))
  984. $(eval $(call MultiProfile,AP136,AP136_010 AP136_020))
  985. $(eval $(call MultiProfile,AP143,AP143_8M AP143_16M))
  986. $(eval $(call MultiProfile,AP147,AP147_010))
  987. $(eval $(call MultiProfile,AP152,AP152_16M))
  988. $(eval $(call MultiProfile,DIR615IX,DIR615I1 DIR615I3))
  989. $(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT EWDORIN16M))
  990. $(eval $(call MultiProfile,OPENMESH,OM2P OM5P OM5PAC MR600 MR900 MR1750))
  991. $(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY))
  992. $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
  993. $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
  994. $(eval $(call MultiProfile,WNR1000V2,REALWNR1000V2 WNR1000V2_VC))
  995. $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))
  996. $(eval $(call MultiProfile,WPE72,WPE72_4M WPE72_8M WPE72_16M))
  997. $(eval $(call MultiProfile,WPJ342,WPJ342_16M))
  998. $(eval $(call MultiProfile,WPJ344,WPJ344_16M))
  999. $(eval $(call MultiProfile,WPJ531,WPJ531_16M))
  1000. $(eval $(call MultiProfile,WPJ558,WPJ558_16M))
  1001. $(eval $(call MultiProfile,Yun,YUN_16M YUN_8M))
  1002. $(eval $(call MultiProfile,Minimal,$(SINGLE_PROFILES)))
  1003. $(eval $(call MultiProfile,Madwifi,EAP7660D WP543))
  1004. define LegacyDevice/OM2P
  1005. DEVICE_TITLE := OpenMesh OM2P/OM2Pv2/OM2P-HS/OM2P-HSv2/OM2P-HSv3/OM2P-LC
  1006. DEVICE_PACKAGES := kmod-ath9k om-watchdog
  1007. endef
  1008. LEGACY_DEVICES += OM2P
  1009. endif # ifeq ($(SUBTARGET),generic)
  1010. ifeq ($(SUBTARGET),nand)
  1011. $(eval $(call SingleProfile,NetgearNAND,64k,WNDR3700V4,wndr3700v4,WNDR3700_V4,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR3700v4,"",-H 29763948+128+128,wndr4300))
  1012. $(eval $(call SingleProfile,NetgearNAND,64k,WNDR4300V1,wndr4300,WNDR4300,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR4300,"",-H 29763948+0+128+128+2x2+3x3,wndr4300))
  1013. $(eval $(call SingleProfile,NetgearNAND,64k,R6100,r6100,R6100,ttyS0,115200,$$(r6100_mtdlayout),0x36303030,R6100,"",-H 29764434+0+128+128+2x2+2x2,wndr4300))
  1014. $(eval $(call SingleProfile,ZyXELNAND,128k,NBG6716,nbg6716,NBG6716,ttyS0,115200,NBG6716,$$(zyx_nbg6716_mtdlayout),mem=256M))
  1015. $(eval $(call MultiProfile,WNDR4300,WNDR3700V4 WNDR4300V1))
  1016. endif # ifeq ($(SUBTARGET),nand)
  1017. $(eval $(call MultiProfile,Default,$(SINGLE_PROFILES)))
  1018. define Image/Build/squashfs
  1019. cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-raw
  1020. cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-64k
  1021. $(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR)/root.squashfs-64k 64
  1022. cp $(KDIR)/root.squashfs-64k $(BIN_DIR)/$(IMG_PREFIX)-root.squashfs-64k
  1023. $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
  1024. dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
  1025. endef
  1026. define Image/Build/jffs2
  1027. dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
  1028. endef
  1029. define Image/Build/Initramfs
  1030. $(call Image/Build/Profile/$(IMAGE_PROFILE),initramfs)
  1031. endef
  1032. define Image/Prepare
  1033. gzip -9n -c $(KDIR)/vmlinux > $(KDIR)/vmlinux.bin.gz
  1034. $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
  1035. ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  1036. gzip -9n -c $(KDIR)/vmlinux-initramfs > $(KDIR)/vmlinux-initramfs.bin.gz
  1037. $(call CompressLzma,$(KDIR)/vmlinux-initramfs,$(KDIR)/vmlinux-initramfs.bin.lzma)
  1038. $(call Image/BuildLoader,generic,elf,,,-initramfs)
  1039. endif
  1040. $(call Image/BuildLoader,generic,elf)
  1041. $(call Image/Build/Profile/$(if $(CONFIG_IB),Default,$(IMAGE_PROFILE)),loader)
  1042. endef
  1043. define Image/Prepare/Profile
  1044. $(call Image/Build/Profile/$(1),loader)
  1045. endef
  1046. define Image/Build/Profile
  1047. $(call Image/Build/Profile/$(1),buildkernel)
  1048. $(call Image/Build/Profile/$(1),$(2))
  1049. endef
  1050. # $(1): filesystem type.
  1051. define Image/Build
  1052. $(call Image/Build/$(call rootfs_type,$(1)),$(1))
  1053. $(call Image/Build/Profile/$(IMAGE_PROFILE),$(1))
  1054. endef