1
0

legacy.mk 55 KB

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