2
0

legacy.mk 54 KB

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