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