ar71xx: Add support for wdr7500v3
[openwrt/svn-archive/archive.git] / target / linux / ar71xx / image / Makefile
1 #
2 # Copyright (C) 2008-2011 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 JFFS2_BLOCKSIZE = 64k 128k 256k
9
10 include $(TOPDIR)/rules.mk
11 include $(INCLUDE_DIR)/image.mk
12
13 IMAGE_PROFILE:=$(if $(PROFILE),$(PROFILE),Default)
14
15 KERNEL_LOADADDR = 0x80060000
16
17 DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD_ID NETGEAR_HW_ID CMDLINE CONSOLE IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS
18
19 define Build/netgear-squashfs
20 rm -rf $@.fs $@.squashfs
21 mkdir -p $@.fs/image
22 cp $@ $@.fs/image/uImage
23 $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
24 $@.fs $@.squashfs \
25 -noappend -root-owned -be -b 65536
26 dd if=/dev/zero bs=1k count=1 >> $@.squashfs
27 mkimage \
28 -A mips -O linux -T filesystem -C none \
29 -M $(NETGEAR_KERNEL_MAGIC) \
30 -a 0xbf070000 -e 0xbf070000 \
31 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
32 -d $@.squashfs $@
33 rm -rf $@.squashfs $@.fs
34 endef
35
36 define Build/netgear-uImage
37 $(call Build/uImage,$(1) -M $(NETGEAR_KERNEL_MAGIC))
38 endef
39
40 # combine kernel and rootfs into one image
41 # mktplinkfw <type> <optional extra arguments to mktplinkfw binary>
42 # <type> is "sysupgrade" or "factory"
43 #
44 # -a align the rootfs start on an <align> bytes boundary
45 # -j add jffs2 end-of-filesystem markers
46 # -s strip padding from end of the image
47 # -X reserve <size> bytes in the firmware image (hexval prefixed with 0x)
48 define Build/mktplinkfw
49 -$(STAGING_DIR_HOST)/bin/mktplinkfw \
50 -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) $2 \
51 -m $(TPLINK_HEADER_VERSION) \
52 -k $(word 1,$^) \
53 -r $@ \
54 -o $@.new \
55 -j -X 0x40000 \
56 -a $(call rootfs_align,$(FILESYSTEM)) \
57 $(if $(findstring sysupgrade,$1),-s) && mv $@.new $@ || rm -f $@
58 endef
59
60 # mktplinkfw-initramfs <optional extra arguments to mktplinkfw binary>
61 #
62 # -c combined image
63 define Build/mktplinkfw-initramfs
64 $(STAGING_DIR_HOST)/bin/mktplinkfw \
65 -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) $2 \
66 -m $(TPLINK_HEADER_VERSION) \
67 -k $@ \
68 -o $@.new \
69 -s -S \
70 -c
71 @mv $@.new $@
72 endef
73
74 define Build/loader-common
75 rm -rf $@.src
76 $(MAKE) -C lzma-loader \
77 PKG_BUILD_DIR="$@.src" \
78 TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \
79 KERNEL_CMDLINE="$(CMDLINE)" BOARD="$(BOARDNAME)" \
80 LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
81 $(1) compile loader.gz
82 mv "$@.gz" "$@"
83 rm -rf $@.src
84 endef
85
86 define Build/loader-okli-compile
87 $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS) FLASH_MAX=0)
88 endef
89
90 define Build/loader-kernel
91 $(call Build/loader-common,LOADER_DATA="$@")
92 endef
93
94 define Build/loader-okli
95 dd if=$(KDIR)/loader-$(1).gz bs=7680 conv=sync of="$@.new"
96 cat "$@" >> "$@.new"
97 mv "$@.new" "$@"
98 endef
99
100 define Build/copy-file
101 cat "$(1)" > "$@"
102 endef
103
104 DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION
105
106 # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
107 # UBNT_TYPE e.g. one of (BZ, XM, XW)
108 # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
109
110 # mkubntimage is using the kernel image direct
111 # routerboard creates partitions out of the ubnt header
112 define Build/mkubntimage
113 $(STAGING_DIR_HOST)/bin/mkfwimage \
114 -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-OpenWrt-$(REVISION) \
115 -k $(word 1,$^) \
116 -r $@ \
117 -o $@
118 endef
119
120 # all UBNT XM device expect the kernel image to have 1024k while flash, when
121 # booting the image, the size doesn't matter.
122 define Build/mkubntimage-split
123 dd if=$@ of=$@.old1 bs=1024k count=1
124 dd if=$@ of=$@.old2 bs=1024k skip=1
125 $(STAGING_DIR_HOST)/bin/mkfwimage \
126 -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-OpenWrt-$(REVISION) \
127 -k $@.old1 \
128 -r $@.old2 \
129 -o $@
130 rm $@.old1 $@.old2
131 endef
132
133 define Build/mkubntimage2
134 $(STAGING_DIR_HOST)/bin/mkfwimage2 -f 0x9f000000 \
135 -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-OpenWrt-$(REVISION) \
136 -p jffs2:0x50000:0xf60000:0:0:$@ \
137 -o $@.new
138 @mv $@.new $@
139 endef
140
141 DEVICE_VARS += UBNT_BOARD UBNT_CHIP UBNT_TYPE
142
143 define Build/mkubntkernelimage
144 rm -rf $(KDIR_TMP)/ubnt-$(KERNEL_IMAGE)/image && \
145 mkdir -p $(KDIR_TMP)/ubnt-$(KERNEL_IMAGE)/image && \
146 cp $@ $(KDIR_TMP)/ubnt-$(KERNEL_IMAGE)/image/kernel0 && \
147 $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
148 --pad --big-endian --squash-uids -v -e 64KiB \
149 -o $@.new \
150 -d $(KDIR_TMP)/ubnt-$(KERNEL_IMAGE)/image \
151 2>&1 && \
152 $(STAGING_DIR_HOST)/bin/padjffs2 $@.new -J 64
153 -rm -rf $(KDIR_TMP)/ubnt-$(KERNEL_IMAGE)/image
154 @mv $@.new $@
155 endef
156
157 define Device/Default
158 BOARDNAME :=
159 DEVICE_PROFILE = $$(BOARDNAME)
160 PROFILES = Default Minimal $$(DEVICE_PROFILE)
161 MTDPARTS :=
162 IMAGES := sysupgrade.bin
163 BLOCKSIZE := 64k
164 FILESYSTEMS = $(filter-out jffs2-%,$(TARGET_FILESYSTEMS)) jffs2-$$(BLOCKSIZE)
165 CONSOLE = ttyS0,115200
166 CMDLINE = $$(if $$(BOARDNAME),board=$$(BOARDNAME)) $$(if $$(MTDPARTS),mtdparts=$$(MTDPARTS)) $$(if $$(CONSOLE),console=$$(CONSOLE))
167 KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma
168 COMPILE :=
169 IMAGES := sysupgrade.bin
170 IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
171 endef
172
173 define Device/bsb
174 BOARDNAME = BSB
175 IMAGE_SIZE = 16000k
176 CONSOLE = ttyATH0,115200
177 MTDPARTS = spi0.0:128k(u-boot)ro,64k(u-boot-env)ro,16128k(firmware),64k(art)ro
178 endef
179 TARGET_DEVICES += bsb
180
181 define Device/carambola2
182 BOARDNAME = CARAMBOLA2
183 IMAGE_SIZE = 16000k
184 CONSOLE = ttyATH0,115200
185 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
186 endef
187 TARGET_DEVICES += carambola2
188
189 define Device/cf-e316n-v2
190 BOARDNAME = CF-E316N-V2
191 IMAGE_SIZE = 16192k
192 CONSOLE = ttyS0,115200
193 MTDPARTS = spi0.0:64k(u-boot)ro,64k(art)ro,16192k(firmware),64k(nvram)ro
194 endef
195 TARGET_DEVICES += cf-e316n-v2
196
197 define Device/weio
198 BOARDNAME = WEIO
199 IMAGE_SIZE = 16000k
200 CONSOLE = ttyATH0,115200
201 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
202 endef
203 TARGET_DEVICES += weio
204
205 define Device/wndr3700
206 BOARDNAME = WNDR3700
207 NETGEAR_KERNEL_MAGIC = 0x33373030
208 NETGEAR_BOARD_ID = WNDR3700
209 IMAGE_SIZE = 7680k
210 MTDPARTS = spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,7680k(firmware),64k(art)ro
211 IMAGES := sysupgrade.bin factory.img factory-NA.img
212 KERNEL := kernel-bin | patch-cmdline | lzma -d20 | netgear-uImage lzma
213 IMAGE/default = append-kernel $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs
214 IMAGE/sysupgrade.bin = $$(IMAGE/default) | check-size $$$$(IMAGE_SIZE)
215 IMAGE/factory.img = $$(IMAGE/default) | netgear-dni | check-size $$$$(IMAGE_SIZE)
216 IMAGE/factory-NA.img = $$(IMAGE/default) | netgear-dni NA | check-size $$$$(IMAGE_SIZE)
217 endef
218
219 define Device/wndr3700v2
220 $(Device/wndr3700)
221 NETGEAR_BOARD_ID = WNDR3700v2
222 NETGEAR_KERNEL_MAGIC = 0x33373031
223 NETGEAR_HW_ID = 29763654+16+64
224 IMAGE_SIZE = 15872k
225 MTDPARTS = spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,15872k(firmware),64k(art)ro
226 IMAGES := sysupgrade.bin factory.img
227 endef
228
229 define Device/wndr3800
230 $(Device/wndr3700v2)
231 NETGEAR_BOARD_ID = WNDR3800
232 NETGEAR_HW_ID = 29763654+16+128
233 endef
234
235 define Device/wndr3800ch
236 $(Device/wndr3800)
237 NETGEAR_BOARD_ID = WNDR3800CH
238 endef
239
240 define Device/wndrmac
241 $(Device/wndr3700v2)
242 NETGEAR_BOARD_ID = WNDRMAC
243 endef
244
245 define Device/wndrmacv2
246 $(Device/wndr3800)
247 NETGEAR_BOARD_ID = WNDRMACv2
248 endef
249
250 TARGET_DEVICES += wndr3700 wndr3700v2 wndr3800 wndr3800ch wndrmac wndrmacv2
251
252 define Device/tplink
253 TPLINK_HWREV := 0x1
254 TPLINK_HEADER_VERSION := 1
255 KERNEL := kernel-bin | patch-cmdline | lzma
256 KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | mktplinkfw-initramfs
257 IMAGES := sysupgrade.bin factory.bin
258 IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade
259 IMAGE/factory.bin := append-rootfs | mktplinkfw factory
260 endef
261
262 define Device/tplink-nolzma
263 $(Device/tplink)
264 LOADER_FLASH_OFFS := 0x22000
265 COMPILE := loader-$(1).gz
266 COMPILE/loader-$(1).gz := loader-okli-compile
267 KERNEL := copy-file $(KDIR)/vmlinux.bin.lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1)
268 KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux-initramfs.bin.lzma | loader-kernel | mktplinkfw-initramfs
269 endef
270
271 define Device/tplink-4m
272 $(Device/tplink-nolzma)
273 TPLINK_FLASHLAYOUT := 4M
274 IMAGE_SIZE := 3904k
275 endef
276
277 define Device/tplink-8m
278 $(Device/tplink-nolzma)
279 TPLINK_FLASHLAYOUT := 8M
280 IMAGE_SIZE := 7936k
281 endef
282
283 define Device/tplink-4mlzma
284 $(Device/tplink)
285 TPLINK_FLASHLAYOUT := 4Mlzma
286 IMAGE_SIZE := 3904k
287 endef
288
289 define Device/tplink-8mlzma
290 $(Device/tplink)
291 TPLINK_FLASHLAYOUT := 8Mlzma
292 IMAGE_SIZE := 7936k
293 endef
294
295 define Device/tplink-16mlzma
296 $(Device/tplink)
297 TPLINK_FLASHLAYOUT := 16Mlzma
298 IMAGE_SIZE := 15872k
299 endef
300
301 define Device/tl-wdr4300-v1
302 $(Device/tplink-8mlzma)
303 BOARDNAME = TL-WDR4300
304 DEVICE_PROFILE = TLWDR4300
305 TPLINK_HWID := 0x43000001
306 endef
307
308 define Device/tl-wdr3500-v1
309 $(Device/tl-wdr4300-v1)
310 BOARDNAME = TL-WDR3500
311 TPLINK_HWID := 0x35000001
312 endef
313
314 define Device/tl-wdr3600-v1
315 $(Device/tl-wdr4300-v1)
316 TPLINK_HWID := 0x36000001
317 endef
318
319 define Device/tl-wdr4300-v1-il
320 $(Device/tl-wdr4300-v1)
321 TPLINK_HWID := 0x43008001
322 endef
323
324 define Device/tl-wdr4310-v1
325 $(Device/tl-wdr4300-v1)
326 TPLINK_HWID := 0x43100001
327 endef
328
329 define Device/mw4530r-v1
330 $(Device/tl-wdr4300-v1)
331 TPLINK_HWID := 0x45300001
332 endef
333 TARGET_DEVICES += tl-wdr3500-v1 tl-wdr3600-v1 tl-wdr4300-v1 tl-wdr4300-v1-il tl-wdr4310-v1 mw4530r-v1
334
335 define Device/tl-wdr6500-v2
336 $(Device/tplink-8mlzma)
337 KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma
338 KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | uImage lzma | mktplinkfw-initramfs
339 BOARDNAME = TL-WDR6500-v2
340 DEVICE_PROFILE = TLWDR6500V2
341 TPLINK_HWID := 0x65000002
342 TPLINK_HEADER_VERSION := 2
343 endef
344 TARGET_DEVICES += tl-wdr6500-v2
345
346 define Device/tl-wdr3320-v2
347 $(Device/tplink-4mlzma)
348 BOARDNAME = TL-WDR3320-v2
349 DEVICE_PROFILE = TLWDR3320V2
350 TPLINK_HWID := 0x33200002
351 TPLINK_HEADER_VERSION := 2
352 endef
353 TARGET_DEVICES += tl-wdr3320-v2
354
355 define Device/archer-c5-v1
356 $(Device/tplink-16mlzma)
357 BOARDNAME := ARCHER-C5
358 DEVICE_PROFILE := ARCHERC7
359 TPLINK_HWID := 0xc5000001
360 endef
361
362 define Device/archer-c7-v1
363 $(Device/tplink-8mlzma)
364 BOARDNAME := ARCHER-C7
365 DEVICE_PROFILE := ARCHERC7
366 TPLINK_HWID := 0x75000001
367 endef
368
369 define Device/archer-c7-v2
370 $(Device/tplink-16mlzma)
371 BOARDNAME := ARCHER-C7
372 DEVICE_PROFILE := ARCHERC7
373 TPLINK_HWID := 0xc7000002
374 endef
375
376 define Device/tl-wdr7500-v3
377 $(Device/tplink-8mlzma)
378 BOARDNAME := ARCHER-C7
379 DEVICE_PROFILE := ARCHERC7
380 TPLINK_HWID := 0x75000003
381 endef
382 TARGET_DEVICES += archer-c5-v1 archer-c7-v1 archer-c7-v2 tl-wdr7500-v3
383
384 define Device/antminer-s1
385 $(Device/tplink-8mlzma)
386 BOARDNAME := ANTMINER-S1
387 DEVICE_PROFILE := ANTMINERS1
388 TPLINK_HWID := 0x04440101
389 CONSOLE := ttyATH0,115200
390 endef
391
392 define Device/antminer-s3
393 $(Device/tplink-8mlzma)
394 BOARDNAME := ANTMINER-S3
395 DEVICE_PROFILE := ANTMINERS3
396 TPLINK_HWID := 0x04440301
397 CONSOLE := ttyATH0,115200
398 endef
399
400 define Device/el-m150
401 $(Device/tplink-8mlzma)
402 BOARDNAME := EL-M150
403 DEVICE_PROFILE := ELM150
404 TPLINK_HWID := 0x01500101
405 CONSOLE := ttyATH0,115200
406 endef
407
408 define Device/el-mini
409 $(Device/tplink-8mlzma)
410 BOARDNAME := EL-MINI
411 DEVICE_PROFILE := ELMINI
412 TPLINK_HWID := 0x01530001
413 CONSOLE := ttyATH0,115200
414 endef
415 TARGET_DEVICES += antminer-s1 antminer-s3 el-m150 el-mini
416
417 define Device/gl-inet-6408A-v1
418 $(Device/tplink-8mlzma)
419 BOARDNAME := GL-INET
420 DEVICE_PROFILE := GLINET
421 TPLINK_HWID := 0x08000001
422 CONSOLE := ttyATH0,115200
423 endef
424
425 define Device/gl-inet-6416A-v1
426 $(Device/tplink-16mlzma)
427 BOARDNAME := GL-INET
428 DEVICE_PROFILE := GLINET
429 TPLINK_HWID := 0x08000001
430 CONSOLE := ttyATH0,115200
431 endef
432 TARGET_DEVICES += gl-inet-6408A-v1 gl-inet-6416A-v1
433
434 define Device/rnx-n360rt
435 $(Device/tplink-4m)
436 BOARDNAME := TL-WR941ND
437 DEVICE_PROFILE := RNXN360RT
438 TPLINK_HWID := 0x09410002
439 TPLINK_HWREV := 0x00420001
440 endef
441 TARGET_DEVICES += rnx-n360rt
442
443 define Device/mc-mac1200r
444 $(Device/tplink-8mlzma)
445 BOARDNAME := MC-MAC1200R
446 DEVICE_PROFILE := MAC1200R
447 TPLINK_HWID := 0x12000001
448 endef
449 TARGET_DEVICES += mc-mac1200r
450
451 define Device/minibox-v1
452 $(Device/tplink-16mlzma)
453 BOARDNAME := MINIBOX-V1
454 DEVICE_PROFILE := MINIBOXV1
455 TPLINK_HWID := 0x3C000201
456 CONSOLE := ttyATH0,115200
457 endef
458 TARGET_DEVICES += minibox-v1
459
460 define Device/onion-omega
461 $(Device/tplink-16mlzma)
462 BOARDNAME := ONION-OMEGA
463 DEVICE_PROFILE := OMEGA
464 TPLINK_HWID := 0x04700001
465 CONSOLE := ttyATH0,115200
466 endef
467 TARGET_DEVICES += onion-omega
468
469 define Device/tl-mr10u-v1
470 $(Device/tplink-4mlzma)
471 BOARDNAME := TL-MR10U
472 DEVICE_PROFILE := TLMR10U
473 TPLINK_HWID := 0x00100101
474 CONSOLE := ttyATH0,115200
475 endef
476
477 define Device/tl-mr11u-v1
478 $(Device/tplink-4mlzma)
479 BOARDNAME := TL-MR11U
480 DEVICE_PROFILE := TLMR11U
481 TPLINK_HWID := 0x00110101
482 CONSOLE := ttyATH0,115200
483 endef
484
485 define Device/tl-mr11u-v2
486 $(Device/tplink-4mlzma)
487 BOARDNAME := TL-MR11U
488 DEVICE_PROFILE := TLMR11U
489 TPLINK_HWID := 0x00110102
490 CONSOLE := ttyATH0,115200
491 endef
492
493 define Device/tl-mr12u-v1
494 $(Device/tplink-4mlzma)
495 BOARDNAME := TL-MR13U
496 DEVICE_PROFILE := TLMR12U
497 TPLINK_HWID := 0x00120101
498 CONSOLE := ttyATH0,115200
499 endef
500
501 define Device/tl-mr13u-v1
502 $(Device/tplink-4mlzma)
503 BOARDNAME := TL-MR13U
504 DEVICE_PROFILE := TLMR13U
505 TPLINK_HWID := 0x00130101
506 CONSOLE := ttyATH0,115200
507 endef
508 TARGET_DEVICES += tl-mr10u-v1 tl-mr11u-v1 tl-mr11u-v2 tl-mr12u-v1 tl-mr13u-v1
509
510 define Device/tl-mr3020-v1
511 $(Device/tplink-4mlzma)
512 BOARDNAME := TL-MR3020
513 DEVICE_PROFILE := TLMR3020
514 TPLINK_HWID := 0x30200001
515 CONSOLE := ttyATH0,115200
516 endef
517
518 define Device/tl-mr3040-v1
519 $(Device/tplink-4mlzma)
520 BOARDNAME := TL-MR3040
521 DEVICE_PROFILE := TLMR3040
522 TPLINK_HWID := 0x30400001
523 CONSOLE := ttyATH0,115200
524 endef
525
526 define Device/tl-mr3040-v2
527 $(Device/tplink-4mlzma)
528 BOARDNAME := TL-MR3040-v2
529 DEVICE_PROFILE := TLMR3040
530 TPLINK_HWID := 0x30400002
531 CONSOLE := ttyATH0,115200
532 endef
533
534 define Device/tl-mr3220-v1
535 $(Device/tplink-4m)
536 BOARDNAME := TL-MR3220
537 DEVICE_PROFILE := TLMR3220
538 TPLINK_HWID := 0x32200001
539 endef
540
541 define Device/tl-mr3220-v2
542 $(Device/tplink-4mlzma)
543 BOARDNAME := TL-MR3220-v2
544 DEVICE_PROFILE := TLMR3220
545 TPLINK_HWID := 0x32200002
546 CONSOLE := ttyATH0,115200
547 endef
548
549 define Device/tl-mr3420-v1
550 $(Device/tplink-4m)
551 BOARDNAME := TL-MR3420
552 DEVICE_PROFILE := TLMR3420
553 TPLINK_HWID := 0x34200001
554 endef
555
556 define Device/tl-mr3420-v2
557 $(Device/tplink-4mlzma)
558 BOARDNAME := TL-MR3420-v2
559 DEVICE_PROFILE := TLMR3420
560 TPLINK_HWID := 0x34200002
561 endef
562 TARGET_DEVICES += tl-mr3020-v1 tl-mr3040-v1 tl-mr3040-v2 tl-mr3220-v1 tl-mr3220-v2 tl-mr3420-v1 tl-mr3420-v2
563
564 define Device/tl-wr703n-v1
565 $(Device/tplink-4mlzma)
566 BOARDNAME := TL-WR703N
567 DEVICE_PROFILE := TLWR703
568 TPLINK_HWID := 0x07030101
569 CONSOLE := ttyATH0,115200
570 endef
571
572 define Device/tl-wr710n-v1
573 $(Device/tplink-8mlzma)
574 BOARDNAME := TL-WR710N
575 DEVICE_PROFILE := TLWR710
576 TPLINK_HWID := 0x07100001
577 CONSOLE := ttyATH0,115200
578 endef
579
580 define Device/tl-wr710n-v2
581 $(Device/tplink-4mlzma)
582 BOARDNAME := TL-WR710N
583 DEVICE_PROFILE := TLWR710
584 TPLINK_HWID := 0x07100002
585 CONSOLE := ttyATH0,115200
586 endef
587
588 define Device/tl-wr720n-v3
589 $(Device/tplink-4mlzma)
590 BOARDNAME := TL-WR720N-v3
591 DEVICE_PROFILE := TLWR720
592 TPLINK_HWID := 0x07200103
593 CONSOLE := ttyATH0,115200
594 endef
595
596 define Device/tl-wr720n-v4
597 $(Device/tplink-4mlzma)
598 BOARDNAME := TL-WR720N-v3
599 DEVICE_PROFILE := TLWR720
600 TPLINK_HWID := 0x07200104
601 CONSOLE := ttyATH0,115200
602 endef
603 TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr720n-v3 tl-wr720n-v4
604
605 define Device/tl-wr740n-v1
606 $(Device/tplink-4m)
607 BOARDNAME := TL-WR741ND
608 DEVICE_PROFILE := TLWR740
609 TPLINK_HWID := 0x07400001
610 endef
611
612 define Device/tl-wr740n-v3
613 $(Device/tplink-4m)
614 BOARDNAME := TL-WR741ND
615 DEVICE_PROFILE := TLWR740
616 TPLINK_HWID := 0x07400003
617 endef
618
619 define Device/tl-wr740n-v4
620 $(Device/tplink-4mlzma)
621 BOARDNAME := TL-WR741ND-v4
622 DEVICE_PROFILE := TLWR740
623 TPLINK_HWID := 0x07400004
624 CONSOLE := ttyATH0,115200
625 endef
626
627 define Device/tl-wr740n-v5
628 $(Device/tplink-4mlzma)
629 BOARDNAME := TL-WR741ND-v4
630 DEVICE_PROFILE := TLWR740
631 TPLINK_HWID := 0x07400005
632 CONSOLE := ttyATH0,115200
633 endef
634
635 define Device/tl-wr741nd-v1
636 $(Device/tplink-4m)
637 BOARDNAME := TL-WR741ND
638 DEVICE_PROFILE := TLWR741
639 TPLINK_HWID := 0x07410001
640 endef
641
642 define Device/tl-wr741nd-v2
643 $(Device/tplink-4m)
644 BOARDNAME := TL-WR741ND
645 DEVICE_PROFILE := TLWR741
646 TPLINK_HWID := 0x07410001
647 endef
648
649 define Device/tl-wr741nd-v4
650 $(Device/tplink-4mlzma)
651 BOARDNAME := TL-WR741ND-v4
652 DEVICE_PROFILE := TLWR741
653 TPLINK_HWID := 0x07410004
654 CONSOLE := ttyATH0,115200
655 endef
656
657 define Device/tl-wr741nd-v5
658 $(Device/tplink-4mlzma)
659 BOARDNAME := TL-WR741ND-v4
660 DEVICE_PROFILE := TLWR741
661 TPLINK_HWID := 0x07400005
662 CONSOLE := ttyATH0,115200
663 endef
664
665 define Device/tl-wr743nd-v1
666 $(Device/tplink-4m)
667 BOARDNAME := TL-WR741ND
668 DEVICE_PROFILE := TLWR743
669 TPLINK_HWID := 0x07430001
670 endef
671
672 define Device/tl-wr743nd-v2
673 $(Device/tplink-4mlzma)
674 BOARDNAME := TL-WR741ND-v4
675 DEVICE_PROFILE := TLWR743
676 TPLINK_HWID := 0x07430002
677 CONSOLE := ttyATH0,115200
678 endef
679 TARGET_DEVICES += tl-wr740n-v1 tl-wr740n-v3 tl-wr740n-v4 tl-wr740n-v5 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr741nd-v5 tl-wr743nd-v1 tl-wr743nd-v2
680
681 define Device/tl-wr841nd-v1.5
682 $(Device/tplink-4m)
683 BOARDNAME := TL-WR841N-v1.5
684 DEVICE_PROFILE := TLWR841
685 TPLINK_HWID := 0x08410002
686 TPLINK_HWREV := 2
687 endef
688
689 define Device/tl-wr841nd-v3
690 $(Device/tplink-4m)
691 BOARDNAME := TL-WR941ND
692 DEVICE_PROFILE := TLWR841
693 TPLINK_HWID := 0x08410003
694 TPLINK_HWREV := 3
695 endef
696
697 define Device/tl-wr841nd-v5
698 $(Device/tplink-4m)
699 BOARDNAME := TL-WR741ND
700 DEVICE_PROFILE := TLWR841
701 TPLINK_HWID := 0x08410005
702 endef
703
704 define Device/tl-wr841nd-v7
705 $(Device/tplink-4m)
706 BOARDNAME := TL-WR841N-v7
707 DEVICE_PROFILE := TLWR841
708 TPLINK_HWID := 0x08410007
709 endef
710
711 define Device/tl-wr841n-v8
712 $(Device/tplink-4mlzma)
713 BOARDNAME := TL-WR841N-v8
714 DEVICE_PROFILE := TLWR841
715 TPLINK_HWID := 0x08410008
716 endef
717
718 define Device/tl-wr841n-v9
719 $(Device/tplink-4mlzma)
720 BOARDNAME := TL-WR841N-v9
721 DEVICE_PROFILE := TLWR841
722 TPLINK_HWID := 0x08410009
723 endef
724
725 define Device/tl-wr841n-v10
726 $(Device/tplink-4mlzma)
727 BOARDNAME := TL-WR841N-v9
728 DEVICE_PROFILE := TLWR841
729 TPLINK_HWID := 0x08410010
730 endef
731
732 define Device/tl-wr842n-v1
733 $(Device/tplink-8m)
734 BOARDNAME := TL-MR3420
735 DEVICE_PROFILE := TLWR842
736 TPLINK_HWID := 0x08420001
737 endef
738
739 define Device/tl-wr842n-v2
740 $(Device/tplink-8mlzma)
741 BOARDNAME := TL-WR842N-v2
742 DEVICE_PROFILE := TLWR842
743 TPLINK_HWID := 0x8420002
744 endef
745
746 define Device/tl-wr843nd-v1
747 $(Device/tplink-4mlzma)
748 BOARDNAME := TL-WR841N-v8
749 DEVICE_PROFILE := TLWR843
750 TPLINK_HWID := 0x08430001
751 endef
752
753 define Device/tl-wr847n-v8
754 $(Device/tplink-4mlzma)
755 BOARDNAME := TL-WR841N-v8
756 DEVICE_PROFILE := TLWR841
757 TPLINK_HWID := 0x08470008
758 endef
759 TARGET_DEVICES += tl-wr841nd-v1.5 tl-wr841nd-v3 tl-wr841nd-v5 tl-wr841nd-v7 tl-wr841n-v8 tl-wr841n-v9 tl-wr841n-v10 tl-wr842n-v1 tl-wr842n-v2 tl-wr843nd-v1 tl-wr847n-v8
760
761 define Device/tl-wr941nd-v2
762 $(Device/tplink-4m)
763 BOARDNAME := TL-WR941ND
764 DEVICE_PROFILE := TLWR941
765 TPLINK_HWID := 0x09410002
766 TPLINK_HWREV := 2
767 endef
768
769 define Device/tl-wr941nd-v3
770 $(Device/tplink-4m)
771 BOARDNAME := TL-WR941ND
772 DEVICE_PROFILE := TLWR941
773 TPLINK_HWID := 0x09410002
774 TPLINK_HWREV := 2
775 endef
776
777 define Device/tl-wr941nd-v4
778 $(Device/tplink-4m)
779 BOARDNAME := TL-WR741ND
780 DEVICE_PROFILE := TLWR941
781 TPLINK_HWID := 0x09410004
782 endef
783
784 define Device/tl-wr941nd-v5
785 $(Device/tplink-4mlzma)
786 BOARDNAME := TL-WR941ND-v5
787 DEVICE_PROFILE := TLWR941
788 TPLINK_HWID := 0x09410005
789 endef
790
791 # Chinese version (unlike European) is similar to the TL-WDR3500
792 define Device/tl-wr941nd-v6-cn
793 $(Device/tplink-4mlzma)
794 BOARDNAME := TL-WDR3500
795 DEVICE_PROFILE := TLWR941
796 TPLINK_HWID := 0x09410006
797 endef
798 TARGET_DEVICES += tl-wr941nd-v2 tl-wr941nd-v3 tl-wr941nd-v4 tl-wr941nd-v5 tl-wr941nd-v6-cn
799
800 define Device/tl-wr1041n-v2
801 $(Device/tplink-4mlzma)
802 BOARDNAME := TL-WR1041N-v2
803 DEVICE_PROFILE := TLWR1041
804 TPLINK_HWID := 0x10410002
805 endef
806 TARGET_DEVICES += tl-wr1041n-v2
807
808 define Device/tl-wr1043nd-v1
809 $(Device/tplink-8m)
810 BOARDNAME := TL-WR1043ND
811 DEVICE_PROFILE := TLWR1043
812 TPLINK_HWID := 0x10430001
813 endef
814
815 define Device/tl-wr1043nd-v2
816 $(Device/tplink-8mlzma)
817 BOARDNAME := TL-WR1043ND-v2
818 DEVICE_PROFILE := TLWR1043
819 TPLINK_HWID := 0x10430002
820 endef
821 TARGET_DEVICES += tl-wr1043nd-v1 tl-wr1043nd-v2
822
823 define Device/tl-wr2543-v1
824 $(Device/tplink-8mlzma)
825 BOARDNAME := TL-WR2543N
826 DEVICE_PROFILE := TLWR2543
827 TPLINK_HWID := 0x25430001
828 IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade "-v 3.13.99"
829 IMAGE/factory.bin := append-rootfs | mktplinkfw factory "-v 3.13.99"
830 endef
831 TARGET_DEVICES += tl-wr2543-v1
832
833 define Device/tl-wdr4900-v2
834 $(Device/tplink-8mlzma)
835 BOARDNAME := TL-WDR4900-v2
836 DEVICE_PROFILE := TLWDR4900V2
837 TPLINK_HWID := 0x49000002
838 endef
839 TARGET_DEVICES += tl-wdr4900-v2
840
841 define Device/tl-wa701n-v1
842 $(Device/tplink-4m)
843 BOARDNAME := TL-WA901ND
844 DEVICE_PROFILE := TLWA701
845 TPLINK_HWID := 0x07010001
846 endef
847
848 define Device/tl-wa701nd-v2
849 $(Device/tplink-4mlzma)
850 BOARDNAME := TL-WA701ND-v2
851 DEVICE_PROFILE := TLWA701
852 TPLINK_HWID := 0x07010002
853 CONSOLE := ttyATH0,115200
854 endef
855
856 define Device/tl-wa730rev1
857 $(Device/tplink-4m)
858 BOARDNAME := TL-WA901ND
859 DEVICE_PROFILE := TLWA730RE
860 TPLINK_HWID := 0x07300001
861 endef
862
863 define Device/tl-wa750re-v1
864 $(Device/tplink-4mlzma)
865 BOARDNAME := TL-WA750RE
866 DEVICE_PROFILE := TLWA750
867 TPLINK_HWID := 0x07500001
868 endef
869
870 define Device/tl-wa7510n
871 $(Device/tplink-4m)
872 BOARDNAME := TL-WA7510N
873 DEVICE_PROFILE := TLWA7510
874 TPLINK_HWID := 0x75100001
875 endef
876 TARGET_DEVICES += tl-wa701n-v1 tl-wa701nd-v2 tl-wa730rev1 tl-wa750re-v1 tl-wa7510n
877
878 define Device/tl-wa801nd-v1
879 $(Device/tplink-4m)
880 BOARDNAME := TL-WA901ND
881 DEVICE_PROFILE := TLWA801
882 TPLINK_HWID := 0x08010001
883 endef
884
885 define Device/tl-wa801nd-v2
886 $(Device/tplink-4mlzma)
887 BOARDNAME := TL-WA801ND-v2
888 DEVICE_PROFILE := TLWA801
889 TPLINK_HWID := 0x08010002
890 endef
891
892 define Device/tl-wa830re-v1
893 $(Device/tplink-4m)
894 BOARDNAME := TL-WA901ND
895 DEVICE_PROFILE := TLWA830
896 TPLINK_HWID := 0x08300010
897 endef
898
899 define Device/tl-wa830re-v2
900 $(Device/tplink-4mlzma)
901 BOARDNAME := TL-WA830RE-v2
902 DEVICE_PROFILE := TLWA830
903 TPLINK_HWID := 0x08300002
904 endef
905
906 define Device/tl-wa850re-v1
907 $(Device/tplink-4mlzma)
908 BOARDNAME := TL-WA850RE
909 DEVICE_PROFILE := TLWA850
910 TPLINK_HWID := 0x08500001
911 endef
912
913 define Device/tl-wa860re-v1
914 $(Device/tplink-4mlzma)
915 BOARDNAME := TL-WA860RE
916 DEVICE_PROFILE := TLWA860
917 TPLINK_HWID := 0x08600001
918 endef
919 TARGET_DEVICES += tl-wa801nd-v1 tl-wa801nd-v2 tl-wa830re-v1 tl-wa830re-v2 tl-wa850re-v1 tl-wa860re-v1
920
921 define Device/tl-wa901nd-v1
922 $(Device/tplink-4m)
923 BOARDNAME := TL-WA901ND
924 DEVICE_PROFILE := TLWA901
925 TPLINK_HWID := 0x09010001
926 endef
927
928 define Device/tl-wa901nd-v2
929 $(Device/tplink-4m)
930 BOARDNAME := TL-WA901ND-v2
931 DEVICE_PROFILE := TLWA901
932 TPLINK_HWID := 0x09010002
933 endef
934
935 define Device/tl-wa901nd-v3
936 $(Device/tplink-4mlzma)
937 BOARDNAME := TL-WA901ND-v3
938 DEVICE_PROFILE := TLWA901
939 TPLINK_HWID := 0x09010003
940 endef
941 TARGET_DEVICES += tl-wa901nd-v1 tl-wa901nd-v2 tl-wa901nd-v3
942
943 define Device/tl-wa7210n-v2
944 $(Device/tplink-4mlzma)
945 BOARDNAME := TL-WA7210N-v2
946 DEVICE_PROFILE := TLWA7210
947 TPLINK_HWID := 0x72100002
948 CONSOLE := ttyATH0,115200
949 endef
950 TARGET_DEVICES += tl-wa7210n-v2
951
952 define Device/smart-300
953 $(Device/tplink-8mlzma)
954 BOARDNAME := SMART-300
955 DEVICE_PROFILE := SMART-300
956 TPLINK_HWID := 0x93410001
957 endef
958 TARGET_DEVICES += smart-300
959
960 define Device/oolite
961 $(Device/tplink-16mlzma)
962 BOARDNAME := GS-OOLITE
963 DEVICE_PROFILE := OOLITE
964 TPLINK_HWID := 0x3C000101
965 CONSOLE := ttyATH0,115200
966 endef
967 TARGET_DEVICES += oolite
968
969 # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
970 # UBNT_TYPE e.g. one of (BZ, XM, XW)
971 # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
972 define Device/ubnt-xm
973 DEVICE_PROFILE := UBNT
974 IMAGE_SIZE := 7552k
975 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
976 UBNT_TYPE := XM
977 UBNT_BOARD := XM
978 UBNT_CHIP := ar7240
979 IMAGES := sysupgrade.bin factory.bin
980 IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
981 IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
982 endef
983
984 define Device/ubnt-xw
985 DEVICE_PROFILE := UBNT
986 IMAGE_SIZE := 7552k
987 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
988 UBNT_TYPE := XW
989 UBNT_BOARD := XM
990 UBNT_CHIP := ar934x
991 IMAGES := sysupgrade.bin factory.bin
992 IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
993 IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
994 endef
995
996 define Device/ubnt-bz
997 DEVICE_PROFILE := UBNT
998 IMAGE_SIZE := 7552k
999 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
1000 UBNT_TYPE := BZ
1001 UBNT_BOARD := XM
1002 UBNT_CHIP := ar934x
1003 IMAGES := sysupgrade.bin factory.bin
1004 IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
1005 IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
1006 endef
1007
1008 define Device/rw2458n
1009 $(Device/ubnt-xm)
1010 BOARDNAME := RW2458N
1011 endef
1012
1013 define Device/ubnt-airrouter
1014 $(Device/ubnt-xm)
1015 BOARDNAME := UBNT-AR
1016 endef
1017
1018 define Device/ubnt-bullet-m
1019 $(Device/ubnt-xm)
1020 BOARDNAME := UBNT-BM
1021 endef
1022
1023 define Device/ubnt-rocket-m
1024 $(Device/ubnt-xm)
1025 BOARDNAME := UBNT-RM
1026 endef
1027
1028 define Device/ubnt-nano-m
1029 $(Device/ubnt-xm)
1030 BOARDNAME := UBNT-NM
1031 endef
1032 TARGET_DEVICES += rw2458n ubnt-airrouter ubnt-bullet-m ubnt-rocket-m ubnt-nano-m
1033
1034 define Device/ubnt-unifi
1035 $(Device/ubnt-bz)
1036 BOARDNAME := UBNT-UF
1037 DEVICE_PROFILE := UBNT UBNTUNIFI
1038 endef
1039
1040 define Device/ubnt-unifi-outdoor
1041 $(Device/ubnt-bz)
1042 BOARDNAME := UBNT-U20
1043 DEVICE_PROFILE := UBNT UBNTUNIFIOUTDOOR
1044 endef
1045 TARGET_DEVICES += ubnt-unifi ubnt-unifi-outdoor
1046
1047 define Device/ubnt-nano-m-xw
1048 $(Device/ubnt-xw)
1049 BOARDNAME := UBNT-NM-XW
1050 endef
1051
1052 define Device/ubnt-loco-m-xw
1053 $(Device/ubnt-xw)
1054 BOARDNAME := UBNT-LOCO-XW
1055 endef
1056
1057 define Device/ubnt-rocket-m-xw
1058 $(Device/ubnt-xw)
1059 BOARDNAME := UBNT-RM-XW
1060 endef
1061
1062 define Device/ubnt-rocket-m-ti
1063 $(Device/ubnt-xw)
1064 BOARDNAME := UBNT-RM-TI
1065 UBNT_TYPE := TI
1066 UBNT_BOARD := XM
1067 endef
1068 TARGET_DEVICES += ubnt-nano-m-xw ubnt-loco-m-xw ubnt-rocket-m-xw ubnt-rocket-m-ti
1069
1070 define Device/ubnt-air-gateway
1071 $(Device/ubnt-xm)
1072 BOARDNAME := UBNT-AGW
1073 UBNT_BOARD := XM
1074 UBNT_TYPE := AirGW
1075 UBNT_CHIP := ar933x
1076 CONSOLE = ttyATH0,115200
1077 endef
1078 TARGET_DEVICES += ubnt-air-gateway
1079
1080 define Device/ubnt-air-gateway-pro
1081 $(Device/ubnt-xm)
1082 BOARDNAME := UBNT-AGWP
1083 UBNT_TYPE := AirGWP
1084 UBNT_CHIP := ar934x
1085 CONSOLE = ttyS0,115200
1086 endef
1087 TARGET_DEVICES += ubnt-air-gateway-pro
1088
1089 define Device/ubdev01
1090 $(Device/ubnt-xm)
1091 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7488k(firmware),64k(certs),256k(cfg)ro,64k(EEPROM)ro
1092 BOARDNAME := UBNT-UF
1093 UBNT_BOARD := XM
1094 UBNT_TYPE := XM
1095 UBNT_CHIP := ar7240
1096 endef
1097
1098 TARGET_DEVICES += ubdev01
1099
1100 define Device/ubnt-routerstation
1101 IMAGE_SIZE := 16128k
1102 IMAGES := sysupgrade.bin factory.bin
1103 IMAGE/factory.bin = append-rootfs | pad-rootfs | mkubntimage
1104 IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | combined-image | check-size $$$$(IMAGE_SIZE)
1105 KERNEL := kernel-bin | patch-cmdline | lzma | pad-to $$(BLOCKSIZE)
1106 endef
1107
1108 define Device/ubnt-rs
1109 $(Device/ubnt-routerstation)
1110 BOARDNAME := UBNT-RS
1111 DEVICE_PROFILE := Madwifi UBNT UBNTRS
1112 UBNT_BOARD := RS
1113 UBNT_TYPE := RSx
1114 UBNT_CHIP := ar7100
1115 endef
1116
1117 define Device/ubnt-rspro
1118 $(Device/ubnt-routerstation)
1119 BOARDNAME := UBNT-RSPRO
1120 DEVICE_PROFILE := Madwifi UBNT UBNTRSPRO
1121 UBNT_BOARD := RSPRO
1122 UBNT_TYPE := RSPRO
1123 UBNT_CHIP := ar7100pro
1124 endef
1125
1126 define Device/ubnt-ls-sr71
1127 $(Device/ubnt-routerstation)
1128 BOARDNAME := UBNT-LS-SR71
1129 DEVICE_PROFILE := Madwifi UBNT
1130 UBNT_BOARD := LS-SR71
1131 UBNT_TYPE := LS-SR71
1132 UBNT_CHIP := ar7100
1133 endef
1134
1135 TARGET_DEVICES += ubnt-rs ubnt-rspro ubnt-ls-sr71
1136
1137 define Device/ubnt-uap-pro
1138 IMAGE_SIZE := 15744k
1139 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)
1140 UBNT_TYPE := BZ
1141 UBNT_CHIP := ar934x
1142 BOARDNAME := UAP-PRO
1143 DEVICE_PROFILE := UBNT UAPPRO
1144 KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | mkubntkernelimage
1145 IMAGES := sysupgrade.bin factory.bin
1146 IMAGE/sysupgrade.bin = append-kernel 1536k | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
1147 IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage2
1148 endef
1149
1150 define Device/ubnt-unifi-outdoor-plus
1151 $(Device/ubnt-uap-pro)
1152 UBNT_CHIP := ar7240
1153 BOARDNAME := UBNT-UOP
1154 DEVICE_PROFILE := UBNT
1155 endef
1156
1157 TARGET_DEVICES += ubnt-uap-pro ubnt-unifi-outdoor-plus
1158
1159 rootfs_type=$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))
1160
1161 # $(1): rootfs type.
1162 # $(2): board name.
1163 define imgname
1164 $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(call rootfs_type,$(1))
1165 endef
1166
1167 define rootfs_align
1168 $(patsubst %-256k,0x40000,$(patsubst %-128k,0x20000,$(patsubst %-64k,0x10000,$(patsubst squashfs%,0x4,$(patsubst root.%,%,$(1))))))
1169 endef
1170
1171 define sysupname
1172 $(call imgname,$(1),$(2))-sysupgrade.bin
1173 endef
1174
1175 define factoryname
1176 $(call imgname,$(1),$(2))-factory.bin
1177 endef
1178
1179 COMMA:=,
1180
1181 define mkcmdline
1182 $(if $(1),board=$(1) )$(if $(2),console=$(2)$(COMMA)$(3))
1183 endef
1184
1185 define mtdpartsize
1186 $(shell sz=`echo '$(2)' | sed -ne 's/.*[:$(COMMA)]\([0-9]*\)k[@]*[0-9a-zx]*($(1)).*/\1/p'`; [ -n "$$sz" ] && echo $$(($$sz * 1024)))
1187 endef
1188
1189 SINGLE_PROFILES:=
1190
1191 # $(1) : name of image build method to be used, e.g., AthLzma.
1192 # $(2) : name of the build template to be used, e.g. 64k, 64kraw, 128k, etc.
1193 # $(3) : name of the profile to be defined.
1194 # $(4) : board name.
1195 # $(5)~$(7) : arguments for $(mkcmdline)
1196 # board=$(1) console=$(2),$(3)
1197 # $(8)~$(14): extra arguments.
1198 define SingleProfile
1199 # $(1): action name, e.g. loader, buildkernel, squashfs, etc.
1200 define Image/Build/Profile/$(3)
1201 $$(call Image/Build/Template/$(2)/$$(1),$(1),$(4),$$(call mkcmdline,$(5),$(6),$(7)),$(8),$(9),$(10),$(11),$(12),$(13),$(14))
1202 endef
1203 SINGLE_PROFILES += $(3)
1204 endef
1205
1206 # $(1), name of the MultiProfile to be added.
1207 # $(2), name of Profiles to be included in the MultiProfile.
1208 define MultiProfile
1209 define Image/Build/Profile/$(1)
1210 $(foreach p,$(2),
1211 $$(call Image/Build/Profile/$p,$$(1))
1212 )
1213 endef
1214 endef
1215
1216 LOADER_MAKE := $(NO_TRACE_MAKE) -C lzma-loader KDIR=$(KDIR)
1217
1218 VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux
1219 UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage
1220
1221 # $(1): input file.
1222 # $(2): output file.
1223 # $(3): extra arguments for lzma.
1224 define CompressLzma
1225 $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(3) $(2)
1226 endef
1227
1228 define PatchKernel
1229 cp $(KDIR)/vmlinux$(3) $(KDIR_TMP)/vmlinux$(3)-$(1)
1230 $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(3)-$(1) "$(strip $(2))"
1231 endef
1232
1233 define PatchKernel/initramfs
1234 $(call PatchKernel,$(1),$(2),-initramfs)
1235 cp $(KDIR_TMP)/vmlinux-initramfs-$(1) $(call imgname,initramfs,$(1)).bin
1236 endef
1237
1238 # $(1): board name.
1239 # $(2): kernel command line.
1240 # $(3): extra argumetns for lzma.
1241 # $(4): name suffix, e.g. "-initramfs".
1242 define PatchKernelLzma
1243 cp $(KDIR)/vmlinux$(4) $(KDIR_TMP)/vmlinux$(4)-$(1)
1244 $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(4)-$(1) "$(strip $(2))"
1245 $(call CompressLzma,$(KDIR_TMP)/vmlinux$(4)-$(1),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(3))
1246 endef
1247
1248 define PatchKernelGzip
1249 cp $(KDIR)/vmlinux$(3) $(KDIR_TMP)/vmlinux$(3)-$(1)
1250 $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(3)-$(1) "$(strip $(2))"
1251 gzip -9n -c $(KDIR_TMP)/vmlinux$(3)-$(1) > $(KDIR_TMP)/vmlinux$(3)-$(1).bin.gz
1252 endef
1253
1254 ifneq ($(SUBTARGET),mikrotik)
1255 # $(1): compression method of the data.
1256 # $(2): extra arguments.
1257 # $(3): input data file.
1258 # $(4): output file.
1259 define MkuImage
1260 mkimage -A mips -O linux -T kernel -a 0x80060000 -C $(1) $(2) \
1261 -e 0x80060000 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
1262 -d $(3) $(4)
1263 endef
1264
1265 # $(1): board name.
1266 # $(2): kernel command line.
1267 # $(3): extra arguments for lzma.
1268 # $(4): name suffix, e.g. "-initramfs".
1269 # $(5): extra arguments for mkimage.
1270 define MkuImageLzma
1271 $(call PatchKernelLzma,$(1),$(2),$(3),$(4))
1272 $(call MkuImage,lzma,$(5),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(KDIR_TMP)/vmlinux$(4)-$(1).uImage)
1273 endef
1274
1275 define MkuImageLzma/initramfs
1276 $(call PatchKernelLzma,$(1),$(2),$(3),-initramfs)
1277 $(call MkuImage,lzma,$(4),$(KDIR_TMP)/vmlinux-initramfs-$(1).bin.lzma,$(call imgname,initramfs,$(1))-uImage.bin)
1278 endef
1279
1280 define MkuImageGzip
1281 $(call PatchKernelGzip,$(1),$(2))
1282 $(call MkuImage,gzip,,$(KDIR_TMP)/vmlinux-$(1).bin.gz,$(KDIR_TMP)/vmlinux-$(1).uImage)
1283 endef
1284
1285 define MkuImageGzip/initramfs
1286 $(call PatchKernelGzip,$(1),$(2),-initramfs)
1287 $(call MkuImage,gzip,,$(KDIR_TMP)/vmlinux-initramfs-$(1).bin.gz,$(call imgname,initramfs,$(1))-uImage.bin)
1288 endef
1289
1290 define MkuImageOKLI
1291 $(call MkuImage,lzma,-M 0x4f4b4c49,$(KDIR)/vmlinux.bin.lzma,$(KDIR_TMP)/vmlinux-$(1).okli)
1292 endef
1293 endif
1294
1295 # $(1): name of the 1st file.
1296 # $(2): size limit of the 1st file if it is greater than 262144, or
1297 # the erase size of the flash if it is greater than zero and less
1298 # than 262144
1299 # $(3): name of the 2nd file.
1300 # $(4): size limit of the 2nd file if $(2) is greater than 262144, otherwise
1301 # it is the size limit of the output file
1302 # $(5): name of the output file.
1303 # $(6): padding size.
1304 define CatFiles
1305 if [ $(2) -eq 0 ]; then \
1306 filename="$(3)"; fstype=$$$${filename##*\.}; \
1307 case "$$$${fstype}" in \
1308 "jffs2-64k") bs=65536;; \
1309 "jffs2-128k") bs=131072;; \
1310 "jffs2-256k") bs=262144;; \
1311 *) bs=`stat -c%s $(1)`;; \
1312 esac; \
1313 ( dd if=$(1) bs=$$$${bs} conv=sync; cat $(3) ) > $(5); \
1314 if [ -n "$(6)" ]; then \
1315 case "$$$${fstype}" in \
1316 squashfs*) \
1317 padjffs2 $(5) $(6); \
1318 ;; \
1319 esac; \
1320 fi; \
1321 if [ `stat -c%s $(5)` -gt $(4) ]; then \
1322 echo "Warning: $(5) is too big (> $(4) bytes)" >&2; \
1323 rm -f $(5); \
1324 fi; \
1325 else if [ $(2) -gt 262144 ]; then \
1326 if [ `stat -c%s "$(1)"` -gt $(2) ]; then \
1327 echo "Warning: $(1) is too big (> $(2) bytes)" >&2; \
1328 else if [ `stat -c%s $(3)` -gt $(4) ]; then \
1329 echo "Warning: $(3) is too big (> $(4) bytes)" >&2; \
1330 else \
1331 ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \
1332 fi; fi; \
1333 else \
1334 ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \
1335 if [ `stat -c%s $(5)` -gt $(4) ]; then \
1336 echo "Warning: $(5) is too big (> $(4) bytes)" >&2; \
1337 rm -f $(5); \
1338 fi; \
1339 fi; fi
1340 endef
1341
1342 # $(1): rootfs type.
1343 # $(2): board name.
1344 # $(3): kernel image size limit.
1345 # $(4): rootfs image size limit.
1346 # $(5): padding argument for padjffs2.
1347 Sysupgrade/KR=$(call CatFiles,$(2),$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(5)))
1348 Sysupgrade/KRuImage=$(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage,$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(2)),$(5))
1349 Sysupgrade/RKuImage=$(call CatFiles,$(KDIR)/root.$(1),$(4),$(KDIR_TMP)/vmlinux-$(2).uImage,$(3),$(call sysupname,$(1),$(2)))
1350
1351 # $(1): ubinize ini file
1352 # $(2): working directory
1353 # $(3): output file
1354 # $(4): physical erase block size
1355 # $(5): minimum I/O unit size
1356 # $(6): custom options
1357 define ubinize
1358 $(CP) $(1) $(2)
1359 ( cd $(2); $(STAGING_DIR_HOST)/bin/ubinize -o $(3) -p $(4) -m $(5) $(6) $(1))
1360 endef
1361
1362 #
1363 # Embed lzma-compressed kernel inside lzma-loader.
1364 #
1365 # $(1), suffix of output filename, e.g. generic, lowercase board name, etc.
1366 # $(2), suffix of target file to build, e.g. bin, gz, elf
1367 # $(3), kernel command line to pass from lzma-loader to kernel
1368 # $(4), unused here
1369 # $(5), suffix of kernel filename, e.g. -initramfs, or empty
1370 define Image/BuildLoader
1371 -rm -rf $(KDIR)/lzma-loader
1372 $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)"\
1373 LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
1374 LOADER_DATA="$(KDIR)/vmlinux$(5).bin.lzma" BOARD="$(1)" \
1375 compile loader.$(2)
1376 -$(CP) $(KDIR)/loader-$(1).$(2) $(KDIR)/loader-$(1)$(5).$(2)
1377 endef
1378
1379 #
1380 # Embed patched lzma-compressed kernel inside lzma-loader.
1381 #
1382 # Specifying the command line via the lzma-loader doesn't work with some
1383 # models (like the TP-LINK CPE series), so this version first patches the
1384 # command line in the image and then builds the loader around it.
1385 #
1386 # $(1), suffix of output filename, e.g. generic, lowercase board name, etc.
1387 # $(2), suffix of target file to build, e.g. bin, gz, elf
1388 # $(3), kernel command line to pass from lzma-loader to kernel
1389 # $(4), unused here
1390 # $(5), suffix of kernel filename, e.g. -initramfs, or empty
1391 define Image/BuildLoaderPatched
1392 $(call PatchKernelLzma,$(1),$(3))
1393 -rm -rf $(KDIR)/lzma-loader
1394 $(LOADER_MAKE) LOADER=loader-$(1).$(2) \
1395 LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
1396 LOADER_DATA="$(KDIR_TMP)/vmlinux-$(1)$(5).bin.lzma" BOARD="$(1)" \
1397 compile loader.$(2)
1398 -$(CP) $(KDIR)/loader-$(1).$(2) $(KDIR)/loader-$(1)$(5).$(2)
1399 endef
1400
1401 #
1402 # Build lzma-loader alone which will search for lzma-compressed kernel identified by
1403 # uImage header with magic "OKLI" at boot time.
1404 #
1405 # $(4), offset into the flash space to start searching uImage magic "OKLI".
1406 # $(5), size of search range starting at $(4). With 0 as the value, uImage
1407 # header is expected to be at precisely $(4)
1408 define Image/BuildLoaderAlone
1409 -rm -rf $(KDIR)/lzma-loader
1410 $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)" \
1411 LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
1412 BOARD="$(1)" FLASH_OFFS=$(4) FLASH_MAX=$(5) \
1413 compile loader.$(2)
1414 endef
1415
1416 define Build/Clean
1417 $(LOADER_MAKE) clean
1418 endef
1419
1420
1421 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)
1422 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)
1423 alfa_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,15936k(firmware),64k(nvram),64k(art)ro
1424 all0258n_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),6272k(firmware),1536k(failsafe),64k(art)
1425 all0315n_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env),13568k(firmware),2048k(failsafe),256k(art)ro
1426 ap81_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,5120k(rootfs),2688k(kernel),64k(art)ro,7808k@0x50000(firmware)
1427 ap83_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,128k(u-boot-env)ro,4096k(rootfs),3648k(kernel),64k(art)ro,7744k@0x60000(firmware)
1428 ap96_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1728k(kernel),64k(art)ro,7872k@0x40000(firmware)
1429 ap113_mtd_layout=mtdparts=spi0.0:64k(u-boot),3008k(rootfs),896k(uImage),64k(NVRAM),64k(ART),3904k@0x10000(firmware)
1430 ap121_mtdlayout_2M=mtdparts=spi0.0:64k(u-boot)ro,1216k(rootfs),704k(kernel),64k(art)ro,1920k@0x10000(firmware)
1431 ap121_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2448k(rootfs),1200k(kernel),64k(nvram),64k(art)ro,3648k@0x50000(firmware)
1432 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)
1433 ap132_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art),7808k@0x50000(firmware)
1434 ap135_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
1435 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)
1436 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)
1437 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)
1438 ap147_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art),16000k@0x50000(firmware)
1439 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)
1440 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
1441 cameo_ap81_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(config)ro,3840k(firmware),64k(art)ro
1442 cameo_ap91_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,3712k(firmware),64k(mac)ro,64k(art)ro
1443 cameo_ap99_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,3520k(firmware),64k(mac)ro,192k(lp)ro,64k(art)ro
1444 cameo_ap121_mtdlayout=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k(nvram)ro,192k(language)ro,3648k(firmware)
1445 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)
1446 cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
1447 cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
1448 cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
1449 cap4200ag_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),320k(custom)ro,1536k(kernel),12096k(rootfs),2048k(failsafe),64k(art),13632k@0xa0000(firmware)
1450 cpe510_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k@0x40000(firmware)
1451 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
1452 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)
1453 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
1454 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
1455 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
1456 cameo_ap94_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,1600k(unknown)ro,64k@0x7f0000(caldata_copy)
1457 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)
1458 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)
1459 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)
1460 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)
1461 ew-dorin_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),3712k(firmware),64k(art)
1462 ew-dorin_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
1463 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)
1464 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)
1465 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)
1466 dragino2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,16000k(firmware),64k(config)ro,64k(art)ro
1467 hiwifi_hc6361_mtdlayout=mtdparts=spi0.0:64k(u-boot)ro,64k(bdinfo)ro,1280k(kernel),14848k(rootfs),64k(backup)ro,64k(art)ro,16128k@0x20000(firmware)
1468 mr12_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x80000(firmware)
1469 mr16_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x80000(firmware)
1470 pb92_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2752k(rootfs),896k(kernel),64k(nvram),64k(art)ro,3648k@0x50000(firmware)
1471 planex_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),128k(art)ro
1472 ubntxm_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
1473 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)
1474 ubdev_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7488k(firmware),64k(certs),256k(cfg)ro,64k(EEPROM)ro
1475 whrhpg300n_mtdlayout=mtdparts=spi0.0:248k(u-boot)ro,8k(u-boot-env)ro,3712k(firmware),64k(art)ro
1476 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)
1477 wpj344_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
1478 wpj531_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
1479 wpj558_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
1480 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)
1481 wnr2200_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro
1482 wnr2000v3_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmware),64k(art)ro
1483 wnr2000v4_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,3776k(firmware),64k(art)ro
1484 r6100_mtdlayout=mtdparts=ar934x-nfc:128k(u-boot)ro,256k(caldata),256k(caldata-backup),512k(config),512k(pot),2048k(kernel),122240k(ubi),25600k@0x1a0000(firmware),2048k(language),3072k(traffic_meter)
1485 wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata),512k(pot),2048k(language),512k(config),3072k(traffic_meter),2048k(kernel),23552k(ubi),25600k@0x6c0000(firmware),256k(caldata_backup),-(reserved)
1486 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)
1487 mynet_n600_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro
1488 mynet_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro
1489 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)
1490 qihoo_c301_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),64k(devdata),64k(devconf),15744k(firmware),64k(warm_start),64k(action_image_config),64k(radiocfg)ro;spi0.1:15360k(upgrade2),1024k(privatedata)
1491
1492
1493 define Image/BuildKernel
1494 cp $(KDIR)/vmlinux.elf $(VMLINUX).elf
1495 cp $(KDIR)/vmlinux $(VMLINUX).bin
1496 dd if=$(KDIR)/vmlinux.bin.lzma of=$(VMLINUX).lzma bs=65536 conv=sync
1497 dd if=$(KDIR)/vmlinux.bin.gz of=$(VMLINUX).gz bs=65536 conv=sync
1498 $(call MkuImage,gzip,,$(KDIR)/vmlinux.bin.gz,$(UIMAGE)-gzip.bin)
1499 $(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(UIMAGE)-lzma.bin)
1500 cp $(KDIR)/loader-generic.elf $(VMLINUX)-lzma.elf
1501 -mkdir -p $(KDIR_TMP)
1502 $(call Image/Build/Profile/$(IMAGE_PROFILE),buildkernel)
1503 endef
1504
1505 define Image/BuildKernel/Initramfs
1506 cp $(KDIR)/vmlinux-initramfs.elf $(VMLINUX)-initramfs.elf
1507 cp $(KDIR)/vmlinux-initramfs $(VMLINUX)-initramfs.bin
1508 dd if=$(KDIR)/vmlinux-initramfs.bin.lzma of=$(VMLINUX)-initramfs.lzma bs=65536 conv=sync
1509 dd if=$(KDIR)/vmlinux-initramfs.bin.gz of=$(VMLINUX)-initramfs.gz bs=65536 conv=sync
1510 $(call MkuImage,gzip,,$(KDIR)/vmlinux-initramfs.bin.gz,$(UIMAGE)-initramfs-gzip.bin)
1511 $(call MkuImage,lzma,,$(KDIR)/vmlinux-initramfs.bin.lzma,$(UIMAGE)-initramfs-lzma.bin)
1512 cp $(KDIR)/loader-generic-initramfs.elf $(VMLINUX)-initramfs-lzma.elf
1513 $(call Image/Build/Initramfs)
1514 endef
1515
1516 Image/Build/WRT400N/buildkernel=$(call MkuImageLzma,$(2),$(3))
1517
1518 define Image/Build/WRT400N
1519 $(call Sysupgrade/KRuImage,$(1),$(2),1310720,6488064)
1520 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1521 wrt400n $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR)/root.$(1) $(call factoryname,$(1),$(2)); \
1522 fi
1523 endef
1524
1525
1526 define Image/Build/CameoAP94/buildkernel
1527 $(call MkuImageLzma,$(2),$(3) $(4))
1528 $(call MkuImageLzma,$(2)-fat,$(3) $(5))
1529 endef
1530
1531 define Image/Build/CameoAP94
1532 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1533 $(eval fwsize_fat=$(call mtdpartsize,firmware,$(5)))
1534 $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
1535 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1536 ( \
1537 dd if=$(call sysupname,$(1),$(2)); \
1538 echo -n "$(6)"; \
1539 ) > $(call imgname,$(1),$(2))-backup-loader.bin; \
1540 if [ `stat -c%s $(call sysupname,$(1),$(2))` -gt 4194304 ]; then \
1541 echo "Warning: $(call sysupname,$(1),$(2)) is too big" >&2; \
1542 else \
1543 ( \
1544 dd if=$(call sysupname,$(1),$(2)) bs=4096k conv=sync; \
1545 echo -n "$(7)"; \
1546 ) > $(call factoryname,$(1),$(2)); \
1547 fi; \
1548 fi
1549 $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2)-fat.uImage,0,$(KDIR)/root.$(1),$$$$(($(fwsize_fat)-4*64*1024)),$(KDIR_TMP)/$(2)-fat.bin,64)
1550 if [ -e "$(KDIR_TMP)/$(2)-fat.bin" ]; then \
1551 echo -n "" > $(KDIR_TMP)/$(2)-fat.dummy; \
1552 sh $(TOPDIR)/scripts/combined-image.sh \
1553 "$(KDIR_TMP)/$(2)-fat.bin" \
1554 "$(KDIR_TMP)/$(2)-fat.dummy" \
1555 $(call sysupname,$(1),$(2)-fat); \
1556 fi
1557 endef
1558
1559 define Image/Build/WZRHP
1560 $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(3)-4*$(4)*1024)),$(4))
1561 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1562 ( \
1563 echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
1564 dd if=$(call sysupname,$(1),$(2)); \
1565 ) > $(call imgname,$(1),$(2))-tftp.bin; \
1566 buffalo-enc -p $(5) -v 1.99 \
1567 -i $(call sysupname,$(1),$(2)) \
1568 -o $(KDIR_TMP)/$(2).enc; \
1569 buffalo-tag -b $(5) -p $(5) -a ath -v 1.99 -m 1.01 -l mlang8 \
1570 -w 3 -c 0x80041000 -d 0x801e8000 -f 1 -r M_ \
1571 -i $(KDIR_TMP)/$(2).enc \
1572 -o $(call factoryname,$(1),$(2)); \
1573 fi
1574 endef
1575
1576 Image/Build/WZRHP64K/buildkernel=$(call MkuImageLzma,$(2),$(3))
1577 Image/Build/WZRHP64K/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1578 Image/Build/WZRHP64K=$(call Image/Build/WZRHP,$(1),$(2),33095680,64,$(4))
1579
1580 Image/Build/WZRHP128K/buildkernel=$(call MkuImageLzma,$(2),$(3))
1581 Image/Build/WZRHP128K/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1582 Image/Build/WZRHP128K=$(call Image/Build/WZRHP,$(1),$(2),33030144,128,$(4))
1583
1584
1585 Image/Build/WHRHPG300N/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1586 Image/Build/WHRHPG300N/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1587
1588 define Image/Build/WHRHPG300N
1589 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1590 $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
1591 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1592 ( \
1593 echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
1594 dd if=$(call sysupname,$(1),$(2)); \
1595 ) > $(call imgname,$(1),$(2))-tftp.bin; \
1596 buffalo-enc -p $(5) -v 1.99 \
1597 -i $(call sysupname,$(1),$(2)) \
1598 -o $(KDIR_TMP)/$(2).enc; \
1599 buffalo-tag -b $(5) -p $(5) -a ath -v 1.99 -m 1.01 -l mlang8 \
1600 -w 3 -c 0x80041000 -d 0x801e8000 -f 1 -r M_ \
1601 -i $(KDIR_TMP)/$(2).enc \
1602 -o $(call factoryname,$(1),$(2)); \
1603 fi
1604 endef
1605
1606
1607 define Image/Build/Cameo
1608 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1609 $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
1610 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1611 factory_size=$$$$(($(fwsize) - $(6))); \
1612 ( \
1613 dd if=$(call sysupname,$(1),$(2)) bs=$$$${factory_size} conv=sync; \
1614 echo -n $(5); \
1615 ) > $(call factoryname,$(1),$(2)); \
1616 fi
1617 endef
1618
1619 Image/Build/CameoAP81/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap81_mtdlayout))
1620 Image/Build/CameoAP81=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap81_mtdlayout),$(4),65536)
1621 Image/Build/CameoAP81/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap81_mtdlayout))
1622
1623 Image/Build/CameoAP91/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap91_mtdlayout))
1624 Image/Build/CameoAP91=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap91_mtdlayout),$(4),65536)
1625 Image/Build/CameoAP91/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap91_mtdlayout))
1626
1627 Image/Build/CameoAP99/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap99_mtdlayout))
1628 Image/Build/CameoAP99=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap99_mtdlayout),$(4),65536)
1629 Image/Build/CameoAP99/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap99_mtdlayout))
1630
1631 Image/Build/CameoAP123_4M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap123_mtdlayout_4M))
1632 Image/Build/CameoAP123_4M=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap123_mtdlayout_4M),$(4),26)
1633 Image/Build/CameoAP123_4M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap123_mtdlayout_4M))
1634
1635 Image/Build/CameoAP135/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1636 Image/Build/CameoAP135=$(call Image/Build/Cameo,$(1),$(2),$(3),$(4),$(5),26)
1637 Image/Build/CameoAP135/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1638
1639 Image/Build/CameoDB120/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_db120_mtdlayout))
1640 Image/Build/CameoDB120=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_db120_mtdlayout),$(4),26)
1641 Image/Build/CameoDB120/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_db120_mtdlayout))
1642
1643 Image/Build/CameoDB120_8M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_db120_mtdlayout_8M))
1644 Image/Build/CameoDB120_8M=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_db120_mtdlayout_8M),$(4),26)
1645 Image/Build/CameoDB120_8M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_db120_mtdlayout_8M))
1646
1647 define Image/Build/CameoHornet
1648 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1649 $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
1650 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1651 for r in $(7); do \
1652 [ -n "$$$$r" ] && dashr="-$$$$r" || dashr=; \
1653 [ -z "$$$$r" ] && r="DEF"; \
1654 mkcameofw -M HORNET -R "$$$$r" -S $(5) -V $(6) -c \
1655 -K $(8) -I $(fwsize) \
1656 -k "$(call sysupname,$(1),$(2))" \
1657 -o $(call imgname,$(1),$(2))-factory$$$$dashr.bin; \
1658 true; \
1659 done; \
1660 fi
1661 endef
1662
1663 Image/Build/CameoAP121/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap121_mtdlayout))
1664 Image/Build/CameoAP121=$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo_ap121_mtdlayout),$(4),$(5),$(6),0xe0000)
1665 Image/Build/CameoAP121/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap121_mtdlayout))
1666
1667 Image/Build/CameoAP121_8M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap121_mtdlayout_8M))
1668 Image/Build/CameoAP121_8M=$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo_ap121_mtdlayout_8M),$(4),$(5),$(6),0x100000)
1669 Image/Build/CameoAP121_8M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap121_mtdlayout_8M))
1670
1671 define Image/Build/dLAN
1672 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1673 $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
1674 $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
1675 $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
1676 if [ -e "$(call factoryname,$(1),$(2))" ]; then \
1677 dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
1678 of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
1679 dd if=$(KDIR)/root.$(1) \
1680 of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
1681 fi
1682 endef
1683
1684 Image/Build/dLANLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1685 Image/Build/dLANLzma=$(call Image/Build/dLAN,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
1686 Image/Build/dLANLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1687
1688 define Image/Build/Ath
1689 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1690 $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
1691 $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
1692 $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
1693 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1694 dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
1695 of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
1696 dd if=$(KDIR)/root.$(1) \
1697 of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
1698 fi
1699 endef
1700
1701 Image/Build/AthGzip/buildkernel=$(call MkuImageGzip,$(2),$(3) $(4))
1702 Image/Build/AthGzip=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
1703 Image/Build/AthGzip/initramfs=$(call MkuImageGzip/initramfs,$(2),$(3) $(4))
1704
1705 Image/Build/AthLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1706 Image/Build/AthLzma=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
1707 Image/Build/AthLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1708
1709
1710 Image/Build/Belkin/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1711 Image/Build/Belkin/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1712
1713 define Image/Build/Belkin
1714 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1715 $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
1716 $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
1717 $(call Sysupgrade/RKuImage,$(1),$(2),$(kernsize),$(rootsize))
1718 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1719 edimax_fw_header -m $(5) -v "OpenWrt$(REVISION)" \
1720 -n "uImage" \
1721 -i $(KDIR_TMP)/vmlinux-$(2).uImage \
1722 -o $(KDIR_TMP)/$(2)-uImage; \
1723 edimax_fw_header -m $(5) -v "OpenWrt$(REVISION)" \
1724 -n "rootfs" \
1725 -i $(KDIR)/root.$(1) \
1726 -o $(KDIR_TMP)/$(2)-rootfs; \
1727 ( \
1728 dd if=$(KDIR_TMP)/$(2)-rootfs; \
1729 dd if=$(KDIR_TMP)/$(2)-uImage; \
1730 ) > "$(call factoryname,$(1),$(2))"; \
1731 fi
1732 endef
1733
1734 define Image/Build/EnGenius
1735 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1736 $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
1737 $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
1738 $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
1739 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1740 dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
1741 of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
1742 dd if=$(KDIR)/root.$(1) \
1743 of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
1744 mksenaofw -e $(call sysupname,$(1),$(2)) \
1745 -o $(call imgname,$(1),$(2))-factory.dlf \
1746 -r 0x101 -p $(7) -t 2; \
1747 fi
1748 endef
1749
1750 Image/Build/EnGenius/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1751 Image/Build/EnGenius/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1752
1753
1754 define MkuImageHiWiFi
1755 # Field ih_name needs to start with "tw150v1"
1756 mkimage -A mips -O linux -T kernel -a 0x80060000 -C $(1) $(2) \
1757 -e 0x80060000 -n 'tw150v1 MIPS OpenWrt Linux-$(LINUX_VERSION)' \
1758 -d $(3) $(4)
1759 endef
1760
1761 define MkuImageLzmaHiWiFi
1762 $(call PatchKernelLzma,$(1),$(2),$(3),$(4))
1763 $(call MkuImageHiWiFi,lzma,$(5),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(KDIR_TMP)/vmlinux$(4)-$(1).uImage)
1764 endef
1765
1766 Image/Build/HiWiFi/buildkernel=$(call MkuImageLzmaHiWiFi,$(2),$(3) $(4))
1767 Image/Build/HiWiFi=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
1768 Image/Build/HiWiFi/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1769
1770 Image/Build/PB4X/buildkernel=$(call PatchKernelLzma,$(2),$(3))
1771
1772 define Image/Build/PB4X
1773 dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma \
1774 of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync
1775 dd if=$(KDIR)/root.$(1) \
1776 of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync
1777 -sh $(TOPDIR)/scripts/combined-image.sh \
1778 "$(call imgname,kernel,$(2)).bin" \
1779 "$(call imgname,$(1),$(2)-rootfs).bin" \
1780 $(call sysupname,$(1),$(2))
1781 endef
1782
1783
1784 Image/Build/MyLoader/buildkernel=$(call PatchKernelLzma,$(2),$(3))
1785 Image/Build/MyLoader/initramfs=$(call PatchKernel/initramfs,$(2),$(3))
1786
1787 define Image/Build/MyLoader
1788 $(eval fwsize=$(shell echo $$(($(4)-0x30000-4*64*1024))))
1789 $(eval fwimage=$(KDIR_TMP)/$(2)-$(5)-firmware.bin)
1790 $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).bin.lzma,65536,$(KDIR)/root.$(1),$(fwsize),$(fwimage))
1791 if [ -e "$(fwimage)" ]; then \
1792 $(STAGING_DIR_HOST)/bin/mkmylofw -B $(2) -s $(4) -v \
1793 -p0x00030000:0:al:0x80060000:firmware:$(fwimage) \
1794 $(call imgname,$(1),$(2))-$(5)-factory.img; \
1795 echo -n "" > $(KDIR_TMP)/empty.bin; \
1796 sh $(TOPDIR)/scripts/combined-image.sh \
1797 $(fwimage) $(KDIR_TMP)/empty.bin \
1798 $(call imgname,$(1),$(2))-$(5)-sysupgrade.bin; \
1799 fi
1800 endef
1801
1802 Image/Build/Planex/initramfs=$(call MkuImageGzip/initramfs,$(2),$(3) $(planex_mtdlayout))
1803 Image/Build/Planex/loader=$(call Image/BuildLoaderAlone,$(1),gz,$(2) $(planex_mtdlayout),0x52000,0)
1804
1805 define Image/Build/Planex/buildkernel
1806 [ -e "$(KDIR)/loader-$(2).gz" ]
1807 $(call MkuImageOKLI,$(2))
1808 ( \
1809 dd if=$(KDIR)/loader-$(2).gz bs=8128 count=1 conv=sync; \
1810 dd if=$(KDIR_TMP)/vmlinux-$(2).okli; \
1811 ) > $(KDIR_TMP)/kernel-$(2).bin
1812 $(call MkuImage,gzip,,$(KDIR_TMP)/kernel-$(2).bin,$(KDIR_TMP)/vmlinux-$(2).uImage)
1813 endef
1814
1815 define Image/Build/Planex
1816 $(eval fwsize=$(call mtdpartsize,firmware,$(planex_mtdlayout)))
1817 $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
1818 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1819 $(STAGING_DIR_HOST)/bin/mkplanexfw \
1820 -B $(2) \
1821 -v 2.00.00 \
1822 -i $(call sysupname,$(1),$(2)) \
1823 -o $(call factoryname,$(1),$(2)); \
1824 fi
1825 endef
1826
1827
1828 Image/Build/ALFA/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1829 Image/Build/ALFA/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1830
1831 define Image/Build/ALFA
1832 $(call Sysupgrade/RKuImage,$(1),$(2),$(5),$(6))
1833 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1834 rm -rf $(KDIR)/$(1); \
1835 mkdir -p $(KDIR)/$(1); \
1836 cd $(KDIR)/$(1); \
1837 cp $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR)/$(1)/$(7); \
1838 cp $(KDIR)/root.$(1) $(KDIR)/$(1)/$(8); \
1839 $(TAR) zcf $(call factoryname,$(1),$(2)) -C $(KDIR)/$(1) $(7) $(8); \
1840 ( \
1841 echo WRM7222C | dd bs=32 count=1 conv=sync; \
1842 echo -ne '\xfe'; \
1843 ) >> $(call factoryname,$(1),$(2)); \
1844 fi
1845 endef
1846
1847
1848 Image/Build/Seama/loader=$(call Image/BuildLoader,$(1),bin,$(2) $(3),0x80060000)
1849
1850 define Image/Build/Seama
1851 [ -e "$(KDIR)/loader-$(2).bin" ]
1852 $(call CompressLzma,$(KDIR)/loader-$(2).bin,$(KDIR_TMP)/loader-$(2).bin.lzma)
1853 -rm -f $(KDIR_TMP)/image-$(2).tmp
1854 $(call CatFiles,$(KDIR_TMP)/loader-$(2).bin.lzma,$$$$(($(6) - 64)),$(KDIR)/root.$(1),$(7),$(KDIR_TMP)/image-$(2).tmp)
1855 [ -e "$(KDIR_TMP)/image-$(2).tmp" ] && { \
1856 head -c -4 "$(KDIR_TMP)/image-$(2).tmp" > "$(KDIR_TMP)/image-$(2).no-jffs2mark.tmp"; \
1857 $(STAGING_DIR_HOST)/bin/seama \
1858 -i $(KDIR_TMP)/image-$(2).no-jffs2mark.tmp \
1859 -m "dev=/dev/mtdblock/1" -m "type=firmware"; \
1860 $(STAGING_DIR_HOST)/bin/seama \
1861 -s $(call imgname,$(1),$(2))-factory.bin \
1862 -m "signature=$(5)" \
1863 -i $(KDIR_TMP)/image-$(2).no-jffs2mark.tmp.seama; \
1864 tail -c 4 "$(KDIR_TMP)/image-$(2).tmp" >> $(call imgname,$(1),$(2))-factory.bin; \
1865 }
1866 cat $(KDIR_TMP)/loader-$(2).bin.lzma > $(KDIR_TMP)/image-$(2)-sysupgrade.tmp
1867 $(STAGING_DIR_HOST)/bin/seama \
1868 -i $(KDIR_TMP)/image-$(2)-sysupgrade.tmp \
1869 -m "dev=/dev/mtdblock/1" -m "type=firmware"
1870 $(call CatFiles,$(KDIR_TMP)/image-$(2)-sysupgrade.tmp.seama,$(6),$(KDIR)/root.$(1),$(7),$(call sysupname,$(1),$(2)))
1871 endef
1872
1873 define Image/Build/Seama/initramfs
1874 $(call PatchKernelLzma,$(2),$(3) $(4),,-initramfs)
1875 $(STAGING_DIR_HOST)/bin/seama \
1876 -i $(KDIR_TMP)/vmlinux-initramfs-$(2).bin.lzma \
1877 -m "dev=/dev/mtdblock/1" -m "type=firmware"
1878 cat $(KDIR_TMP)/vmlinux-initramfs-$(2).bin.lzma.seama > $(call imgname,initramfs,$(2))-seama.bin
1879 endef
1880
1881 Image/Build/Senao/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1882 Image/Build/Senao/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1883
1884 define Image/Build/Senao
1885 mkdir -p $(KDIR_TMP)/$(2)/
1886 touch $(KDIR_TMP)/$(2)/FWINFO-OpenWrt-$(REVISION)-$(2)
1887 -$(CP) ./$(2)/* $(KDIR_TMP)/$(2)/
1888 dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
1889 of=$(KDIR_TMP)/$(2)/openwrt-senao-$(2)-uImage-lzma.bin bs=64k conv=sync
1890 dd if=$(KDIR)/root.$(1) \
1891 of=$(KDIR_TMP)/$(2)/openwrt-senao-$(2)-root.$(1) bs=64k conv=sync
1892 ( \
1893 cd $(KDIR_TMP)/$(2)/; \
1894 $(TAR) -cz -f $(call factoryname,$(1),$(2)) * \
1895 )
1896 -rm -rf $(KDIR_TMP)/$(2)/
1897 -sh $(TOPDIR)/scripts/combined-image.sh \
1898 $(KDIR_TMP)/vmlinux-$(2).uImage \
1899 $(KDIR)/root.$(1) \
1900 $(call sysupname,$(1),$(2))
1901 endef
1902
1903 Image/Build/TPLINK-SAFELOADER/loader = $(call Image/BuildLoaderPatched,$(1),elf,$(2) $(3))
1904
1905 define Image/Build/TPLINK-SAFELOADER
1906 [ -e "$(KDIR)/loader-$(2).elf" ]
1907
1908 -$(STAGING_DIR_HOST)/bin/tplink-safeloader \
1909 -B $(5) \
1910 -k $(KDIR)/loader-$(2).elf \
1911 -r $(KDIR)/root.$(1) \
1912 -V $(REVISION) \
1913 -j \
1914 -o $(call factoryname,$(1),$(2))
1915 -$(STAGING_DIR_HOST)/bin/tplink-safeloader \
1916 -B $(5) \
1917 -k $(KDIR)/loader-$(2).elf \
1918 -r $(KDIR)/root.$(1) \
1919 -V $(REVISION) \
1920 -j -S \
1921 -o $(call sysupname,$(1),$(2))
1922 endef
1923
1924
1925 define Image/Build/CyberTAN
1926 echo -n '' > $(KDIR_TMP)/empty.bin
1927 $(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/image.tmp \
1928 -f $(KDIR_TMP)/vmlinux-$(2).uImage -F $(KDIR_TMP)/empty.bin \
1929 -x 32 -a 0x10000 -x -32 -f $(KDIR)/root.$(1)
1930 -$(STAGING_DIR_HOST)/bin/addpattern -B $(2) -v v$(5) \
1931 -i $(KDIR)/image.tmp \
1932 -o $(call sysupname,$(1),$(2))
1933 $(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/image.tmp -f $(KDIR_TMP)/vmlinux-$(2).uImage \
1934 -x 32 -a 0x10000 -x -32 -f $(KDIR)/root.$(1)
1935 -$(STAGING_DIR_HOST)/bin/addpattern -B $(2) -v v$(5) -g \
1936 -i $(KDIR)/image.tmp \
1937 -o $(call factoryname,$(1),$(2))
1938 rm $(KDIR)/image.tmp
1939 endef
1940
1941 Image/Build/CyberTANGZIP/loader=$(call Image/BuildLoader,$(1),gz,$(2),0x80060000)
1942 Image/Build/CyberTANGZIP/buildkernel=$(call MkuImage,gzip,,$(KDIR)/loader-$(2).gz,$(KDIR_TMP)/vmlinux-$(2).uImage)
1943 Image/Build/CyberTANGZIP=$(call Image/Build/CyberTAN,$(1),$(2),$(3),$(4),$(5))
1944
1945 Image/Build/CyberTANLZMA/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1946 Image/Build/CyberTANLZMA=$(call Image/Build/CyberTAN,$(1),$(2),$(3),$(4),$(5))
1947
1948
1949 Image/Build/Netgear/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
1950
1951 define Image/Build/Netgear/buildkernel
1952 $(call MkuImageLzma,$(2),$(3) $(4),-d20,,-M $(5))
1953 -rm -rf $(KDIR_TMP)/$(2)
1954 mkdir -p $(KDIR_TMP)/$(2)/image
1955 cat $(KDIR_TMP)/vmlinux-$(2).uImage > $(KDIR_TMP)/$(2)/image/uImage
1956 $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
1957 $(KDIR_TMP)/$(2) $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp1 \
1958 -noappend -root-owned -be -b 65536
1959 ( \
1960 cat $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp1; \
1961 dd if=/dev/zero bs=1k count=1 \
1962 ) > $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp2
1963 mkimage -A mips -O linux -T filesystem -C none -M $(5) \
1964 -a 0xbf070000 -e 0xbf070000 \
1965 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
1966 -d $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp2 \
1967 $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs
1968 endef
1969
1970 define Image/Build/Netgear
1971 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1972 $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage.squashfs,0,$(KDIR)/root.$(1),$(fwsize),$(call sysupname,$(1),$(2)),64)
1973 if [ -e $(call sysupname,$(1),$(2)) ]; then \
1974 for r in $(7) ; do \
1975 [ -n "$$$$r" ] && dashr="-$$$$r" || dashr= ; \
1976 $(STAGING_DIR_HOST)/bin/mkdniimg \
1977 -B $(6) -v OpenWrt.$(REVISION) -r "$$$$r" $(8) \
1978 -i $(call sysupname,$(1),$(2)) \
1979 -o $(call imgname,$(1),$(2))-factory$$$$dashr.img; \
1980 done; \
1981 fi
1982 endef
1983
1984
1985 Image/Build/NetgearLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
1986 Image/Build/NetgearLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4),-d20,,-M $(5))
1987
1988 define Image/Build/NetgearLzma
1989 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1990 $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage,0,$(KDIR)/root.$(1),$(fwsize),$(call sysupname,$(1),$(2)),64)
1991 endef
1992
1993
1994 Image/Build/NetgearNAND/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
1995
1996 # $(1): (empty)
1997 # $(2): Board name (small caps)
1998 # $(3): Kernel board specific cmdline
1999 # $(4): Kernel mtdparts definition
2000 # $(5): U-Boot magic
2001 define Image/Build/NetgearNAND/buildkernel
2002 $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
2003 $(call PatchKernelLzma,$(2),$(3) $(4),-d20)
2004 dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma \
2005 of=$(KDIR_TMP)/vmlinux-$(2).bin.tmp \
2006 bs=$$$$(($(kernelsize)-131072-2*64-1)) \
2007 count=1 conv=sync
2008 $(call MkuImage,lzma,-M $(5),$(KDIR_TMP)/vmlinux-$(2).bin.tmp,$(KDIR_TMP)/vmlinux-$(2).uImage)
2009 echo -ne '\xff' >> $(KDIR_TMP)/vmlinux-$(2).uImage
2010 # create a fake rootfs image
2011 dd if=/dev/zero of=$(KDIR_TMP)/fakeroot-$(2) bs=131072 count=1
2012 mkimage -A mips -O linux -T filesystem -C none \
2013 -a 0xbf070000 -e 0xbf070000 \
2014 -n 'MIPS OpenWrt fakeroot' \
2015 -d $(KDIR_TMP)/fakeroot-$(2) \
2016 -M $(5) \
2017 $(KDIR_TMP)/fakeroot-$(2).uImage
2018 # append the fake rootfs image to the kernel, it will reside in the last
2019 # erase block of the kernel partition
2020 cat $(KDIR_TMP)/fakeroot-$(2).uImage >> $(KDIR_TMP)/vmlinux-$(2).uImage
2021 endef
2022
2023
2024 # $(1): rootfs image suffix
2025 # $(2): Board name (small caps)
2026 # $(3): Kernel board specific cmdline
2027 # $(4): Kernel mtdparts definition
2028 # $(5): U-Boot magic
2029 # $(6): Board name (upper caps)
2030 # $(7): firmware region code (not used yet)
2031 # $(8): DNI Hardware version
2032 # $(9): suffix of the configuration file for ubinize
2033 define Image/Build/NetgearNAND
2034 $(eval firmwaresize=$(call mtdpartsize,firmware,$(4)))
2035 $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
2036 $(eval imageraw=$(KDIR_TMP)/$(2)-raw.img)
2037 $(CP) $(KDIR)/root.squashfs-raw $(KDIR_TMP)/root.squashfs
2038 echo -ne '\xde\xad\xc0\xde' > $(KDIR_TMP)/jffs2.eof
2039 $(call ubinize,ubinize-$(9).ini,$(KDIR_TMP),$(KDIR_TMP)/$(2)-root.ubi,128KiB,2048,-E 5)
2040 ( \
2041 dd if=$(KDIR_TMP)/vmlinux-$(2).uImage; \
2042 dd if=$(KDIR_TMP)/$(2)-root.ubi \
2043 ) > $(imageraw)
2044 $(STAGING_DIR_HOST)/bin/mkdniimg \
2045 -B $(6) -v OpenWrt.$(REVISION) -r "$$$$r" $(8) \
2046 -i $(imageraw) \
2047 -o $(call imgname,ubi,$(2))-factory.img
2048
2049 $(call Image/Build/SysupgradeNAND,$(2),squashfs,$(KDIR_TMP)/vmlinux-$(2).uImage)
2050 endef
2051
2052
2053 ifdef CONFIG_PACKAGE_uboot-ar71xx-nbg460n_550n_550nh
2054 Image/Build/ZyXEL/buildkernel=$(call MkuImageLzma,$(2),$(3))
2055
2056 define Image/Build/ZyXEL
2057 $(call Sysupgrade/KRuImage,$(1),$(2),917504,2752512)
2058 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
2059 if [ ! -f $(BIN_DIR)/$(IMG_PREFIX)-$(2)-u-boot.bin ]; then \
2060 echo "Warning: $(IMG_PREFIX)-$(2)-u-boot.bin not found" >&2; \
2061 else \
2062 $(STAGING_DIR_HOST)/bin/mkzynfw \
2063 -B $(4) \
2064 -b $(BIN_DIR)/$(IMG_PREFIX)-$(2)-u-boot.bin \
2065 -r $(call sysupname,$(1),$(2)):0x10000 \
2066 -o $(call factoryname,$(1),$(2)); \
2067 fi; fi
2068 endef
2069 endif
2070
2071
2072 define Image/Build/ZyXELNAND/buildkernel
2073 $(eval kernelsize=$(call mtdpartsize,kernel,$(5)))
2074 $(call MkuImageLzma,$(2),$(3) $(5) $(6))
2075 mkdir -p $(KDIR_TMP)/$(2)/image/boot
2076 cp $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR_TMP)/$(2)/image/boot/vmlinux.lzma.uImage
2077 $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
2078 --pad=$(kernelsize) --big-endian --squash-uids -v -e 128KiB \
2079 -o $(KDIR_TMP)/$(2)-kernel.jffs2 \
2080 -d $(KDIR_TMP)/$(2)/image \
2081 2>&1 1>/dev/null | awk '/^.+$$$$/'
2082 -rm -rf $(KDIR_TMP)/$(2)
2083 endef
2084
2085 define Image/Build/ZyXELNAND
2086 if [ "$(1)" != "squashfs" ]; then \
2087 echo Only squashfs is supported; \
2088 return 0; \
2089 fi
2090 $(eval firmwaresize=$(call mtdpartsize,firmware,$(4)))
2091 $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
2092 $(eval imageraw=$(KDIR_TMP)/$(2)-raw.img)
2093 $(CP) $(KDIR)/root.$(1) $(KDIR_TMP)/ubi_root.img
2094 $(call ubinize,ubinize-$(2).ini,$(KDIR_TMP),$(KDIR_TMP)/$(2)-root.ubi,128KiB,2048,-E 5)
2095 ( \
2096 dd if=$(KDIR_TMP)/$(2)-kernel.jffs2; \
2097 dd if=$(KDIR_TMP)/$(2)-root.ubi \
2098 ) > $(imageraw)
2099 dd if=$(imageraw) of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory.bin \
2100 bs=128k conv=sync
2101 $(call Image/Build/SysupgradeNAND,$(2),squashfs,$(KDIR_TMP)/$(2)-kernel.jffs2)
2102 endef
2103
2104
2105 Image/Build/OpenMesh/buildkernel=$(call MkuImageLzma,$(2))
2106
2107 define Image/Build/OpenMesh
2108 -sh $(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \
2109 "$(4)" \
2110 "$(BUILD_DIR)/fwupgrade.cfg-$(4)" \
2111 "$(KDIR_TMP)/vmlinux-$(2).uImage" \
2112 "$(KDIR)/root.$(1)"
2113 -sh $(TOPDIR)/scripts/combined-ext-image.sh \
2114 "$(4)" "$(call factoryname,$(1),$(2))" \
2115 "$(BUILD_DIR)/fwupgrade.cfg-$(4)" "fwupgrade.cfg" \
2116 "$(KDIR_TMP)/vmlinux-$(2).uImage" "kernel" \
2117 "$(KDIR)/root.$(1)" "rootfs"
2118 endef
2119
2120
2121 Image/Build/Zcomax/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
2122 Image/Build/Zcomax/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
2123
2124 define Image/Build/Zcomax
2125 $(call Sysupgrade/RKuImage,$(1),$(2),1507328,6356992)
2126 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
2127 $(STAGING_DIR_HOST)/bin/mkzcfw \
2128 -B $(2) \
2129 -k $(KDIR_TMP)/vmlinux-$(2).uImage \
2130 -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
2131 -o $(call imgname,$(1),$(2))-factory.img; \
2132 fi
2133 endef
2134
2135
2136 # $(1): template name to be defined, etc. squashfs-only, 64k, 64kraw, etc.
2137 # $(2): jffs2 blocksize.
2138 define Jffs2Template
2139 define Image/Build/Template/$(1)/jffs2-$(2)
2140 $$(call Image/Build/$$(1),jffs2-$(2),$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
2141 endef
2142 endef
2143
2144 # $(1): template name to be defined.
2145 # $(2): squashfs suffix to be used.
2146 # $(3): jffs2 suffix to be used.
2147 define BuildTemplate
2148 # $(1) : name of build method.
2149 # $(2) : board name.
2150 # $(3) : kernel command line.
2151 # $(4)~$(8): extra arguments.
2152 define Image/Build/Template/$(1)/initramfs
2153 $$(call Image/Build/$$(1)/initramfs,initramfs,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
2154 endef
2155 define Image/Build/Template/$(1)/loader
2156 $$(call Image/Build/$$(1)/loader,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
2157 endef
2158 define Image/Build/Template/$(1)/buildkernel
2159 $$(call Image/Build/$$(1)/buildkernel,,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
2160 endef
2161 define Image/Build/Template/$(1)/squashfs
2162 $$(call Image/Build/$$(1),squashfs$(2),$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
2163 endef
2164 $(if $(3),$(foreach bs,$(3),$(eval $(call Jffs2Template,$(1),$(bs)))))
2165 endef
2166
2167 $(eval $(call BuildTemplate,squashfs-only))
2168 $(eval $(call BuildTemplate,64k,-64k,64k))
2169 $(eval $(call BuildTemplate,64kraw,-raw,64k))
2170 $(eval $(call BuildTemplate,64kraw-nojffs,-raw))
2171 $(eval $(call BuildTemplate,128k,,128k))
2172 $(eval $(call BuildTemplate,128kraw,-raw,128k))
2173 $(eval $(call BuildTemplate,256k,,256k))
2174 $(eval $(call BuildTemplate,all,,64k 128k 256k))
2175
2176 ifeq ($(SUBTARGET),generic)
2177 $(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))
2178 $(eval $(call SingleProfile,ALFA,64k,HORNETUB,hornet-ub,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,kernel_image,rootfs_image))
2179 $(eval $(call SingleProfile,ALFA,64k,TUBE2H8M,tube2h-8M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,kernel.image,rootfs.image))
2180
2181 $(eval $(call SingleProfile,AthGzip,64k,AP81,ap81,AP81,ttyS0,115200,$$(ap81_mtdlayout),RKuImage))
2182 $(eval $(call SingleProfile,AthGzip,64k,AP83,ap83,AP83,ttyS0,115200,$$(ap83_mtdlayout),RKuImage))
2183 $(eval $(call SingleProfile,AthGzip,64k,AP96,ap96,AP96,ttyS0,115200,$$(ap96_mtdlayout),RKuImage))
2184 $(eval $(call SingleProfile,AthGzip,64k,WNDAP360,wndap360,WNDAP360,ttyS0,9600,$$(wndap360_mtdlayout),KRuImage))
2185
2186 $(eval $(call SingleProfile,AthLzma,64k,ALFAAP96,alfa-ap96,ALFA-AP96,ttyS0,115200,$$(alfa_ap96_mtdlayout),RKuImage))
2187 $(eval $(call SingleProfile,AthLzma,64k,ALL0258N,all0258n,ALL0258N,ttyS0,115200,$$(all0258n_mtdlayout),KRuImage,65536))
2188 $(eval $(call SingleProfile,AthLzma,256k,ALL0315N,all0315n,ALL0315N,ttyS0,115200,$$(all0315n_mtdlayout),KRuImage,262144))
2189 $(eval $(call SingleProfile,AthLzma,64k,AP113,ap113,AP113,ttyS0,115200,$$(ap113_mtd_layout),RK))
2190 $(eval $(call SingleProfile,AthLzma,64k,AP121_2M,ap121-2M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_2M),RKuImage))
2191 $(eval $(call SingleProfile,AthLzma,64k,AP121_4M,ap121-4M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_4M),RKuImage))
2192 $(eval $(call SingleProfile,AthLzma,64k,AP121_8M,ap121-8M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_8M),RKuImage))
2193 $(eval $(call SingleProfile,AthLzma,64k,AP121MINI,ap121-mini,AP121-MINI,ttyATH0,115200,$$(ap121_mtdlayout_4M),RKuImage))
2194 $(eval $(call SingleProfile,AthLzma,64k,AP132,ap132,AP132,ttyS0,115200,$$(ap132_mtdlayout),KRuImage))
2195 $(eval $(call SingleProfile,AthLzma,64k,AP135,ap135-020,AP135-020,ttyS0,115200,$$(ap135_mtdlayout),RKuImage))
2196 $(eval $(call SingleProfile,AthLzma,64k,AP136_010,ap136-010,AP136-010,ttyS0,115200,$$(ap136_mtdlayout),RKuImage))
2197 $(eval $(call SingleProfile,AthLzma,64k,AP136_020,ap136-020,AP136-020,ttyS0,115200,$$(ap136_mtdlayout),RKuImage))
2198 $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(ap143_mtdlayout_8M),RKuImage))
2199 $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
2200 $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
2201 $(eval $(call SingleProfile,AthLzma,64k,AP152_16M,ap152-16M,AP152,ttyS0,115200,$$(ap152_mtdlayout_16M),RKuImage))
2202 $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
2203 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
2204 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
2205 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
2206 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
2207 $(eval $(call SingleProfile,AthLzma,64k,EWDORINRT,ew-dorin-router,EW-DORIN-ROUTER,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
2208 $(eval $(call SingleProfile,AthLzma,64k,EWDORIN16M,ew-dorin-16M,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_16M),KRuImage,65536))
2209 $(eval $(call SingleProfile,AthLzma,64k,HORNETUBx2,hornet-ub-x2,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
2210 $(eval $(call SingleProfile,AthLzma,64k,MR12,mr12,MR12,ttyS0,115200,$$(mr12_mtdlayout),RKuImage))
2211 $(eval $(call SingleProfile,AthLzma,64k,MR16,mr16,MR16,ttyS0,115200,$$(mr16_mtdlayout),RKuImage))
2212 $(eval $(call SingleProfile,AthLzma,64k,PB92,pb92,PB92,ttyS0,115200,$$(pb92_mtdlayout),KRuImage))
2213 $(eval $(call SingleProfile,AthLzma,64k,TUBE2H16M,tube2h-16M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
2214 $(eval $(call SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$(wlr8100_mtdlayout),KRuImage))
2215 $(eval $(call SingleProfile,AthLzma,64k,WPJ344_16M,wpj344-16M,WPJ344,ttyS0,115200,$$(wpj344_mtdlayout_16M),KRuImage,65536))
2216 $(eval $(call SingleProfile,AthLzma,64k,WPJ531_16M,wpj531-16M,WPJ531,ttyS0,115200,$$(wpj531_mtdlayout_16M),KRuImage,65536))
2217 $(eval $(call SingleProfile,AthLzma,64k,WPJ558_16M,wpj558-16M,WPJ558,ttyS0,115200,$$(wpj558_mtdlayout_16M),KRuImage,65536))
2218
2219 $(eval $(call SingleProfile,Belkin,64k,F9K1115V2,f9k1115v2,F9K1115V2,ttyS0,115200,$$(f9k1115v2_mtdlayout),BR-6679BAC))
2220
2221 $(eval $(call SingleProfile,CameoAP91,64kraw,DIR600A1,dir-600-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-00"))
2222 $(eval $(call SingleProfile,CameoAP91,64kraw,DIR601A1,dir-601-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-02"))
2223 $(eval $(call SingleProfile,CameoAP91,64kraw,FR54RTR,fr-54rtr,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-01"))
2224
2225 $(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E1,dir-615-e1,DIR-615-E1,ttyS0,115200,"AP93-AR7240-RT-081028-00"))
2226 $(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E4,dir-615-e4,DIR-615-E4,ttyS0,115200,"AP99-AR7240-RT-091105-05"))
2227
2228 $(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I1,dir-615-i1,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-1012I1-00"))
2229 $(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I3,dir-615-i3,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-101214-00"))
2230
2231 $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,A02RBW300N,a02-rb-w300n,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-03"))
2232 $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,DIR615C1,dir-615-c1,DIR-615-C1,ttyS0,115200,"AP81-AR9130-RT-070614-02"))
2233 $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW632BRP,tew-632brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-00"))
2234 $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_FW,tew-652brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-080609-05"))
2235 $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_RECOVERY,tew-652brp-recovery,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-02"))
2236
2237 $(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,TEW712BR,tew-712br,TEW-712BR,ttyATH0,115200,"HORNET-RT-TEW712BR-3",1.99,""))
2238 $(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,DIR601B1,dir-601-b1,TEW-712BR,ttyATH0,115200,"HORNET-RT-DIR601B1-3",2.99.99,"" "NA"))
2239 $(eval $(call SingleProfile,CameoAP121_8M,64kraw-nojffs,DIR505A1,dir-505-a1,DIR-505-A1,ttyATH0,115200,"HORNET-PACKET-DIR505A1-3",1.99.99,""))
2240
2241 $(eval $(call SingleProfile,CameoAP135,64kraw,DGL5500A1,dgl-5500-a1,DGL-5500-A1,ttyS0,115200,$$(dgl_5500_mtdlayout),"00AP135AR9558-RT-130508-00"))
2242
2243 $(eval $(call SingleProfile,CameoDB120,64kraw,DHP1565A1,dhp-1565-a1,DHP-1565-A1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
2244 $(eval $(call SingleProfile,CameoDB120,64kraw,DIR825C1,dir-825-c1,DIR-825-C1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
2245 $(eval $(call SingleProfile,CameoDB120,64kraw,DIR835A1,dir-835-a1,DIR-835-A1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
2246
2247 $(eval $(call SingleProfile,CameoDB120_8M,64kraw,TEW732BR,tew-732br,TEW-732BR,ttyS0,115200,"00DB120AR9341-RT-120906-NA"))
2248
2249 $(eval $(call SingleProfile,CyberTANGZIP,64k,WRT160NL,wrt160nl,WRT160NL,ttyS0,115200,,1.00.01))
2250
2251 $(eval $(call SingleProfile,CyberTANLZMA,64k,MYNETREXT,mynet-rext,MYNET-REXT,ttyS0,115200,$$(mynet_rext_mtdlayout) root=31:2,1.00.01))
2252
2253 $(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))
2254 $(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))
2255 $(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))
2256
2257 $(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,64k))
2258 $(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,64k))
2259
2260 $(eval $(call SingleProfile,EnGenius,64k,ESR900,esr900,ESR900,ttyS0,115200,$$(esr900_mtdlayout),KRuImage,,0x4e))
2261 $(eval $(call SingleProfile,EnGenius,64k,ESR1750,esr1750,ESR1750,ttyS0,115200,$$(esr1750_mtdlayout),KRuImage,,0x61))
2262 $(eval $(call SingleProfile,EnGenius,64k,EPG5000,epg5000,EPG5000,ttyS0,115200,$$(epg5000_mtdlayout),KRuImage,,0x71))
2263
2264 $(eval $(call SingleProfile,HiWiFi,64k,HIWIFI_HC6361,hiwifi-hc6361,HiWiFi-HC6361,ttyATH0,115200,$$(hiwifi_hc6361_mtdlayout),KRuImage))
2265
2266 $(eval $(call SingleProfile,MyLoader,64k,WP543_2M,wp543,,ttyS0,115200,0x200000,2M))
2267 $(eval $(call SingleProfile,MyLoader,64k,WP543_4M,wp543,,ttyS0,115200,0x400000,4M))
2268 $(eval $(call SingleProfile,MyLoader,64k,WP543_8M,wp543,,ttyS0,115200,0x800000,8M))
2269 $(eval $(call SingleProfile,MyLoader,64k,WP543_16M,wp543,,ttyS0,115200,0x1000000,16M))
2270 $(eval $(call SingleProfile,MyLoader,64k,WPE72_4M,wpe72,,ttyS0,115200,0x400000,4M))
2271 $(eval $(call SingleProfile,MyLoader,64k,WPE72_8M,wpe72,,ttyS0,115200,0x800000,8M))
2272 $(eval $(call SingleProfile,MyLoader,64k,WPE72_16M,wpe72,,ttyS0,115200,0x1000000,16M))
2273
2274 $(eval $(call SingleProfile,Netgear,64kraw,WNR2000V3,wnr2000v3,WNR2000V3,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303033,WNR2000V3,"" NA,-H 29763551+04+32))
2275 $(eval $(call SingleProfile,NetgearLzma,64kraw,WNR2000V4,wnr2000v4,WNR2000V4,ttyS0,115200,$$(wnr2000v4_mtdlayout),0x32303034,WNR2000V4,"" NA,))
2276 $(eval $(call SingleProfile,Netgear,64kraw,WNR2200,wnr2200,WNR2200,ttyS0,115200,$$(wnr2200_mtdlayout),0x32323030,WNR2200,"" NA,))
2277 $(eval $(call SingleProfile,Netgear,64kraw,REALWNR612V2,wnr612v2,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,WNR612V2,"",))
2278 $(eval $(call SingleProfile,Netgear,64kraw,N150R,n150r,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,N150R,"",))
2279 $(eval $(call SingleProfile,Netgear,64kraw,REALWNR1000V2,wnr1000v2,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303031,WNR1000V2,"",))
2280 $(eval $(call SingleProfile,Netgear,64kraw,WNR1000V2_VC,wnr1000v2-vc,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303030,WNR1000V2-VC,"",))
2281
2282 $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2p,,,,OM2P))
2283 $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5P,om5p,,,,OM5P))
2284 $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR600,mr600,,,,MR600))
2285 $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR900,mr900,,,,MR900))
2286 $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR1750,mr1750,,,,MR1750))
2287
2288 $(eval $(call SingleProfile,PB4X,128k,ALL0305,all0305,ALL0305,ttyS0,115200))
2289 $(eval $(call SingleProfile,PB4X,128k,EAP7660D,eap7660d,EAP7660D,ttyS0,115200))
2290 $(eval $(call SingleProfile,PB4X,64k,JA76PF,ja76pf,JA76PF,ttyS0,115200))
2291 $(eval $(call SingleProfile,PB4X,64k,JA76PF2,ja76pf2,JA76PF2,ttyS0,115200))
2292 $(eval $(call SingleProfile,PB4X,64k,JWAP003,jwap003,JWAP003,ttyS0,115200))
2293 $(eval $(call SingleProfile,PB4X,64k,PB42,pb42,PB42,ttyS0,115200))
2294 $(eval $(call SingleProfile,PB4X,64k,PB44,pb44,PB44,ttyS0,115200))
2295
2296 $(eval $(call SingleProfile,Planex,64kraw,MZKW04NU,mzk-w04nu,MZK-W04NU,ttyS0,115200))
2297 $(eval $(call SingleProfile,Planex,64kraw,MZKW300NH,mzk-w300nh,MZK-W300NH,ttyS0,115200))
2298
2299 $(eval $(call SingleProfile,Seama,64k,MYNETN600,mynet-n600,MYNET-N600,ttyS0,115200,$$(mynet_n600_mtdlayout),wrgnd16_wd_db600,65536,16187392))
2300 $(eval $(call SingleProfile,Seama,64k,MYNETN750,mynet-n750,MYNET-N750,ttyS0,115200,$$(mynet_n600_mtdlayout),wrgnd13_wd_av,65536,16187392))
2301
2302 $(eval $(call SingleProfile,Seama,64k,QIHOO360,qihoo-c301,QIHOO-C301,ttyS0,115200,$$(qihoo_c301_mtdlayout),wrgac26_qihoo360_360rg,65536,16121856))
2303
2304 $(eval $(call SingleProfile,Senao,squashfs-only,EAP300V2,eap300v2,EAP300V2,ttyS0,115200,$$(eap300v2_mtdlayout)))
2305
2306 $(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510))
2307
2308 $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N))
2309 $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPG300N,whr-hp-g300n,WHR-HP-G300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-G300N))
2310 $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPGN,whr-hp-gn,WHR-HP-GN,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-GN))
2311 $(eval $(call SingleProfile,WHRHPG300N,64kraw,WLAEAG300N,wlae-ag300n,WLAE-AG300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WLAE-AG300N))
2312
2313 $(eval $(call SingleProfile,WRT400N,64k,WRT400N,wrt400n,WRT400N,ttyS0,115200))
2314
2315 $(eval $(call SingleProfile,WZRHP128K,128kraw,WZRHPG300NH,wzr-hp-g300nh,WZR-HP-G300NH,ttyS0,115200,WZR-HP-G300NH))
2316 $(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPG300NH2,wzr-hp-g300nh2,WZR-HP-G300NH2,ttyS0,115200,WZR-HP-G300NH2))
2317 $(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPAG300H,wzr-hp-ag300h,WZR-HP-AG300H,ttyS0,115200,WZR-HP-AG300H))
2318 $(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPG450H,wzr-hp-g450h,WZR-HP-G450H,ttyS0,115200,WZR-HP-AG450H))
2319 $(eval $(call SingleProfile,WZRHP64K,64kraw,WZR600DHP,wzr-600dhp,WZR-HP-AG300H,ttyS0,115200,WZR-600DHP))
2320 $(eval $(call SingleProfile,WZRHP64K,64kraw,WZR450HP2,wzr-450hp2,WZR-450HP2,ttyS0,115200,WZR-450HP2))
2321
2322 $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H28,zcn-1523h-2-8,ZCN-1523H-2,ttyS0,115200,$$(zcn1523h_mtdlayout)))
2323 $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H516,zcn-1523h-5-16,ZCN-1523H-5,ttyS0,115200,$$(zcn1523h_mtdlayout)))
2324
2325 $(eval $(call SingleProfile,ZyXEL,64k,NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG460N,ttyS0,115200,NBG-460N))
2326
2327 $(eval $(call MultiProfile,AP121,AP121_2M AP121_4M AP121_8M))
2328 $(eval $(call MultiProfile,AP136,AP136_010 AP136_020))
2329 $(eval $(call MultiProfile,AP143,AP143_8M AP143_16M))
2330 $(eval $(call MultiProfile,AP147,AP147_010))
2331 $(eval $(call MultiProfile,AP152,AP152_16M))
2332 $(eval $(call MultiProfile,DIR615IX,DIR615I1 DIR615I3))
2333 $(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT EWDORIN16M))
2334 $(eval $(call MultiProfile,OPENMESH,OM2P OM5P MR600 MR900 MR1750))
2335 $(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY))
2336 $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
2337 $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
2338 $(eval $(call MultiProfile,WNR1000V2,REALWNR1000V2 WNR1000V2_VC))
2339 $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))
2340 $(eval $(call MultiProfile,WPE72,WPE72_4M WPE72_8M WPE72_16M))
2341 $(eval $(call MultiProfile,WPJ344,WPJ344_16M))
2342 $(eval $(call MultiProfile,WPJ531,WPJ531_16M))
2343 $(eval $(call MultiProfile,WPJ558,WPJ558_16M))
2344
2345 $(eval $(call MultiProfile,Minimal,$(SINGLE_PROFILES)))
2346 $(eval $(call MultiProfile,Madwifi,EAP7660D WP543))
2347 endif # ifeq ($(SUBTARGET),generic)
2348
2349 ifeq ($(SUBTARGET),nand)
2350 $(eval $(call SingleProfile,NetgearNAND,64k,WNDR3700V4,wndr3700v4,WNDR3700_V4,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR3700v4,"",-H 29763948+128+128,wndr4300))
2351 $(eval $(call SingleProfile,NetgearNAND,64k,WNDR4300V1,wndr4300,WNDR4300,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR4300,"",-H 29763948+0+128+128+2x2+3x3,wndr4300))
2352 $(eval $(call SingleProfile,NetgearNAND,64k,R6100,r6100,R6100,ttyS0,115200,$$(r6100_mtdlayout),0x36303030,R6100,"",-H 29764434+0+128+128+2x2+2x2,wndr4300))
2353
2354 $(eval $(call SingleProfile,ZyXELNAND,128k,NBG6716,nbg6716,NBG6716,ttyS0,115200,NBG6716,$$(zyx_nbg6716_mtdlayout),mem=256M))
2355
2356 $(eval $(call MultiProfile,WNDR4300,WNDR3700V4 WNDR4300V1))
2357 endif # ifeq ($(SUBTARGET),nand)
2358
2359
2360 $(eval $(call MultiProfile,Default,$(SINGLE_PROFILES)))
2361
2362 define Image/Build/squashfs
2363 cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-raw
2364 cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-64k
2365 $(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR)/root.squashfs-64k 64
2366 cp $(KDIR)/root.squashfs-64k $(BIN_DIR)/$(IMG_PREFIX)-root.squashfs-64k
2367 $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
2368 dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
2369 endef
2370
2371 define Image/Build/jffs2
2372 dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
2373 endef
2374
2375 define Image/Build/Initramfs
2376 $(call Image/Build/Profile/$(IMAGE_PROFILE),initramfs)
2377 endef
2378
2379 define Image/Prepare
2380 gzip -9n -c $(KDIR)/vmlinux > $(KDIR)/vmlinux.bin.gz
2381 $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
2382 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
2383 gzip -9n -c $(KDIR)/vmlinux-initramfs > $(KDIR)/vmlinux-initramfs.bin.gz
2384 $(call CompressLzma,$(KDIR)/vmlinux-initramfs,$(KDIR)/vmlinux-initramfs.bin.lzma)
2385 $(call Image/BuildLoader,generic,elf,,,-initramfs)
2386 endif
2387 $(call Image/BuildLoader,generic,elf)
2388 $(call Image/Build/Profile/$(if $(CONFIG_IB),Default,$(IMAGE_PROFILE)),loader)
2389 endef
2390
2391 # $(1): filesystem type.
2392 define Image/Build
2393 $(call Image/Build/$(call rootfs_type,$(1)),$(1))
2394 $(call Image/Build/Profile/$(IMAGE_PROFILE),$(1))
2395 endef
2396
2397 $(eval $(call BuildImage))