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