2
0

legacy.mk 53 KB

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