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