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