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