1
0

legacy.mk 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058
  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 $(VERSION_DIST) 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. 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)
  234. 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)
  235. 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)
  236. planex_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),128k(art)ro
  237. whrhpg300n_mtdlayout=mtdparts=spi0.0:248k(u-boot)ro,8k(u-boot-env)ro,3712k(firmware),64k(art)ro
  238. wndap360_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),64k(nvram)ro,64k(art)ro
  239. wnr2200_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro
  240. wnr2000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmware),64k(art)ro
  241. wnr2000v3_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmware),64k(art)ro
  242. wnr2000v4_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,3776k(firmware),64k(art)ro
  243. 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)
  244. 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
  245. 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)
  246. 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)
  247. mynet_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro
  248. 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)
  249. define Image/BuildKernel
  250. cp $(KDIR)/vmlinux.elf $(VMLINUX).elf
  251. cp $(KDIR)/vmlinux $(VMLINUX).bin
  252. dd if=$(KDIR)/vmlinux.bin.lzma of=$(VMLINUX).lzma bs=65536 conv=sync
  253. $(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(UIMAGE)-lzma.bin)
  254. cp $(KDIR)/loader-generic.elf $(VMLINUX)-lzma.elf
  255. -mkdir -p $(KDIR_TMP)
  256. endef
  257. define Image/BuildKernel/Initramfs
  258. cp $(KDIR)/vmlinux-initramfs.elf $(VMLINUX)-initramfs.elf
  259. cp $(KDIR)/vmlinux-initramfs $(VMLINUX)-initramfs.bin
  260. dd if=$(KDIR)/vmlinux-initramfs.bin.lzma of=$(VMLINUX)-initramfs.lzma bs=65536 conv=sync
  261. $(call MkuImage,lzma,,$(KDIR)/vmlinux-initramfs.bin.lzma,$(UIMAGE)-initramfs-lzma.bin)
  262. cp $(KDIR)/loader-generic-initramfs.elf $(VMLINUX)-initramfs-lzma.elf
  263. $(call Image/Build/Initramfs)
  264. endef
  265. Image/Build/WRT400N/buildkernel=$(call MkuImageLzma,$(2),$(3))
  266. define Image/Build/WRT400N
  267. $(call Sysupgrade/KRuImage,$(1),$(2),1310720,6488064)
  268. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  269. wrt400n $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR)/root.$(1) $(call factoryname,$(1),$(2)); \
  270. fi
  271. endef
  272. define Image/Build/CameoAP94/buildkernel
  273. $(call MkuImageLzma,$(2),$(3) $(4))
  274. $(call MkuImageLzma,$(2)-fat,$(3) $(5))
  275. endef
  276. define Image/Build/CameoAP94
  277. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  278. $(eval fwsize_fat=$(call mtdpartsize,firmware,$(5)))
  279. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$(($(fwsize)-4*64*1024)),64)
  280. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  281. ( \
  282. dd if=$(call sysupname,$(1),$(2)); \
  283. echo -n "$(6)"; \
  284. ) > $(call imgname,$(1),$(2))-backup-loader.bin; \
  285. if [ `stat -c%s $(call sysupname,$(1),$(2))` -gt 4194304 ]; then \
  286. echo "Warning: $(call sysupname,$(1),$(2)) is too big" >&2; \
  287. else \
  288. ( \
  289. dd if=$(call sysupname,$(1),$(2)) bs=4096k conv=sync; \
  290. echo -n "$(7)"; \
  291. ) > $(call factoryname,$(1),$(2)); \
  292. fi; \
  293. fi
  294. $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2)-fat.uImage,0,$(KDIR)/root.$(1),$$(($(fwsize_fat)-4*64*1024)),$(KDIR_TMP)/$(2)-fat.bin,64)
  295. if [ -e "$(KDIR_TMP)/$(2)-fat.bin" ]; then \
  296. echo -n "" > $(KDIR_TMP)/$(2)-fat.dummy; \
  297. sh $(TOPDIR)/scripts/combined-image.sh \
  298. "$(KDIR_TMP)/$(2)-fat.bin" \
  299. "$(KDIR_TMP)/$(2)-fat.dummy" \
  300. $(call sysupname,$(1),$(2)-fat); \
  301. fi
  302. endef
  303. define Image/Build/WZRHP
  304. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$(($(3)-4*$(4)*1024)),$(4))
  305. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  306. ( \
  307. echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
  308. dd if=$(call sysupname,$(1),$(2)); \
  309. ) > $(call imgname,$(1),$(2))-tftp.bin; \
  310. buffalo-enc -p $(5) -v 1.99 \
  311. -i $(call sysupname,$(1),$(2)) \
  312. -o $(KDIR_TMP)/$(2).enc; \
  313. buffalo-tag -b $(5) -p $(5) -a ath -v 1.99 -m 1.01 -l mlang8 \
  314. -w 3 -c 0x80041000 -d 0x801e8000 -f 1 -r M_ \
  315. -i $(KDIR_TMP)/$(2).enc \
  316. -o $(call factoryname,$(1),$(2)); \
  317. fi
  318. endef
  319. Image/Build/WZRHP64K/buildkernel=$(call MkuImageLzma,$(2),$(3))
  320. Image/Build/WZRHP64K/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  321. Image/Build/WZRHP64K=$(call Image/Build/WZRHP,$(1),$(2),33095680,64,$(4))
  322. Image/Build/WZRHP128K/buildkernel=$(call MkuImageLzma,$(2),$(3))
  323. Image/Build/WZRHP128K/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  324. Image/Build/WZRHP128K=$(call Image/Build/WZRHP,$(1),$(2),33030144,128,$(4))
  325. Image/Build/WHRHPG300N/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  326. Image/Build/WHRHPG300N/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  327. define Image/Build/WHRHPG300N
  328. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  329. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$(($(fwsize)-4*64*1024)),64)
  330. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  331. ( \
  332. echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
  333. dd if=$(call sysupname,$(1),$(2)); \
  334. ) > $(call imgname,$(1),$(2))-tftp.bin; \
  335. buffalo-enc -p $(5) -v 1.99 \
  336. -i $(call sysupname,$(1),$(2)) \
  337. -o $(KDIR_TMP)/$(2).enc; \
  338. buffalo-tag -b $(5) -p $(5) -a ath -v 1.99 -m 1.01 -l mlang8 \
  339. -w 3 -c 0x80041000 -d 0x801e8000 -f 1 -r M_ \
  340. -i $(KDIR_TMP)/$(2).enc \
  341. -o $(call factoryname,$(1),$(2)); \
  342. fi
  343. endef
  344. define Image/Build/Cameo
  345. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  346. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$(($(fwsize)-4*64*1024)),64)
  347. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  348. factory_size=$$(($(fwsize) - $(6))); \
  349. ( \
  350. dd if=$(call sysupname,$(1),$(2)) bs=$${factory_size} conv=sync; \
  351. echo -n $(5); \
  352. ) > $(call factoryname,$(1),$(2)); \
  353. fi
  354. endef
  355. Image/Build/CameoAP81/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap81_mtdlayout))
  356. Image/Build/CameoAP81=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap81_mtdlayout),$(4),65536)
  357. Image/Build/CameoAP81/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap81_mtdlayout))
  358. Image/Build/CameoAP91/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap91_mtdlayout))
  359. Image/Build/CameoAP91=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap91_mtdlayout),$(4),65536)
  360. Image/Build/CameoAP91/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap91_mtdlayout))
  361. Image/Build/CameoAP99/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap99_mtdlayout))
  362. Image/Build/CameoAP99=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap99_mtdlayout),$(4),65536)
  363. Image/Build/CameoAP99/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap99_mtdlayout))
  364. Image/Build/CameoAP123_4M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap123_mtdlayout_4M))
  365. Image/Build/CameoAP123_4M=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap123_mtdlayout_4M),$(4),26)
  366. Image/Build/CameoAP123_4M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap123_mtdlayout_4M))
  367. Image/Build/CameoAP135/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  368. Image/Build/CameoAP135=$(call Image/Build/Cameo,$(1),$(2),$(3),$(4),$(5),26)
  369. Image/Build/CameoAP135/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  370. Image/Build/CameoDB120/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_db120_mtdlayout))
  371. Image/Build/CameoDB120=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_db120_mtdlayout),$(4),26)
  372. Image/Build/CameoDB120/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_db120_mtdlayout))
  373. Image/Build/CameoDB120_8M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_db120_mtdlayout_8M))
  374. Image/Build/CameoDB120_8M=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_db120_mtdlayout_8M),$(4),26)
  375. Image/Build/CameoDB120_8M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_db120_mtdlayout_8M))
  376. define Image/Build/CameoHornet
  377. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  378. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$(($(fwsize)-4*64*1024)),64)
  379. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  380. for r in $(7); do \
  381. [ -n "$$r" ] && dashr="-$$r" || dashr=; \
  382. [ -z "$$r" ] && r="DEF"; \
  383. mkcameofw -M HORNET -R "$$r" -S $(5) -V $(6) -c \
  384. -K $(8) -I $(fwsize) \
  385. -k "$(call sysupname,$(1),$(2))" \
  386. -o $(call imgname,$(1),$(2))-factory$$dashr.bin; \
  387. true; \
  388. done; \
  389. fi
  390. endef
  391. Image/Build/CameoAP121/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap121_mtdlayout))
  392. Image/Build/CameoAP121=$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo_ap121_mtdlayout),$(4),$(5),$(6),0xe0000)
  393. Image/Build/CameoAP121/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap121_mtdlayout))
  394. Image/Build/CameoAP121_8M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap121_mtdlayout_8M))
  395. Image/Build/CameoAP121_8M=$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo_ap121_mtdlayout_8M),$(4),$(5),$(6),0x100000)
  396. Image/Build/CameoAP121_8M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap121_mtdlayout_8M))
  397. define Image/Build/dLAN
  398. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  399. $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
  400. $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
  401. $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
  402. endef
  403. Image/Build/dLANLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  404. Image/Build/dLANLzma=$(call Image/Build/dLAN,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
  405. Image/Build/dLANLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  406. define Image/Build/Ath
  407. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  408. $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
  409. $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
  410. $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
  411. endef
  412. Image/Build/AthGzip/buildkernel=$(call MkuImageGzip,$(2),$(3) $(4))
  413. Image/Build/AthGzip=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
  414. Image/Build/AthGzip/initramfs=$(call MkuImageGzip/initramfs,$(2),$(3) $(4))
  415. Image/Build/AthLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  416. Image/Build/AthLzma=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
  417. Image/Build/AthLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  418. Image/Build/Belkin/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  419. Image/Build/Belkin/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  420. define Image/Build/Belkin
  421. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  422. $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
  423. $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
  424. $(call Sysupgrade/RKuImage,$(1),$(2),$(kernsize),$(rootsize))
  425. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  426. edimax_fw_header -m $(5) -v "$(shell echo -n $(VERSION_DIST)$(REVISION) | cut -c -13)" \
  427. -n "uImage" \
  428. -i $(KDIR_TMP)/vmlinux-$(2).uImage \
  429. -o $(KDIR_TMP)/$(2)-uImage; \
  430. edimax_fw_header -m $(5) -v "$(shell echo -n $(VERSION_DIST)$(REVISION) | cut -c -13)" \
  431. -n "rootfs" \
  432. -i $(KDIR)/root.$(1) \
  433. -o $(KDIR_TMP)/$(2)-rootfs; \
  434. ( \
  435. dd if=$(KDIR_TMP)/$(2)-rootfs; \
  436. dd if=$(KDIR_TMP)/$(2)-uImage; \
  437. ) > "$(call factoryname,$(1),$(2))"; \
  438. fi
  439. endef
  440. define Image/Build/EnGenius
  441. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  442. $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
  443. $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
  444. $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
  445. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  446. mksenaofw -e $(call sysupname,$(1),$(2)) \
  447. -o $(call imgname,$(1),$(2))-factory.dlf \
  448. -r 0x101 -p $(7) -t 2; \
  449. fi
  450. endef
  451. Image/Build/EnGenius/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  452. Image/Build/EnGenius/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  453. Image/Build/PB4X/buildkernel=$(call PatchKernelLzma,$(2),$(3))
  454. define Image/Build/PB4X
  455. dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma \
  456. of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync
  457. dd if=$(KDIR)/root.$(1) \
  458. of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync
  459. -sh $(TOPDIR)/scripts/combined-image.sh \
  460. "$(call imgname,kernel,$(2)).bin" \
  461. "$(call imgname,$(1),$(2)-rootfs).bin" \
  462. $(call sysupname,$(1),$(2))
  463. endef
  464. Image/Build/MyLoader/buildkernel=$(call PatchKernelLzma,$(2),$(3))
  465. Image/Build/MyLoader/initramfs=$(call PatchKernel/initramfs,$(2),$(3))
  466. define Image/Build/MyLoader
  467. $(eval fwsize=$(shell echo $$(($(4)-0x30000-4*64*1024))))
  468. $(eval fwimage=$(KDIR_TMP)/$(2)-$(5)-firmware.bin)
  469. $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).bin.lzma,65536,$(KDIR)/root.$(1),$(fwsize),$(fwimage))
  470. if [ -e "$(fwimage)" ]; then \
  471. $(STAGING_DIR_HOST)/bin/mkmylofw -B $(2) -s $(4) -v \
  472. -p0x00030000:0:al:0x80060000:firmware:$(fwimage) \
  473. $(call imgname,$(1),$(2))-$(5)-factory.img; \
  474. echo -n "" > $(KDIR_TMP)/empty.bin; \
  475. sh $(TOPDIR)/scripts/combined-image.sh \
  476. $(fwimage) $(KDIR_TMP)/empty.bin \
  477. $(call imgname,$(1),$(2))-$(5)-sysupgrade.bin; \
  478. fi
  479. endef
  480. Image/Build/Planex/initramfs=$(call MkuImageGzip/initramfs,$(2),$(3) $(planex_mtdlayout))
  481. Image/Build/Planex/loader=$(call Image/BuildLoaderAlone,$(1),gz,$(2) $(planex_mtdlayout),0x52000,0)
  482. define Image/Build/Planex/buildkernel
  483. [ -e "$(KDIR)/loader-$(2).gz" ]
  484. $(call MkuImageOKLI,$(2))
  485. ( \
  486. dd if=$(KDIR)/loader-$(2).gz bs=8128 count=1 conv=sync; \
  487. dd if=$(KDIR_TMP)/vmlinux-$(2).okli; \
  488. ) > $(KDIR_TMP)/kernel-$(2).bin
  489. $(call MkuImage,gzip,,$(KDIR_TMP)/kernel-$(2).bin,$(KDIR_TMP)/vmlinux-$(2).uImage)
  490. endef
  491. define Image/Build/Planex
  492. $(eval fwsize=$(call mtdpartsize,firmware,$(planex_mtdlayout)))
  493. $(call Sysupgrade/KRuImage,$(1),$(2),0,$$(($(fwsize)-4*64*1024)),64)
  494. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  495. $(STAGING_DIR_HOST)/bin/mkplanexfw \
  496. -B $(2) \
  497. -v 2.00.00 \
  498. -i $(call sysupname,$(1),$(2)) \
  499. -o $(call factoryname,$(1),$(2)); \
  500. fi
  501. endef
  502. Image/Build/ALFA/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  503. Image/Build/ALFA/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  504. define Image/Build/ALFA
  505. $(call Sysupgrade/RKuImage,$(1),$(2),$(5),$(6))
  506. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  507. rm -rf $(KDIR)/$(1); \
  508. mkdir -p $(KDIR)/$(1); \
  509. cd $(KDIR)/$(1); \
  510. cp $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR)/$(1)/$(7); \
  511. cp $(KDIR)/root.$(1) $(KDIR)/$(1)/$(8); \
  512. $(TAR) c \
  513. $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
  514. -C $(KDIR)/$(1) $(7) $(8) \
  515. | gzip -9nc > $(call factoryname,$(1),$(2)); \
  516. ( \
  517. echo WRM7222C | dd bs=32 count=1 conv=sync; \
  518. echo -ne '\xfe'; \
  519. ) >> $(call factoryname,$(1),$(2)); \
  520. fi
  521. endef
  522. Image/Build/Senao/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  523. Image/Build/Senao/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  524. define Image/Build/Senao
  525. mkdir -p $(KDIR_TMP)/$(2)/
  526. touch $(KDIR_TMP)/$(2)/FWINFO-libreCMC-$(REVISION)-$(2)
  527. -$(CP) ./$(2)/* $(KDIR_TMP)/$(2)/
  528. dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
  529. of=$(KDIR_TMP)/$(2)/librecmc-senao-$(2)-uImage-lzma.bin bs=64k conv=sync
  530. dd if=$(KDIR)/root.$(1) \
  531. of=$(KDIR_TMP)/$(2)/librecmc-senao-$(2)-root.$(1) bs=64k conv=sync
  532. ( \
  533. cd $(KDIR_TMP)/$(2)/; \
  534. $(TAR) -c \
  535. $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
  536. * | gzip -9nc > $(call factoryname,$(1),$(2)) \
  537. )
  538. -rm -rf $(KDIR_TMP)/$(2)/
  539. -sh $(TOPDIR)/scripts/combined-image.sh \
  540. $(KDIR_TMP)/vmlinux-$(2).uImage \
  541. $(KDIR)/root.$(1) \
  542. $(call sysupname,$(1),$(2))
  543. endef
  544. define Image/Build/CyberTAN
  545. echo -n '' > $(KDIR_TMP)/empty.bin
  546. -$(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/image.tmp \
  547. -f $(KDIR_TMP)/vmlinux-$(2).uImage -F $(KDIR_TMP)/empty.bin \
  548. -x 32 -a 0x10000 -x -32 -f $(KDIR)/root.$(1) && \
  549. $(STAGING_DIR_HOST)/bin/addpattern -B $(2) -v v$(5) \
  550. -i $(KDIR)/image.tmp \
  551. -o $(call sysupname,$(1),$(2))
  552. -$(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/image.tmp -f $(KDIR_TMP)/vmlinux-$(2).uImage \
  553. -x 32 -a 0x10000 -x -32 -f $(KDIR)/root.$(1) && \
  554. $(STAGING_DIR_HOST)/bin/addpattern -B $(2) -v v$(5) -g \
  555. -i $(KDIR)/image.tmp \
  556. -o $(call factoryname,$(1),$(2))
  557. -rm $(KDIR)/image.tmp
  558. endef
  559. Image/Build/CyberTANGZIP/loader=$(call Image/BuildLoader,$(1),gz,$(2),0x80060000)
  560. Image/Build/CyberTANGZIP/buildkernel=$(call MkuImage,gzip,,$(KDIR)/loader-$(2).gz,$(KDIR_TMP)/vmlinux-$(2).uImage)
  561. Image/Build/CyberTANGZIP=$(call Image/Build/CyberTAN,$(1),$(2),$(3),$(4),$(5))
  562. Image/Build/CyberTANLZMA/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  563. Image/Build/CyberTANLZMA=$(call Image/Build/CyberTAN,$(1),$(2),$(3),$(4),$(5))
  564. Image/Build/Netgear/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
  565. define Image/Build/Netgear/buildkernel
  566. $(call MkuImageLzma,$(2),$(3) $(4),-d20,,-M $(5))
  567. -rm -rf $(KDIR_TMP)/$(2)
  568. mkdir -p $(KDIR_TMP)/$(2)/image
  569. cat $(KDIR_TMP)/vmlinux-$(2).uImage > $(KDIR_TMP)/$(2)/image/uImage
  570. $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
  571. $(KDIR_TMP)/$(2) $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp1 \
  572. -noappend -root-owned -be -b 65536 \
  573. $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
  574. ( \
  575. cat $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp1; \
  576. dd if=/dev/zero bs=1k count=1 \
  577. ) > $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp2
  578. mkimage -A mips -O linux -T filesystem -C none -M $(5) \
  579. -a 0xbf070000 -e 0xbf070000 \
  580. -n 'MIPS $(VERSION_DIST) Linux-$(LINUX_VERSION)' \
  581. -d $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp2 \
  582. $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs
  583. endef
  584. define Image/Build/Netgear
  585. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  586. $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage.squashfs,0,$(KDIR)/root.$(1),$(fwsize),$(call sysupname,$(1),$(2)),64)
  587. if [ -e $(call sysupname,$(1),$(2)) ]; then \
  588. for r in $(7) ; do \
  589. [ -n "$$r" ] && dashr="-$$r" || dashr= ; \
  590. $(STAGING_DIR_HOST)/bin/mkdniimg \
  591. -B $(6) -v $(VERSION_DIST).$(REVISION) -r "$$r" $(8) \
  592. -i $(call sysupname,$(1),$(2)) \
  593. -o $(call imgname,$(1),$(2))-factory$$dashr.img; \
  594. done; \
  595. fi
  596. if [ "$2" = "wnr2000" ]; then \
  597. dd if=$(KDIR)/root.$(1) \
  598. of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
  599. fi
  600. endef
  601. Image/Build/NetgearLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
  602. Image/Build/NetgearLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4),-d20,,-M $(5))
  603. define Image/Build/NetgearLzma
  604. $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
  605. $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage,0,$(KDIR)/root.$(1),$(fwsize),$(call sysupname,$(1),$(2)),64)
  606. endef
  607. Image/Build/NetgearNAND/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
  608. # $(1): (empty)
  609. # $(2): Board name (small caps)
  610. # $(3): Kernel board specific cmdline
  611. # $(4): Kernel mtdparts definition
  612. # $(5): U-Boot magic
  613. define Image/Build/NetgearNAND/buildkernel
  614. $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
  615. $(call PatchKernelLzma,$(2),$(3) $(4),-d20)
  616. dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma \
  617. of=$(KDIR_TMP)/vmlinux-$(2).bin.tmp \
  618. bs=$$(($(kernelsize)-131072-2*64-1)) \
  619. count=1 conv=sync
  620. $(call MkuImage,lzma,-M $(5),$(KDIR_TMP)/vmlinux-$(2).bin.tmp,$(KDIR_TMP)/vmlinux-$(2).uImage)
  621. echo -ne '\xff' >> $(KDIR_TMP)/vmlinux-$(2).uImage
  622. # create a fake rootfs image
  623. dd if=/dev/zero of=$(KDIR_TMP)/fakeroot-$(2) bs=131072 count=1
  624. mkimage -A mips -O linux -T filesystem -C none \
  625. -a 0xbf070000 -e 0xbf070000 \
  626. -n 'MIPS $(VERSION_DIST) fakeroot' \
  627. -d $(KDIR_TMP)/fakeroot-$(2) \
  628. -M $(5) \
  629. $(KDIR_TMP)/fakeroot-$(2).uImage
  630. # append the fake rootfs image to the kernel, it will reside in the last
  631. # erase block of the kernel partition
  632. cat $(KDIR_TMP)/fakeroot-$(2).uImage >> $(KDIR_TMP)/vmlinux-$(2).uImage
  633. endef
  634. # $(1): rootfs image suffix
  635. # $(2): Board name (small caps)
  636. # $(3): Kernel board specific cmdline
  637. # $(4): Kernel mtdparts definition
  638. # $(5): U-Boot magic
  639. # $(6): Board name (upper caps)
  640. # $(7): firmware region code (not used yet)
  641. # $(8): DNI Hardware version
  642. # $(9): suffix of the configuration file for ubinize
  643. define Image/Build/NetgearNAND
  644. $(eval firmwaresize=$(call mtdpartsize,firmware,$(4)))
  645. $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
  646. $(eval imageraw=$(KDIR_TMP)/$(2)-raw.img)
  647. $(CP) $(KDIR)/root.squashfs-raw $(KDIR_TMP)/root.squashfs
  648. echo -ne '\xde\xad\xc0\xde' > $(KDIR_TMP)/jffs2.eof
  649. $(call ubinize,ubinize-$(9).ini,$(KDIR_TMP),$(KDIR_TMP)/$(2)-root.ubi,128KiB,2048,-E 5)
  650. ( \
  651. dd if=$(KDIR_TMP)/vmlinux-$(2).uImage; \
  652. dd if=$(KDIR_TMP)/$(2)-root.ubi \
  653. ) > $(imageraw)
  654. $(STAGING_DIR_HOST)/bin/mkdniimg \
  655. -B $(6) -v $(VERSION_DIST).$(REVISION) -r "$$r" $(8) \
  656. -i $(imageraw) \
  657. -o $(call imgname,ubi,$(2))-factory.img
  658. $(call Image/Build/SysupgradeNAND,$(2),squashfs,$(KDIR_TMP)/vmlinux-$(2).uImage)
  659. endef
  660. ZYXEL_UBOOT = $(KDIR)/u-boot-nbg460n_550n_550nh.bin
  661. ZYXEL_UBOOT_BIN = $(wildcard $(BIN_DIR)/u-boot-nbg460n_550n_550nh/u-boot.bin)
  662. Image/Build/ZyXEL/buildkernel=$(call MkuImageLzma,$(2),$(3))
  663. define Image/Build/ZyXEL
  664. $(call Sysupgrade/KRuImage,$(1),$(2),917504,2752512)
  665. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  666. if [ ! -f $(ZYXEL_UBOOT) ]; then \
  667. echo "Warning: $(ZYXEL_UBOOT) not found" >&2; \
  668. else \
  669. $(STAGING_DIR_HOST)/bin/mkzynfw \
  670. -B $(4) \
  671. -b $(ZYXEL_UBOOT) \
  672. -r $(call sysupname,$(1),$(2)):0x10000 \
  673. -o $(call factoryname,$(1),$(2)); \
  674. fi; fi
  675. endef
  676. define Image/Build/ZyXELNAND/buildkernel
  677. $(eval kernelsize=$(call mtdpartsize,kernel,$(5)))
  678. $(call MkuImageLzma,$(2),$(3) $(5) $(6))
  679. mkdir -p $(KDIR_TMP)/$(2)/image/boot
  680. cp $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR_TMP)/$(2)/image/boot/vmlinux.lzma.uImage
  681. $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
  682. --pad=$(kernelsize) --big-endian --squash-uids -v -e 128KiB \
  683. -o $(KDIR_TMP)/$(2)-kernel.jffs2 \
  684. -d $(KDIR_TMP)/$(2)/image \
  685. 2>&1 1>/dev/null | awk '/^.+$$/'
  686. -rm -rf $(KDIR_TMP)/$(2)
  687. endef
  688. define Image/Build/ZyXELNAND
  689. if [ "$(1)" != "squashfs" ]; then \
  690. echo Only squashfs is supported; \
  691. return 0; \
  692. fi
  693. $(eval firmwaresize=$(call mtdpartsize,firmware,$(4)))
  694. $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
  695. $(eval imageraw=$(KDIR_TMP)/$(2)-raw.img)
  696. $(CP) $(KDIR)/root.$(1) $(KDIR_TMP)/ubi_root.img
  697. $(call ubinize,ubinize-$(2).ini,$(KDIR_TMP),$(KDIR_TMP)/$(2)-root.ubi,128KiB,2048,-E 5)
  698. ( \
  699. dd if=$(KDIR_TMP)/$(2)-kernel.jffs2; \
  700. dd if=$(KDIR_TMP)/$(2)-root.ubi \
  701. ) > $(imageraw)
  702. dd if=$(imageraw) of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory.bin \
  703. bs=128k conv=sync
  704. $(call Image/Build/SysupgradeNAND,$(2),squashfs,$(KDIR_TMP)/$(2)-kernel.jffs2)
  705. endef
  706. Image/Build/OpenMesh/buildkernel=$(call MkuImageLzma,$(2))
  707. Image/Build/OpenMesh/initramfs=$(call MkuImageLzma/initramfs,$(2),)
  708. define Image/Build/OpenMesh
  709. -sh $(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \
  710. "$(4)" \
  711. "$(BUILD_DIR)/fwupgrade.cfg-$(4)" \
  712. "$(KDIR_TMP)/vmlinux-$(2).uImage" \
  713. "$(KDIR)/root.$(1)"
  714. -sh $(TOPDIR)/scripts/combined-ext-image.sh \
  715. "$(4)" "$(call factoryname,$(1),$(2))" \
  716. "$(BUILD_DIR)/fwupgrade.cfg-$(4)" "fwupgrade.cfg" \
  717. "$(KDIR_TMP)/vmlinux-$(2).uImage" "kernel" \
  718. "$(KDIR)/root.$(1)" "rootfs"
  719. if [ -e "$(call factoryname,$(1),$(2))" ]; then \
  720. cp "$(call factoryname,$(1),$(2))" "$(call sysupname,$(1),$(2))"; \
  721. fi
  722. endef
  723. Image/Build/Zcomax/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
  724. Image/Build/Zcomax/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
  725. define Image/Build/Zcomax
  726. $(call Sysupgrade/RKuImage,$(1),$(2),1507328,6356992)
  727. if [ -e "$(call sysupname,$(1),$(2))" ]; then \
  728. $(STAGING_DIR_HOST)/bin/mkzcfw \
  729. -B $(2) \
  730. -k $(KDIR_TMP)/vmlinux-$(2).uImage \
  731. -r $(KDIR)/root.$(1) \
  732. -o $(call imgname,$(1),$(2))-factory.img; \
  733. fi
  734. endef
  735. # $(1): template name to be defined.
  736. # $(2): squashfs suffix to be used.
  737. define BuildTemplate
  738. # $(1) : name of build method.
  739. # $(2) : board name.
  740. # $(3) : kernel command line.
  741. # $(4)~$(8): extra arguments.
  742. define Image/Build/Template/$(1)/initramfs
  743. $$(call Image/Build/$$(1)/initramfs,initramfs,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
  744. endef
  745. define Image/Build/Template/$(1)/loader
  746. $$(call Image/Build/$$(1)/loader,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
  747. endef
  748. define Image/Build/Template/$(1)/buildkernel
  749. $$(call Image/Build/$$(1)/buildkernel,,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
  750. endef
  751. define Image/Build/Template/$(1)/squashfs
  752. $$(call Image/Build/$$(1),squashfs$(2),$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
  753. endef
  754. endef
  755. $(eval $(call BuildTemplate,squashfs-only))
  756. $(eval $(call BuildTemplate,64k,-64k))
  757. $(eval $(call BuildTemplate,64kraw,-raw))
  758. $(eval $(call BuildTemplate,64kraw-nojffs,-raw))
  759. $(eval $(call BuildTemplate,128k))
  760. $(eval $(call BuildTemplate,128kraw,-raw))
  761. $(eval $(call BuildTemplate,256k))
  762. $(eval $(call BuildTemplate,all))
  763. ifeq ($(SUBTARGET),generic)
  764. $(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))
  765. $(eval $(call SingleProfile,ALFA,64k,HORNETUB,hornet-ub,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,kernel_image,rootfs_image))
  766. $(eval $(call SingleProfile,ALFA,64k,TUBE2H8M,tube2h-8M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,kernel.image,rootfs.image))
  767. $(eval $(call SingleProfile,AthGzip,64k,AP96,ap96,AP96,ttyS0,115200,$$(ap96_mtdlayout),RKuImage))
  768. $(eval $(call SingleProfile,AthGzip,64k,WNDAP360,wndap360,WNDAP360,ttyS0,9600,$$(wndap360_mtdlayout),KRuImage,65536))
  769. $(eval $(call SingleProfile,AthLzma,64k,ALFAAP120C,alfa-ap120c,ALFA-AP120C,ttyS0,115200,$$(alfa_ap120c_mtdlayout),RKuImage))
  770. $(eval $(call SingleProfile,AthLzma,64k,ALFAAP96,alfa-ap96,ALFA-AP96,ttyS0,115200,$$(alfa_ap96_mtdlayout),RKuImage))
  771. $(eval $(call SingleProfile,AthLzma,64k,ALL0258N,all0258n,ALL0258N,ttyS0,115200,$$(all0258n_mtdlayout),KRuImage,65536))
  772. $(eval $(call SingleProfile,AthLzma,256k,ALL0315N,all0315n,ALL0315N,ttyS0,115200,$$(all0315n_mtdlayout),KRuImage,262144))
  773. $(eval $(call SingleProfile,AthLzma,64k,AP121_8M,ap121-8M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_8M),RKuImage))
  774. $(eval $(call SingleProfile,AthLzma,64k,AP121_16M,ap121-16M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_16M),RKuImage))
  775. $(eval $(call SingleProfile,AthLzma,64k,AP132,ap132,AP132,ttyS0,115200,$$(ap132_mtdlayout),KRuImage))
  776. $(eval $(call SingleProfile,AthLzma,64k,AP135,ap135-020,AP135-020,ttyS0,115200,$$(ap135_mtdlayout),RKuImage))
  777. $(eval $(call SingleProfile,AthLzma,64k,AP136_010,ap136-010,AP136-010,ttyS0,115200,$$(ap136_mtdlayout),RKuImage))
  778. $(eval $(call SingleProfile,AthLzma,64k,AP136_020,ap136-020,AP136-020,ttyS0,115200,$$(ap136_mtdlayout),RKuImage))
  779. $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(ap143_mtdlayout_8M),RKuImage))
  780. $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
  781. $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
  782. $(eval $(call SingleProfile,AthLzma,64k,AP152_16M,ap152-16M,AP152,ttyS0,115200,$$(ap152_mtdlayout_16M),RKuImage))
  783. $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
  784. $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
  785. $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
  786. $(eval $(call SingleProfile,AthLzma,64k,HORNETUBx2,hornet-ub-x2,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
  787. $(eval $(call SingleProfile,AthLzma,64k,TUBE2H16M,tube2h-16M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
  788. $(eval $(call SingleProfile,CameoAP121_8M,64kraw-nojffs,DIR505A1,dir-505-a1,DIR-505-A1,ttyATH0,115200,"HORNET-PACKET-DIR505A1-3",1.99.99,""))
  789. $(eval $(call SingleProfile,CameoAP135,64kraw,DGL5500A1,dgl-5500-a1,DGL-5500-A1,ttyS0,115200,$$(dgl_5500_mtdlayout),"00AP135AR9558-RT-130508-00"))
  790. $(eval $(call SingleProfile,CameoAP135,64kraw,TEW823DRU,tew-823dru,TEW-823DRU,ttyS0,115200,$$(tew823dru_mtdlayout) mem=256M,"00AP135AR9558-RT-131129-00"))
  791. $(eval $(call SingleProfile,CameoDB120,64kraw,DHP1565A1,dhp-1565-a1,DHP-1565-A1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
  792. $(eval $(call SingleProfile,CameoDB120,64kraw,DIR825C1,dir-825-c1,DIR-825-C1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
  793. $(eval $(call SingleProfile,CameoDB120,64kraw,DIR835A1,dir-835-a1,DIR-835-A1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
  794. $(eval $(call SingleProfile,CameoDB120_8M,64kraw,TEW732BR,tew-732br,TEW-732BR,ttyS0,115200,"00DB120AR9341-RT-120906-NA"))
  795. $(eval $(call SingleProfile,CyberTANGZIP,64k,E2100L,e2100l,E2100L,ttyS0,115200,,1.00.01))
  796. $(eval $(call SingleProfile,CyberTANGZIP,64k,WRT160NL,wrt160nl,WRT160NL,ttyS0,115200,,1.00.01))
  797. $(eval $(call SingleProfile,CyberTANLZMA,64k,MYNETREXT,mynet-rext,MYNET-REXT,ttyS0,115200,$$(mynet_rext_mtdlayout) root=31:2,1.00.01))
  798. $(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))
  799. $(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))
  800. $(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))
  801. $(eval $(call SingleProfile,dLANLzma,64k,dLAN_Hotspot,dlan-hotspot,dLAN-Hotspot,ttyATH0,115200,$$(dlan_hotspot_mtdlayout) mem=64M,KRuImage,65536))
  802. $(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))
  803. $(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))
  804. $(eval $(call SingleProfile,EnGenius,64k,ESR900,esr900,ESR900,ttyS0,115200,$$(esr900_mtdlayout),KRuImage,,0x4e))
  805. $(eval $(call SingleProfile,EnGenius,64k,ESR1750,esr1750,ESR1750,ttyS0,115200,$$(esr1750_mtdlayout),KRuImage,,0x61))
  806. $(eval $(call SingleProfile,EnGenius,64k,EPG5000,epg5000,EPG5000,ttyS0,115200,$$(epg5000_mtdlayout),KRuImage,,0x71))
  807. $(eval $(call SingleProfile,MyLoader,64k,WP543_8M,wp543,,ttyS0,115200,0x800000,8M))
  808. $(eval $(call SingleProfile,MyLoader,64k,WP543_16M,wp543,,ttyS0,115200,0x1000000,16M))
  809. $(eval $(call SingleProfile,MyLoader,64k,WPE72_8M,wpe72,,ttyS0,115200,0x800000,8M))
  810. $(eval $(call SingleProfile,MyLoader,64k,WPE72_16M,wpe72,,ttyS0,115200,0x1000000,16M))
  811. $(eval $(call SingleProfile,Netgear,64kraw,WNR2200,wnr2200,WNR2200,ttyS0,115200,$$(wnr2200_mtdlayout),0x32323030,wnr2200,"" NA,))
  812. $(eval $(call SingleProfile,OpenMesh,squashfs-only,A60,a60,,,,A60))
  813. $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2p,,,,OM2P))
  814. $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5P,om5p,,,,OM5P))
  815. $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5PAC,om5pac,,,,OM5PAC))
  816. $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR600,mr600,,,,MR600))
  817. $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR900,mr900,,,,MR900))
  818. $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR1750,mr1750,,,,MR1750))
  819. $(eval $(call SingleProfile,PB4X,128k,ALL0305,all0305,ALL0305,ttyS0,115200))
  820. $(eval $(call SingleProfile,PB4X,128k,EAP7660D,eap7660d,EAP7660D,ttyS0,115200))
  821. $(eval $(call SingleProfile,PB4X,64k,JA76PF,ja76pf,JA76PF,ttyS0,115200))
  822. $(eval $(call SingleProfile,PB4X,64k,JA76PF2,ja76pf2,JA76PF2,ttyS0,115200))
  823. $(eval $(call SingleProfile,PB4X,64k,JWAP003,jwap003,JWAP003,ttyS0,115200))
  824. $(eval $(call SingleProfile,PB4X,64k,PB42,pb42,PB42,ttyS0,115200))
  825. $(eval $(call SingleProfile,PB4X,64k,PB44,pb44,PB44,ttyS0,115200))
  826. $(eval $(call SingleProfile,Planex,64kraw,MZKW04NU,mzk-w04nu,MZK-W04NU,ttyS0,115200))
  827. $(eval $(call SingleProfile,Planex,64kraw,MZKW300NH,mzk-w300nh,MZK-W300NH,ttyS0,115200))
  828. $(eval $(call SingleProfile,Senao,squashfs-only,EAP300V2,eap300v2,EAP300V2,ttyS0,115200,$$(eap300v2_mtdlayout)))
  829. $(eval $(call SingleProfile,WRT400N,64k,WRT400N,wrt400n,WRT400N,ttyS0,115200))
  830. $(eval $(call SingleProfile,WZRHP128K,128kraw,WZRHPG300NH,wzr-hp-g300nh,WZR-HP-G300NH,ttyS0,115200,WZR-HP-G300NH))
  831. $(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPG300NH2,wzr-hp-g300nh2,WZR-HP-G300NH2,ttyS0,115200,WZR-HP-G300NH2))
  832. $(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPAG300H,wzr-hp-ag300h,WZR-HP-AG300H,ttyS0,115200,WZR-HP-AG300H))
  833. $(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPG450H,wzr-hp-g450h,WZR-HP-G450H,ttyS0,115200,WZR-HP-AG450H))
  834. $(eval $(call SingleProfile,WZRHP64K,64kraw,WZR600DHP,wzr-600dhp,WZR-HP-AG300H,ttyS0,115200,WZR-600DHP))
  835. $(eval $(call SingleProfile,WZRHP64K,64kraw,WZR450HP2,wzr-450hp2,WZR-450HP2,ttyS0,115200,WZR-450HP2))
  836. $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H28,zcn-1523h-2-8,ZCN-1523H-2,ttyS0,115200,$$(zcn1523h_mtdlayout)))
  837. $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H516,zcn-1523h-5-16,ZCN-1523H-5,ttyS0,115200,$$(zcn1523h_mtdlayout)))
  838. endif # ifeq ($(SUBTARGET),generic)
  839. ifeq ($(SUBTARGET),tiny)
  840. $(eval $(call SingleProfile,Belkin,64k,F9K1115V2,f9k1115v2,F9K1115V2,ttyS0,115200,$$(f9k1115v2_mtdlayout),BR-6679BAC))
  841. $(eval $(call SingleProfile,CameoAP91,64kraw,DIR600A1,dir-600-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-00"))
  842. $(eval $(call SingleProfile,CameoAP91,64kraw,DIR601A1,dir-601-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-02"))
  843. $(eval $(call SingleProfile,CameoAP91,64kraw,FR54RTR,fr-54rtr,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-01"))
  844. $(eval $(call SingleProfile,CameoAP99,64kraw,EBR2310C1,ebr-2310-c1,EBR-2310-C1,ttyS0,115200,"AP91-AR7240-RT-090223-03"))
  845. $(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E1,dir-615-e1,DIR-615-E1,ttyS0,115200,"AP93-AR7240-RT-081028-00"))
  846. $(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E4,dir-615-e4,DIR-615-E4,ttyS0,115200,"AP99-AR7240-RT-091105-05"))
  847. $(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I1,dir-615-i1,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-1012I1-00"))
  848. $(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I3,dir-615-i3,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-101214-00"))
  849. $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,A02RBW300N,a02-rb-w300n,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-03"))
  850. $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,DIR615C1,dir-615-c1,DIR-615-C1,ttyS0,115200,"AP81-AR9130-RT-070614-02"))
  851. $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW632BRP,tew-632brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-00"))
  852. $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_FW,tew-652brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-080609-05"))
  853. $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_RECOVERY,tew-652brp-recovery,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-02"))
  854. $(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,TEW712BR,tew-712br,TEW-712BR,ttyATH0,115200,"HORNET-RT-TEW712BR-3",1.99,""))
  855. $(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,DIR601B1,dir-601-b1,TEW-712BR,ttyATH0,115200,"HORNET-RT-DIR601B1-3",2.99.99,"" "NA"))
  856. $(eval $(call SingleProfile,MyLoader,64k,WP543_4M,wp543,,ttyS0,115200,0x400000,4M))
  857. $(eval $(call SingleProfile,MyLoader,64k,WPE72_4M,wpe72,,ttyS0,115200,0x400000,4M))
  858. $(eval $(call SingleProfile,Netgear,64kraw,WNR2000V3,wnr2000v3,WNR2000V3,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303033,WNR2000V3,"" NA,-H 29763551+04+32))
  859. $(eval $(call SingleProfile,NetgearLzma,64kraw,WNR2000V4,wnr2000v4,WNR2000V4,ttyS0,115200,$$(wnr2000v4_mtdlayout),0x32303034,WNR2000V4,"" NA,))
  860. $(eval $(call SingleProfile,Netgear,64kraw,WNR2000,wnr2000,WNR2000,ttyS0,115200,$$(wnr2000_mtdlayout),0x32303031,WNR2000,"" NA,))
  861. $(eval $(call SingleProfile,Netgear,64kraw,REALWNR612V2,wnr612v2,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,WNR612V2,"",))
  862. $(eval $(call SingleProfile,Netgear,64kraw,N150R,n150r,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,N150R,"",))
  863. $(eval $(call SingleProfile,Netgear,64kraw,REALWNR1000V2,wnr1000v2,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303031,WNR1000V2,"",))
  864. $(eval $(call SingleProfile,Netgear,64kraw,WNR1000V2_VC,wnr1000v2-vc,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303030,WNR1000V2-VC,"",))
  865. $(eval $(call SingleProfile,Netgear,64kraw,WPN824N,wpn824n,WPN824N,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31313030,WPN824N,"" NA,))
  866. $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N))
  867. $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPG300N,whr-hp-g300n,WHR-HP-G300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-G300N))
  868. $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPGN,whr-hp-gn,WHR-HP-GN,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-GN))
  869. $(eval $(call SingleProfile,WHRHPG300N,64kraw,WLAEAG300N,wlae-ag300n,WLAE-AG300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WLAE-AG300N))
  870. $(eval $(call SingleProfile,ZyXEL,64k,NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG460N,ttyS0,115200,NBG-460N))
  871. endif # ifeq ($(SUBTARGET),tiny)
  872. ifeq ($(SUBTARGET),nand)
  873. $(eval $(call SingleProfile,NetgearNAND,64k,WNDR3700V4,wndr3700v4,WNDR3700_V4,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR3700v4,"",-H 29763948+128+128,wndr4300))
  874. $(eval $(call SingleProfile,NetgearNAND,64k,WNDR4300V1,wndr4300,WNDR4300,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR4300,"",-H 29763948+0+128+128+2x2+3x3,wndr4300))
  875. $(eval $(call SingleProfile,NetgearNAND,64k,R6100,r6100,R6100,ttyS0,115200,$$(r6100_mtdlayout),0x36303030,R6100,"",-H 29764434+0+128+128+2x2+2x2,wndr4300))
  876. $(eval $(call SingleProfile,ZyXELNAND,128k,NBG6716,nbg6716,NBG6716,ttyS0,115200,NBG6716,$$(zyx_nbg6716_mtdlayout),mem=256M))
  877. endif # ifeq ($(SUBTARGET),nand)
  878. define Image/Build/squashfs
  879. cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-raw
  880. cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-64k
  881. $(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR)/root.squashfs-64k 64
  882. $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
  883. dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
  884. endef
  885. define Image/Prepare
  886. $(if $(wildcard $(ZYXEL_UBOOT_BIN)),cp $(ZYXEL_UBOOT_BIN) $(ZYXEL_UBOOT))
  887. $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
  888. ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
  889. $(call CompressLzma,$(KDIR)/vmlinux-initramfs,$(KDIR)/vmlinux-initramfs.bin.lzma)
  890. $(call Image/BuildLoader,generic,elf,,,-initramfs)
  891. endif
  892. $(call Image/BuildLoader,generic,elf)
  893. endef
  894. define Image/Prepare/Profile
  895. $(call Image/Build/Profile/$(1),loader)
  896. endef
  897. define Image/Build/Profile
  898. $(call Image/Build/Profile/$(1),buildkernel)
  899. $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Image/Build/Profile/$(1),initramfs))
  900. $(call Image/Build/Profile/$(1),$(2))
  901. endef
  902. # $(1): filesystem type.
  903. define Image/Build
  904. $(call Image/Build/$(call rootfs_type,$(1)),$(1))
  905. endef