2 # Copyright (C) 2008-2011 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 JFFS2_BLOCKSIZE = 64k 128k 256k
10 include $(TOPDIR)/rules.mk
11 include $(INCLUDE_DIR)/image.mk
13 IMAGE_PROFILE:=$(if $(PROFILE),$(PROFILE),Default)
15 KERNEL_LOADADDR = 0x80060000
17 DEVICE_VARS += NETGEAR_KERNEL_MAGIC NETGEAR_BOARD_ID NETGEAR_HW_ID CMDLINE CONSOLE IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS
19 define Build/netgear-squashfs
20 rm -rf $@.fs $@.squashfs
22 cp $@ $@.fs/image/uImage
23 $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
25 -noappend -root-owned -be -b 65536
26 dd if=/dev/zero bs=1k count=1 >> $@.squashfs
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)' \
33 rm -rf $@.squashfs $@.fs
36 define Build/netgear-uImage
37 $(call Build/uImage,$(1) -M $(NETGEAR_KERNEL_MAGIC))
40 # combine kernel and rootfs into one image
41 # mktplinkfw <type> <optional extra arguments to mktplinkfw binary>
42 # <type> is "sysupgrade" or "factory"
44 # -a align the rootfs start on an <align> bytes boundary
45 # -j add jffs2 end-of-filesystem markers
46 # -s strip padding from end of the image
47 # -X reserve <size> bytes in the firmware image (hexval prefixed with 0x)
48 define Build/mktplinkfw
49 -$(STAGING_DIR_HOST)/bin/mktplinkfw \
50 -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) $2 \
51 -m $(TPLINK_HEADER_VERSION) \
56 -a $(call rootfs_align,$(FILESYSTEM)) \
57 $(if $(findstring sysupgrade,$1),-s) && mv $@.new $@ || rm -f $@
60 # mktplinkfw-initramfs <optional extra arguments to mktplinkfw binary>
63 define Build/mktplinkfw-initramfs
64 $(STAGING_DIR_HOST)/bin/mktplinkfw \
65 -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) $2 \
66 -m $(TPLINK_HEADER_VERSION) \
74 define Build/loader-common
76 $(MAKE) -C lzma-loader \
77 PKG_BUILD_DIR="$@.src" \
78 TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \
79 KERNEL_CMDLINE="$(CMDLINE)" BOARD="$(BOARDNAME)" \
80 LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
81 $(1) compile loader.gz
86 define Build/loader-okli-compile
87 $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS) FLASH_MAX=0)
90 define Build/loader-kernel
91 $(call Build/loader-common,LOADER_DATA="$@")
94 define Build/loader-okli
95 dd if=$(KDIR)/loader-$(1).gz bs=7680 conv=sync of="$@.new"
100 define Build/copy-file
104 DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION
106 # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
107 # UBNT_TYPE e.g. one of (BZ, XM, XW)
108 # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
110 # mkubntimage is using the kernel image direct
111 # routerboard creates partitions out of the ubnt header
112 define Build/mkubntimage
113 $(STAGING_DIR_HOST)/bin/mkfwimage \
114 -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-OpenWrt-$(REVISION) \
120 # all UBNT XM device expect the kernel image to have 1024k while flash, when
121 # booting the image, the size doesn't matter.
122 define Build/mkubntimage-split
123 dd if=$@ of=$@.old1 bs=1024k count=1
124 dd if=$@ of=$@.old2 bs=1024k skip=1
125 $(STAGING_DIR_HOST)/bin/mkfwimage \
126 -B $(UBNT_BOARD) -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-OpenWrt-$(REVISION) \
133 define Build/mkubntimage2
134 $(STAGING_DIR_HOST)/bin/mkfwimage2 -f 0x9f000000 \
135 -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-OpenWrt-$(REVISION) \
136 -p jffs2:0x50000:0xf60000:0:0:$@ \
141 DEVICE_VARS += UBNT_BOARD UBNT_CHIP UBNT_TYPE
143 define Build/mkubntkernelimage
144 rm -rf $(KDIR_TMP)/ubnt-$(KERNEL_IMAGE)/image && \
145 mkdir -p $(KDIR_TMP)/ubnt-$(KERNEL_IMAGE)/image && \
146 cp $@ $(KDIR_TMP)/ubnt-$(KERNEL_IMAGE)/image/kernel0 && \
147 $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
148 --pad --big-endian --squash-uids -v -e 64KiB \
150 -d $(KDIR_TMP)/ubnt-$(KERNEL_IMAGE)/image \
152 $(STAGING_DIR_HOST)/bin/padjffs2 $@.new -J 64
153 -rm -rf $(KDIR_TMP)/ubnt-$(KERNEL_IMAGE)/image
157 define Device/Default
159 DEVICE_PROFILE = $$(BOARDNAME)
160 PROFILES = Default Minimal $$(DEVICE_PROFILE)
162 IMAGES := sysupgrade.bin
164 FILESYSTEMS = $(filter-out jffs2-%,$(TARGET_FILESYSTEMS)) jffs2-$$(BLOCKSIZE)
165 CONSOLE = ttyS0,115200
166 CMDLINE = $$(if $$(BOARDNAME),board=$$(BOARDNAME)) $$(if $$(MTDPARTS),mtdparts=$$(MTDPARTS)) $$(if $$(CONSOLE),console=$$(CONSOLE))
167 KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma
169 IMAGES := sysupgrade.bin
170 IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
176 CONSOLE = ttyATH0,115200
177 MTDPARTS = spi0.0:128k(u-boot)ro,64k(u-boot-env)ro,16128k(firmware),64k(art)ro
179 TARGET_DEVICES += bsb
181 define Device/carambola2
182 BOARDNAME = CARAMBOLA2
184 CONSOLE = ttyATH0,115200
185 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
187 TARGET_DEVICES += carambola2
189 define Device/cf-e316n-v2
190 BOARDNAME = CF-E316N-V2
192 CONSOLE = ttyS0,115200
193 MTDPARTS = spi0.0:64k(u-boot)ro,64k(art)ro,16192k(firmware),64k(nvram)ro
195 TARGET_DEVICES += cf-e316n-v2
200 CONSOLE = ttyATH0,115200
201 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
203 TARGET_DEVICES += weio
205 define Device/wndr3700
207 NETGEAR_KERNEL_MAGIC = 0x33373030
208 NETGEAR_BOARD_ID = WNDR3700
210 MTDPARTS = spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,7680k(firmware),64k(art)ro
211 IMAGES := sysupgrade.bin factory.img factory-NA.img
212 KERNEL := kernel-bin | patch-cmdline | lzma -d20 | netgear-uImage lzma
213 IMAGE/default = append-kernel $$$$(BLOCKSIZE) | netgear-squashfs | append-rootfs | pad-rootfs
214 IMAGE/sysupgrade.bin = $$(IMAGE/default) | check-size $$$$(IMAGE_SIZE)
215 IMAGE/factory.img = $$(IMAGE/default) | netgear-dni | check-size $$$$(IMAGE_SIZE)
216 IMAGE/factory-NA.img = $$(IMAGE/default) | netgear-dni NA | check-size $$$$(IMAGE_SIZE)
219 define Device/wndr3700v2
221 NETGEAR_BOARD_ID = WNDR3700v2
222 NETGEAR_KERNEL_MAGIC = 0x33373031
223 NETGEAR_HW_ID = 29763654+16+64
225 MTDPARTS = spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,15872k(firmware),64k(art)ro
226 IMAGES := sysupgrade.bin factory.img
229 define Device/wndr3800
231 NETGEAR_BOARD_ID = WNDR3800
232 NETGEAR_HW_ID = 29763654+16+128
235 define Device/wndr3800ch
237 NETGEAR_BOARD_ID = WNDR3800CH
240 define Device/wndrmac
242 NETGEAR_BOARD_ID = WNDRMAC
245 define Device/wndrmacv2
247 NETGEAR_BOARD_ID = WNDRMACv2
250 TARGET_DEVICES += wndr3700 wndr3700v2 wndr3800 wndr3800ch wndrmac wndrmacv2
254 TPLINK_HEADER_VERSION := 1
255 KERNEL := kernel-bin | patch-cmdline | lzma
256 KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | mktplinkfw-initramfs
257 IMAGES := sysupgrade.bin factory.bin
258 IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade
259 IMAGE/factory.bin := append-rootfs | mktplinkfw factory
262 define Device/tplink-nolzma
264 LOADER_FLASH_OFFS := 0x22000
265 COMPILE := loader-$(1).gz
266 COMPILE/loader-$(1).gz := loader-okli-compile
267 KERNEL := copy-file $(KDIR)/vmlinux.bin.lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1)
268 KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux-initramfs.bin.lzma | loader-kernel | mktplinkfw-initramfs
271 define Device/tplink-4m
272 $(Device/tplink-nolzma)
273 TPLINK_FLASHLAYOUT := 4M
277 define Device/tplink-8m
278 $(Device/tplink-nolzma)
279 TPLINK_FLASHLAYOUT := 8M
283 define Device/tplink-4mlzma
285 TPLINK_FLASHLAYOUT := 4Mlzma
289 define Device/tplink-8mlzma
291 TPLINK_FLASHLAYOUT := 8Mlzma
295 define Device/tplink-16mlzma
297 TPLINK_FLASHLAYOUT := 16Mlzma
301 define Device/tl-wdr4300-v1
302 $(Device/tplink-8mlzma)
303 BOARDNAME = TL-WDR4300
304 DEVICE_PROFILE = TLWDR4300
305 TPLINK_HWID := 0x43000001
308 define Device/tl-wdr3500-v1
309 $(Device/tl-wdr4300-v1)
310 BOARDNAME = TL-WDR3500
311 TPLINK_HWID := 0x35000001
314 define Device/tl-wdr3600-v1
315 $(Device/tl-wdr4300-v1)
316 TPLINK_HWID := 0x36000001
319 define Device/tl-wdr4300-v1-il
320 $(Device/tl-wdr4300-v1)
321 TPLINK_HWID := 0x43008001
324 define Device/tl-wdr4310-v1
325 $(Device/tl-wdr4300-v1)
326 TPLINK_HWID := 0x43100001
329 define Device/mw4530r-v1
330 $(Device/tl-wdr4300-v1)
331 TPLINK_HWID := 0x45300001
333 TARGET_DEVICES += tl-wdr3500-v1 tl-wdr3600-v1 tl-wdr4300-v1 tl-wdr4300-v1-il tl-wdr4310-v1 mw4530r-v1
335 define Device/tl-wdr6500-v2
336 $(Device/tplink-8mlzma)
337 BOARDNAME = TL-WDR6500-v2
338 DEVICE_PROFILE = TLWDR6500V2
339 TPLINK_HWID := 0x65000002
340 TPLINK_HEADER_VERSION := 2
342 TARGET_DEVICES += tl-wdr6500-v2
344 define Device/tl-wdr3320-v2
345 $(Device/tplink-4mlzma)
346 BOARDNAME = TL-WDR3320-v2
347 DEVICE_PROFILE = TLWDR3320V2
348 TPLINK_HWID := 0x33200002
349 TPLINK_HEADER_VERSION := 2
351 TARGET_DEVICES += tl-wdr3320-v2
353 define Device/archer-c5-v1
354 $(Device/tplink-16mlzma)
355 BOARDNAME := ARCHER-C5
356 DEVICE_PROFILE := ARCHERC7
357 TPLINK_HWID := 0xc5000001
360 define Device/archer-c7-v1
361 $(Device/tplink-8mlzma)
362 BOARDNAME := ARCHER-C7
363 DEVICE_PROFILE := ARCHERC7
364 TPLINK_HWID := 0x75000001
367 define Device/archer-c7-v2
368 $(Device/tplink-16mlzma)
369 BOARDNAME := ARCHER-C7
370 DEVICE_PROFILE := ARCHERC7
371 TPLINK_HWID := 0xc7000002
373 TARGET_DEVICES += archer-c5-v1 archer-c7-v1 archer-c7-v2
375 define Device/antminer-s1
376 $(Device/tplink-8mlzma)
377 BOARDNAME := ANTMINER-S1
378 DEVICE_PROFILE := ANTMINERS1
379 TPLINK_HWID := 0x04440101
380 CONSOLE := ttyATH0,115200
383 define Device/antminer-s3
384 $(Device/tplink-8mlzma)
385 BOARDNAME := ANTMINER-S3
386 DEVICE_PROFILE := ANTMINERS3
387 TPLINK_HWID := 0x04440301
388 CONSOLE := ttyATH0,115200
391 define Device/el-m150
392 $(Device/tplink-8mlzma)
394 DEVICE_PROFILE := ELM150
395 TPLINK_HWID := 0x01500101
396 CONSOLE := ttyATH0,115200
399 define Device/el-mini
400 $(Device/tplink-8mlzma)
402 DEVICE_PROFILE := ELMINI
403 TPLINK_HWID := 0x01530001
404 CONSOLE := ttyATH0,115200
406 TARGET_DEVICES += antminer-s1 antminer-s3 el-m150 el-mini
408 define Device/gl-inet-6408A-v1
409 $(Device/tplink-8mlzma)
411 DEVICE_PROFILE := GLINET
412 TPLINK_HWID := 0x08000001
413 CONSOLE := ttyATH0,115200
416 define Device/gl-inet-6416A-v1
417 $(Device/tplink-16mlzma)
419 DEVICE_PROFILE := GLINET
420 TPLINK_HWID := 0x08000001
421 CONSOLE := ttyATH0,115200
423 TARGET_DEVICES += gl-inet-6408A-v1 gl-inet-6416A-v1
425 define Device/rnx-n360rt
427 BOARDNAME := TL-WR941ND
428 DEVICE_PROFILE := RNXN360RT
429 TPLINK_HWID := 0x09410002
430 TPLINK_HWREV := 0x00420001
432 TARGET_DEVICES += rnx-n360rt
434 define Device/mc-mac1200r
435 $(Device/tplink-8mlzma)
436 BOARDNAME := MC-MAC1200R
437 DEVICE_PROFILE := MAC1200R
438 TPLINK_HWID := 0x12000001
440 TARGET_DEVICES += mc-mac1200r
442 define Device/minibox-v1
443 $(Device/tplink-16mlzma)
444 BOARDNAME := MINIBOX-V1
445 DEVICE_PROFILE := MINIBOXV1
446 TPLINK_HWID := 0x3C000201
447 CONSOLE := ttyATH0,115200
449 TARGET_DEVICES += minibox-v1
451 define Device/onion-omega
452 $(Device/tplink-16mlzma)
453 BOARDNAME := ONION-OMEGA
454 DEVICE_PROFILE := OMEGA
455 TPLINK_HWID := 0x04700001
456 CONSOLE := ttyATH0,115200
458 TARGET_DEVICES += onion-omega
460 define Device/tl-mr10u-v1
461 $(Device/tplink-4mlzma)
462 BOARDNAME := TL-MR10U
463 DEVICE_PROFILE := TLMR10U
464 TPLINK_HWID := 0x00100101
465 CONSOLE := ttyATH0,115200
468 define Device/tl-mr11u-v1
469 $(Device/tplink-4mlzma)
470 BOARDNAME := TL-MR11U
471 DEVICE_PROFILE := TLMR11U
472 TPLINK_HWID := 0x00110101
473 CONSOLE := ttyATH0,115200
476 define Device/tl-mr11u-v2
477 $(Device/tplink-4mlzma)
478 BOARDNAME := TL-MR11U
479 DEVICE_PROFILE := TLMR11U
480 TPLINK_HWID := 0x00110102
481 CONSOLE := ttyATH0,115200
484 define Device/tl-mr12u-v1
485 $(Device/tplink-4mlzma)
486 BOARDNAME := TL-MR13U
487 DEVICE_PROFILE := TLMR12U
488 TPLINK_HWID := 0x00120101
489 CONSOLE := ttyATH0,115200
492 define Device/tl-mr13u-v1
493 $(Device/tplink-4mlzma)
494 BOARDNAME := TL-MR13U
495 DEVICE_PROFILE := TLMR13U
496 TPLINK_HWID := 0x00130101
497 CONSOLE := ttyATH0,115200
499 TARGET_DEVICES += tl-mr10u-v1 tl-mr11u-v1 tl-mr11u-v2 tl-mr12u-v1 tl-mr13u-v1
501 define Device/tl-mr3020-v1
502 $(Device/tplink-4mlzma)
503 BOARDNAME := TL-MR3020
504 DEVICE_PROFILE := TLMR3020
505 TPLINK_HWID := 0x30200001
506 CONSOLE := ttyATH0,115200
509 define Device/tl-mr3040-v1
510 $(Device/tplink-4mlzma)
511 BOARDNAME := TL-MR3040
512 DEVICE_PROFILE := TLMR3040
513 TPLINK_HWID := 0x30400001
514 CONSOLE := ttyATH0,115200
517 define Device/tl-mr3040-v2
518 $(Device/tplink-4mlzma)
519 BOARDNAME := TL-MR3040-v2
520 DEVICE_PROFILE := TLMR3040
521 TPLINK_HWID := 0x30400002
522 CONSOLE := ttyATH0,115200
525 define Device/tl-mr3220-v1
527 BOARDNAME := TL-MR3220
528 DEVICE_PROFILE := TLMR3220
529 TPLINK_HWID := 0x32200001
532 define Device/tl-mr3220-v2
533 $(Device/tplink-4mlzma)
534 BOARDNAME := TL-MR3220-v2
535 DEVICE_PROFILE := TLMR3220
536 TPLINK_HWID := 0x32200002
537 CONSOLE := ttyATH0,115200
540 define Device/tl-mr3420-v1
542 BOARDNAME := TL-MR3420
543 DEVICE_PROFILE := TLMR3420
544 TPLINK_HWID := 0x34200001
547 define Device/tl-mr3420-v2
548 $(Device/tplink-4mlzma)
549 BOARDNAME := TL-MR3420-v2
550 DEVICE_PROFILE := TLMR3420
551 TPLINK_HWID := 0x34200002
553 TARGET_DEVICES += tl-mr3020-v1 tl-mr3040-v1 tl-mr3040-v2 tl-mr3220-v1 tl-mr3220-v2 tl-mr3420-v1 tl-mr3420-v2
555 define Device/tl-wr703n-v1
556 $(Device/tplink-4mlzma)
557 BOARDNAME := TL-WR703N
558 DEVICE_PROFILE := TLWR703
559 TPLINK_HWID := 0x07030101
560 CONSOLE := ttyATH0,115200
563 define Device/tl-wr710n-v1
564 $(Device/tplink-8mlzma)
565 BOARDNAME := TL-WR710N
566 DEVICE_PROFILE := TLWR710
567 TPLINK_HWID := 0x07100001
568 CONSOLE := ttyATH0,115200
571 define Device/tl-wr710n-v2
572 $(Device/tplink-4mlzma)
573 BOARDNAME := TL-WR710N
574 DEVICE_PROFILE := TLWR710
575 TPLINK_HWID := 0x07100002
576 CONSOLE := ttyATH0,115200
579 define Device/tl-wr720n-v3
580 $(Device/tplink-4mlzma)
581 BOARDNAME := TL-WR720N-v3
582 DEVICE_PROFILE := TLWR720
583 TPLINK_HWID := 0x07200103
584 CONSOLE := ttyATH0,115200
587 define Device/tl-wr720n-v4
588 $(Device/tplink-4mlzma)
589 BOARDNAME := TL-WR720N-v3
590 DEVICE_PROFILE := TLWR720
591 TPLINK_HWID := 0x07200104
592 CONSOLE := ttyATH0,115200
594 TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr720n-v3 tl-wr720n-v4
596 define Device/tl-wr740n-v1
598 BOARDNAME := TL-WR741ND
599 DEVICE_PROFILE := TLWR740
600 TPLINK_HWID := 0x07400001
603 define Device/tl-wr740n-v3
605 BOARDNAME := TL-WR741ND
606 DEVICE_PROFILE := TLWR740
607 TPLINK_HWID := 0x07400003
610 define Device/tl-wr740n-v4
611 $(Device/tplink-4mlzma)
612 BOARDNAME := TL-WR741ND-v4
613 DEVICE_PROFILE := TLWR740
614 TPLINK_HWID := 0x07400004
615 CONSOLE := ttyATH0,115200
618 define Device/tl-wr740n-v5
619 $(Device/tplink-4mlzma)
620 BOARDNAME := TL-WR741ND-v4
621 DEVICE_PROFILE := TLWR740
622 TPLINK_HWID := 0x07400005
623 CONSOLE := ttyATH0,115200
626 define Device/tl-wr741nd-v1
628 BOARDNAME := TL-WR741ND
629 DEVICE_PROFILE := TLWR741
630 TPLINK_HWID := 0x07410001
633 define Device/tl-wr741nd-v2
635 BOARDNAME := TL-WR741ND
636 DEVICE_PROFILE := TLWR741
637 TPLINK_HWID := 0x07410001
640 define Device/tl-wr741nd-v4
641 $(Device/tplink-4mlzma)
642 BOARDNAME := TL-WR741ND-v4
643 DEVICE_PROFILE := TLWR741
644 TPLINK_HWID := 0x07410004
645 CONSOLE := ttyATH0,115200
648 define Device/tl-wr741nd-v5
649 $(Device/tplink-4mlzma)
650 BOARDNAME := TL-WR741ND-v4
651 DEVICE_PROFILE := TLWR741
652 TPLINK_HWID := 0x07400005
653 CONSOLE := ttyATH0,115200
656 define Device/tl-wr743nd-v1
658 BOARDNAME := TL-WR741ND
659 DEVICE_PROFILE := TLWR743
660 TPLINK_HWID := 0x07430001
663 define Device/tl-wr743nd-v2
664 $(Device/tplink-4mlzma)
665 BOARDNAME := TL-WR741ND-v4
666 DEVICE_PROFILE := TLWR743
667 TPLINK_HWID := 0x07430002
668 CONSOLE := ttyATH0,115200
670 TARGET_DEVICES += tl-wr740n-v1 tl-wr740n-v3 tl-wr740n-v4 tl-wr740n-v5 tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr741nd-v5 tl-wr743nd-v1 tl-wr743nd-v2
672 define Device/tl-wr841nd-v3
674 BOARDNAME := TL-WR941ND
675 DEVICE_PROFILE := TLWR841
676 TPLINK_HWID := 0x08410003
680 define Device/tl-wr841nd-v5
682 BOARDNAME := TL-WR741ND
683 DEVICE_PROFILE := TLWR841
684 TPLINK_HWID := 0x08410005
687 define Device/tl-wr841nd-v7
689 BOARDNAME := TL-WR841N-v7
690 DEVICE_PROFILE := TLWR841
691 TPLINK_HWID := 0x08410007
694 define Device/tl-wr841n-v8
695 $(Device/tplink-4mlzma)
696 BOARDNAME := TL-WR841N-v8
697 DEVICE_PROFILE := TLWR841
698 TPLINK_HWID := 0x08410008
701 define Device/tl-wr841n-v9
702 $(Device/tplink-4mlzma)
703 BOARDNAME := TL-WR841N-v9
704 DEVICE_PROFILE := TLWR841
705 TPLINK_HWID := 0x08410009
708 define Device/tl-wr841n-v10
709 $(Device/tplink-4mlzma)
710 BOARDNAME := TL-WR841N-v9
711 DEVICE_PROFILE := TLWR841
712 TPLINK_HWID := 0x08410010
715 define Device/tl-wr842n-v1
717 BOARDNAME := TL-MR3420
718 DEVICE_PROFILE := TLWR842
719 TPLINK_HWID := 0x08420001
722 define Device/tl-wr842n-v2
723 $(Device/tplink-8mlzma)
724 BOARDNAME := TL-WR842N-v2
725 DEVICE_PROFILE := TLWR842
726 TPLINK_HWID := 0x8420002
729 define Device/tl-wr843nd-v1
730 $(Device/tplink-4mlzma)
731 BOARDNAME := TL-WR841N-v8
732 DEVICE_PROFILE := TLWR843
733 TPLINK_HWID := 0x08430001
736 define Device/tl-wr847n-v8
737 $(Device/tplink-4mlzma)
738 BOARDNAME := TL-WR841N-v8
739 DEVICE_PROFILE := TLWR841
740 TPLINK_HWID := 0x08470008
742 TARGET_DEVICES += tl-wr841nd-v3 tl-wr841nd-v5 tl-wr841nd-v7 tl-wr841n-v8 tl-wr841n-v9 tl-wr841n-v10 tl-wr842n-v1 tl-wr842n-v2 tl-wr843nd-v1 tl-wr847n-v8
744 define Device/tl-wr941nd-v2
746 BOARDNAME := TL-WR941ND
747 DEVICE_PROFILE := TLWR941
748 TPLINK_HWID := 0x09410002
752 define Device/tl-wr941nd-v3
754 BOARDNAME := TL-WR941ND
755 DEVICE_PROFILE := TLWR941
756 TPLINK_HWID := 0x09410002
760 define Device/tl-wr941nd-v4
762 BOARDNAME := TL-WR741ND
763 DEVICE_PROFILE := TLWR941
764 TPLINK_HWID := 0x09410004
767 define Device/tl-wr941nd-v5
768 $(Device/tplink-4mlzma)
769 BOARDNAME := TL-WR941ND-v5
770 DEVICE_PROFILE := TLWR941
771 TPLINK_HWID := 0x09410005
774 # Chinese version (unlike European) is similar to the TL-WDR3500
775 define Device/tl-wr941nd-v6-cn
776 $(Device/tplink-4mlzma)
777 BOARDNAME := TL-WDR3500
778 DEVICE_PROFILE := TLWR941
779 TPLINK_HWID := 0x09410006
781 TARGET_DEVICES += tl-wr941nd-v2 tl-wr941nd-v3 tl-wr941nd-v4 tl-wr941nd-v5 tl-wr941nd-v6-cn
783 define Device/tl-wr1041n-v2
784 $(Device/tplink-4mlzma)
785 BOARDNAME := TL-WR1041N-v2
786 DEVICE_PROFILE := TLWR1041
787 TPLINK_HWID := 0x10410002
789 TARGET_DEVICES += tl-wr1041n-v2
791 define Device/tl-wr1043nd-v1
793 BOARDNAME := TL-WR1043ND
794 DEVICE_PROFILE := TLWR1043
795 TPLINK_HWID := 0x10430001
798 define Device/tl-wr1043nd-v2
799 $(Device/tplink-8mlzma)
800 BOARDNAME := TL-WR1043ND-v2
801 DEVICE_PROFILE := TLWR1043
802 TPLINK_HWID := 0x10430002
804 TARGET_DEVICES += tl-wr1043nd-v1 tl-wr1043nd-v2
806 define Device/tl-wr2543-v1
807 $(Device/tplink-8mlzma)
808 BOARDNAME := TL-WR2543N
809 DEVICE_PROFILE := TLWR2543
810 TPLINK_HWID := 0x25430001
811 IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade "-v 3.13.99"
812 IMAGE/factory.bin := append-rootfs | mktplinkfw factory "-v 3.13.99"
814 TARGET_DEVICES += tl-wr2543-v1
816 define Device/tl-wdr4900-v2
817 $(Device/tplink-8mlzma)
818 BOARDNAME := TL-WDR4900-v2
819 DEVICE_PROFILE := TLWDR4900V2
820 TPLINK_HWID := 0x49000002
822 TARGET_DEVICES += tl-wdr4900-v2
824 define Device/tl-wa701n-v1
826 BOARDNAME := TL-WA901ND
827 DEVICE_PROFILE := TLWA701
828 TPLINK_HWID := 0x07010001
831 define Device/tl-wa701nd-v2
832 $(Device/tplink-4mlzma)
833 BOARDNAME := TL-WA701ND-v2
834 DEVICE_PROFILE := TLWA701
835 TPLINK_HWID := 0x07010002
836 CONSOLE := ttyATH0,115200
839 define Device/tl-wa730rev1
841 BOARDNAME := TL-WA901ND
842 DEVICE_PROFILE := TLWA730RE
843 TPLINK_HWID := 0x07300001
846 define Device/tl-wa750re-v1
847 $(Device/tplink-4mlzma)
848 BOARDNAME := TL-WA750RE
849 DEVICE_PROFILE := TLWA750
850 TPLINK_HWID := 0x07500001
853 define Device/tl-wa7510n
855 BOARDNAME := TL-WA7510N
856 DEVICE_PROFILE := TLWA7510
857 TPLINK_HWID := 0x75100001
859 TARGET_DEVICES += tl-wa701n-v1 tl-wa701nd-v2 tl-wa730rev1 tl-wa750re-v1 tl-wa7510n
861 define Device/tl-wa801nd-v1
863 BOARDNAME := TL-WA901ND
864 DEVICE_PROFILE := TLWA801
865 TPLINK_HWID := 0x08010001
868 define Device/tl-wa801nd-v2
869 $(Device/tplink-4mlzma)
870 BOARDNAME := TL-WA801ND-v2
871 DEVICE_PROFILE := TLWA801
872 TPLINK_HWID := 0x08010002
875 define Device/tl-wa830re-v1
877 BOARDNAME := TL-WA901ND
878 DEVICE_PROFILE := TLWA830
879 TPLINK_HWID := 0x08300010
882 define Device/tl-wa830re-v2
883 $(Device/tplink-4mlzma)
884 BOARDNAME := TL-WA830RE-v2
885 DEVICE_PROFILE := TLWA830
886 TPLINK_HWID := 0x08300002
889 define Device/tl-wa850re-v1
890 $(Device/tplink-4mlzma)
891 BOARDNAME := TL-WA850RE
892 DEVICE_PROFILE := TLWA850
893 TPLINK_HWID := 0x08500001
896 define Device/tl-wa860re-v1
897 $(Device/tplink-4mlzma)
898 BOARDNAME := TL-WA860RE
899 DEVICE_PROFILE := TLWA860
900 TPLINK_HWID := 0x08600001
902 TARGET_DEVICES += tl-wa801nd-v1 tl-wa801nd-v2 tl-wa830re-v1 tl-wa830re-v2 tl-wa850re-v1 tl-wa860re-v1
904 define Device/tl-wa901nd-v1
906 BOARDNAME := TL-WA901ND
907 DEVICE_PROFILE := TLWA901
908 TPLINK_HWID := 0x09010001
911 define Device/tl-wa901nd-v2
913 BOARDNAME := TL-WA901ND-v2
914 DEVICE_PROFILE := TLWA901
915 TPLINK_HWID := 0x09010002
918 define Device/tl-wa901nd-v3
919 $(Device/tplink-4mlzma)
920 BOARDNAME := TL-WA901ND-v3
921 DEVICE_PROFILE := TLWA901
922 TPLINK_HWID := 0x09010003
924 TARGET_DEVICES += tl-wa901nd-v1 tl-wa901nd-v2 tl-wa901nd-v3
926 define Device/tl-wa7210n-v2
927 $(Device/tplink-4mlzma)
928 BOARDNAME := TL-WA7210N-v2
929 DEVICE_PROFILE := TLWA7210
930 TPLINK_HWID := 0x72100002
931 CONSOLE := ttyATH0,115200
933 TARGET_DEVICES += tl-wa7210n-v2
935 define Device/smart-300
936 $(Device/tplink-8mlzma)
937 BOARDNAME := SMART-300
938 DEVICE_PROFILE := SMART-300
939 TPLINK_HWID := 0x93410001
941 TARGET_DEVICES += smart-300
944 $(Device/tplink-16mlzma)
945 BOARDNAME := GS-OOLITE
946 DEVICE_PROFILE := OOLITE
947 TPLINK_HWID := 0x3C000101
948 CONSOLE := ttyATH0,115200
950 TARGET_DEVICES += oolite
952 # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
953 # UBNT_TYPE e.g. one of (BZ, XM, XW)
954 # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
955 define Device/ubnt-xm
956 DEVICE_PROFILE := UBNT
958 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
962 IMAGES := sysupgrade.bin factory.bin
963 IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
964 IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
967 define Device/ubnt-xw
968 DEVICE_PROFILE := UBNT
970 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
974 IMAGES := sysupgrade.bin factory.bin
975 IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
976 IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
979 define Device/ubnt-bz
980 DEVICE_PROFILE := UBNT
982 MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
986 IMAGES := sysupgrade.bin factory.bin
987 IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage-split
988 IMAGE/sysupgrade.bin = append-kernel $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
991 define Device/rw2458n
996 define Device/ubnt-airrouter
1001 define Device/ubnt-bullet-m
1003 BOARDNAME := UBNT-BM
1006 define Device/ubnt-rocket-m
1008 BOARDNAME := UBNT-RM
1011 define Device/ubnt-nano-m
1013 BOARDNAME := UBNT-NM
1015 TARGET_DEVICES += rw2458n ubnt-airrouter ubnt-bullet-m ubnt-rocket-m ubnt-nano-m
1017 define Device/ubnt-unifi
1019 BOARDNAME := UBNT-UF
1020 DEVICE_PROFILE := UBNT UBNTUNIFI
1023 define Device/ubnt-unifi-outdoor
1025 BOARDNAME := UBNT-U20
1026 DEVICE_PROFILE := UBNT UBNTUNIFIOUTDOOR
1028 TARGET_DEVICES += ubnt-unifi ubnt-unifi-outdoor
1030 define Device/ubnt-nano-m-xw
1032 BOARDNAME := UBNT-NM-XW
1035 define Device/ubnt-loco-m-xw
1037 BOARDNAME := UBNT-LOCO-XW
1040 define Device/ubnt-rocket-m-xw
1042 BOARDNAME := UBNT-RM-XW
1045 define Device/ubnt-rocket-m-ti
1047 BOARDNAME := UBNT-RM-TI
1051 TARGET_DEVICES += ubnt-nano-m-xw ubnt-loco-m-xw ubnt-rocket-m-xw ubnt-rocket-m-ti
1053 define Device/ubnt-air-gateway
1055 BOARDNAME := UBNT-AGW
1059 CONSOLE = ttyATH0,115200
1061 TARGET_DEVICES += ubnt-air-gateway
1063 define Device/ubnt-air-gateway-pro
1065 BOARDNAME := UBNT-AGWP
1068 CONSOLE = ttyS0,115200
1070 TARGET_DEVICES += ubnt-air-gateway-pro
1072 define Device/ubdev01
1074 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7488k(firmware),64k(certs),256k(cfg)ro,64k(EEPROM)ro
1075 BOARDNAME := UBNT-UF
1081 TARGET_DEVICES += ubdev01
1083 define Device/ubnt-routerstation
1084 IMAGE_SIZE := 16128k
1085 IMAGES := sysupgrade.bin factory.bin
1086 IMAGE/factory.bin = append-rootfs | pad-rootfs | mkubntimage
1087 IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | combined-image | check-size $$$$(IMAGE_SIZE)
1088 KERNEL := kernel-bin | patch-cmdline | lzma | pad-to $$(BLOCKSIZE)
1091 define Device/ubnt-rs
1092 $(Device/ubnt-routerstation)
1093 BOARDNAME := UBNT-RS
1094 DEVICE_PROFILE := Madwifi UBNT UBNTRS
1100 define Device/ubnt-rspro
1101 $(Device/ubnt-routerstation)
1102 BOARDNAME := UBNT-RSPRO
1103 DEVICE_PROFILE := Madwifi UBNT UBNTRSPRO
1106 UBNT_CHIP := ar7100pro
1109 define Device/ubnt-ls-sr71
1110 $(Device/ubnt-routerstation)
1111 BOARDNAME := UBNT-LS-SR71
1112 DEVICE_PROFILE := Madwifi UBNT
1113 UBNT_BOARD := LS-SR71
1114 UBNT_TYPE := LS-SR71
1118 TARGET_DEVICES += ubnt-rs ubnt-rspro ubnt-ls-sr71
1120 define Device/ubnt-uap-pro
1121 IMAGE_SIZE := 15744k
1122 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)
1125 BOARDNAME := UAP-PRO
1126 DEVICE_PROFILE := UBNT UAPPRO
1127 KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | mkubntkernelimage
1128 IMAGES := sysupgrade.bin factory.bin
1129 IMAGE/sysupgrade.bin = append-kernel 1536k | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
1130 IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage2
1133 define Device/ubnt-unifi-outdoor-plus
1134 $(Device/ubnt-uap-pro)
1136 BOARDNAME := UBNT-UOP
1137 DEVICE_PROFILE := UBNT
1140 TARGET_DEVICES += ubnt-uap-pro ubnt-unifi-outdoor-plus
1142 rootfs_type=$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))
1144 # $(1): rootfs type.
1147 $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(call rootfs_type,$(1))
1151 $(patsubst %-256k,0x40000,$(patsubst %-128k,0x20000,$(patsubst %-64k,0x10000,$(patsubst squashfs%,0x4,$(patsubst root.%,%,$(1))))))
1155 $(call imgname,$(1),$(2))-sysupgrade.bin
1159 $(call imgname,$(1),$(2))-factory.bin
1165 $(if $(1),board=$(1) )$(if $(2),console=$(2)$(COMMA)$(3))
1169 $(shell sz=`echo '$(2)' | sed -ne 's/.*[:$(COMMA)]\([0-9]*\)k[@]*[0-9a-zx]*($(1)).*/\1/p'`; [ -n "$$sz" ] && echo $$(($$sz * 1024)))
1174 # $(1) : name of image build method to be used, e.g., AthLzma.
1175 # $(2) : name of the build template to be used, e.g. 64k, 64kraw, 128k, etc.
1176 # $(3) : name of the profile to be defined.
1177 # $(4) : board name.
1178 # $(5)~$(7) : arguments for $(mkcmdline)
1179 # board=$(1) console=$(2),$(3)
1180 # $(8)~$(14): extra arguments.
1181 define SingleProfile
1182 # $(1): action name, e.g. loader, buildkernel, squashfs, etc.
1183 define Image/Build/Profile/$(3)
1184 $$(call Image/Build/Template/$(2)/$$(1),$(1),$(4),$$(call mkcmdline,$(5),$(6),$(7)),$(8),$(9),$(10),$(11),$(12),$(13),$(14))
1186 SINGLE_PROFILES += $(3)
1189 # $(1), name of the MultiProfile to be added.
1190 # $(2), name of Profiles to be included in the MultiProfile.
1192 define Image/Build/Profile/$(1)
1194 $$(call Image/Build/Profile/$p,$$(1))
1199 LOADER_MAKE := $(NO_TRACE_MAKE) -C lzma-loader KDIR=$(KDIR)
1201 VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux
1202 UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage
1205 # $(2): output file.
1206 # $(3): extra arguments for lzma.
1208 $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(3) $(2)
1212 cp $(KDIR)/vmlinux$(3) $(KDIR_TMP)/vmlinux$(3)-$(1)
1213 $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(3)-$(1) "$(strip $(2))"
1216 define PatchKernel/initramfs
1217 $(call PatchKernel,$(1),$(2),-initramfs)
1218 cp $(KDIR_TMP)/vmlinux-initramfs-$(1) $(call imgname,initramfs,$(1)).bin
1222 # $(2): kernel command line.
1223 # $(3): extra argumetns for lzma.
1224 # $(4): name suffix, e.g. "-initramfs".
1225 define PatchKernelLzma
1226 cp $(KDIR)/vmlinux$(4) $(KDIR_TMP)/vmlinux$(4)-$(1)
1227 $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(4)-$(1) "$(strip $(2))"
1228 $(call CompressLzma,$(KDIR_TMP)/vmlinux$(4)-$(1),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(3))
1231 define PatchKernelGzip
1232 cp $(KDIR)/vmlinux$(3) $(KDIR_TMP)/vmlinux$(3)-$(1)
1233 $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR_TMP)/vmlinux$(3)-$(1) "$(strip $(2))"
1234 gzip -9n -c $(KDIR_TMP)/vmlinux$(3)-$(1) > $(KDIR_TMP)/vmlinux$(3)-$(1).bin.gz
1237 ifneq ($(SUBTARGET),mikrotik)
1238 # $(1): compression method of the data.
1239 # $(2): extra arguments.
1240 # $(3): input data file.
1241 # $(4): output file.
1243 mkimage -A mips -O linux -T kernel -a 0x80060000 -C $(1) $(2) \
1244 -e 0x80060000 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
1249 # $(2): kernel command line.
1250 # $(3): extra arguments for lzma.
1251 # $(4): name suffix, e.g. "-initramfs".
1252 # $(5): extra arguments for mkimage.
1254 $(call PatchKernelLzma,$(1),$(2),$(3),$(4))
1255 $(call MkuImage,lzma,$(5),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(KDIR_TMP)/vmlinux$(4)-$(1).uImage)
1258 define MkuImageLzma/initramfs
1259 $(call PatchKernelLzma,$(1),$(2),$(3),-initramfs)
1260 $(call MkuImage,lzma,$(4),$(KDIR_TMP)/vmlinux-initramfs-$(1).bin.lzma,$(call imgname,initramfs,$(1))-uImage.bin)
1264 $(call PatchKernelGzip,$(1),$(2))
1265 $(call MkuImage,gzip,,$(KDIR_TMP)/vmlinux-$(1).bin.gz,$(KDIR_TMP)/vmlinux-$(1).uImage)
1268 define MkuImageGzip/initramfs
1269 $(call PatchKernelGzip,$(1),$(2),-initramfs)
1270 $(call MkuImage,gzip,,$(KDIR_TMP)/vmlinux-initramfs-$(1).bin.gz,$(call imgname,initramfs,$(1))-uImage.bin)
1274 $(call MkuImage,lzma,-M 0x4f4b4c49,$(KDIR)/vmlinux.bin.lzma,$(KDIR_TMP)/vmlinux-$(1).okli)
1278 # $(1): name of the 1st file.
1279 # $(2): size limit of the 1st file if it is greater than 262144, or
1280 # the erase size of the flash if it is greater than zero and less
1282 # $(3): name of the 2nd file.
1283 # $(4): size limit of the 2nd file if $(2) is greater than 262144, otherwise
1284 # it is the size limit of the output file
1285 # $(5): name of the output file.
1286 # $(6): padding size.
1288 if [ $(2) -eq 0 ]; then \
1289 filename="$(3)"; fstype=$$$${filename##*\.}; \
1290 case "$$$${fstype}" in \
1291 "jffs2-64k") bs=65536;; \
1292 "jffs2-128k") bs=131072;; \
1293 "jffs2-256k") bs=262144;; \
1294 *) bs=`stat -c%s $(1)`;; \
1296 ( dd if=$(1) bs=$$$${bs} conv=sync; cat $(3) ) > $(5); \
1297 if [ -n "$(6)" ]; then \
1298 case "$$$${fstype}" in \
1300 padjffs2 $(5) $(6); \
1304 if [ `stat -c%s $(5)` -gt $(4) ]; then \
1305 echo "Warning: $(5) is too big (> $(4) bytes)" >&2; \
1308 else if [ $(2) -gt 262144 ]; then \
1309 if [ `stat -c%s "$(1)"` -gt $(2) ]; then \
1310 echo "Warning: $(1) is too big (> $(2) bytes)" >&2; \
1311 else if [ `stat -c%s $(3)` -gt $(4) ]; then \
1312 echo "Warning: $(3) is too big (> $(4) bytes)" >&2; \
1314 ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \
1317 ( dd if=$(1) bs=$(2) conv=sync; dd if=$(3) ) > $(5); \
1318 if [ `stat -c%s $(5)` -gt $(4) ]; then \
1319 echo "Warning: $(5) is too big (> $(4) bytes)" >&2; \
1325 # $(1): rootfs type.
1327 # $(3): kernel image size limit.
1328 # $(4): rootfs image size limit.
1329 # $(5): padding argument for padjffs2.
1330 Sysupgrade/KR=$(call CatFiles,$(2),$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(5)))
1331 Sysupgrade/KRuImage=$(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage,$(3),$(KDIR)/root.$(1),$(4),$(call sysupname,$(1),$(2)),$(5))
1332 Sysupgrade/RKuImage=$(call CatFiles,$(KDIR)/root.$(1),$(4),$(KDIR_TMP)/vmlinux-$(2).uImage,$(3),$(call sysupname,$(1),$(2)))
1334 # $(1): ubinize ini file
1335 # $(2): working directory
1337 # $(4): physical erase block size
1338 # $(5): minimum I/O unit size
1339 # $(6): custom options
1342 ( cd $(2); $(STAGING_DIR_HOST)/bin/ubinize -o $(3) -p $(4) -m $(5) $(6) $(1))
1346 # Embed lzma-compressed kernel inside lzma-loader.
1348 # $(1), suffix of output filename, e.g. generic, lowercase board name, etc.
1349 # $(2), suffix of target file to build, e.g. bin, gz, elf
1350 # $(3), kernel command line to pass from lzma-loader to kernel
1352 # $(5), suffix of kernel filename, e.g. -initramfs, or empty
1353 define Image/BuildLoader
1354 -rm -rf $(KDIR)/lzma-loader
1355 $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)"\
1356 LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
1357 LOADER_DATA="$(KDIR)/vmlinux$(5).bin.lzma" BOARD="$(1)" \
1359 -$(CP) $(KDIR)/loader-$(1).$(2) $(KDIR)/loader-$(1)$(5).$(2)
1363 # Embed patched lzma-compressed kernel inside lzma-loader.
1365 # Specifying the command line via the lzma-loader doesn't work with some
1366 # models (like the TP-LINK CPE series), so this version first patches the
1367 # command line in the image and then builds the loader around it.
1369 # $(1), suffix of output filename, e.g. generic, lowercase board name, etc.
1370 # $(2), suffix of target file to build, e.g. bin, gz, elf
1371 # $(3), kernel command line to pass from lzma-loader to kernel
1373 # $(5), suffix of kernel filename, e.g. -initramfs, or empty
1374 define Image/BuildLoaderPatched
1375 $(call PatchKernelLzma,$(1),$(3))
1376 -rm -rf $(KDIR)/lzma-loader
1377 $(LOADER_MAKE) LOADER=loader-$(1).$(2) \
1378 LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
1379 LOADER_DATA="$(KDIR_TMP)/vmlinux-$(1)$(5).bin.lzma" BOARD="$(1)" \
1381 -$(CP) $(KDIR)/loader-$(1).$(2) $(KDIR)/loader-$(1)$(5).$(2)
1385 # Build lzma-loader alone which will search for lzma-compressed kernel identified by
1386 # uImage header with magic "OKLI" at boot time.
1388 # $(4), offset into the flash space to start searching uImage magic "OKLI".
1389 # $(5), size of search range starting at $(4). With 0 as the value, uImage
1390 # header is expected to be at precisely $(4)
1391 define Image/BuildLoaderAlone
1392 -rm -rf $(KDIR)/lzma-loader
1393 $(LOADER_MAKE) LOADER=loader-$(1).$(2) KERNEL_CMDLINE="$(3)" \
1394 LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
1395 BOARD="$(1)" FLASH_OFFS=$(4) FLASH_MAX=$(5) \
1400 $(LOADER_MAKE) clean
1404 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)
1405 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)
1406 alfa_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,15936k(firmware),64k(nvram),64k(art)ro
1407 all0258n_mtdlayout=mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),6272k(firmware),1536k(failsafe),64k(art)
1408 all0315n_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env),13568k(firmware),2048k(failsafe),256k(art)ro
1409 ap81_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,5120k(rootfs),2688k(kernel),64k(art)ro,7808k@0x50000(firmware)
1410 ap83_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,128k(u-boot-env)ro,4096k(rootfs),3648k(kernel),64k(art)ro,7744k@0x60000(firmware)
1411 ap96_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1728k(kernel),64k(art)ro,7872k@0x40000(firmware)
1412 ap113_mtd_layout=mtdparts=spi0.0:64k(u-boot),3008k(rootfs),896k(uImage),64k(NVRAM),64k(ART),3904k@0x10000(firmware)
1413 ap121_mtdlayout_2M=mtdparts=spi0.0:64k(u-boot)ro,1216k(rootfs),704k(kernel),64k(art)ro,1920k@0x10000(firmware)
1414 ap121_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2448k(rootfs),1200k(kernel),64k(nvram),64k(art)ro,3648k@0x50000(firmware)
1415 ap121_mtdlayout_8M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1600k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware)
1416 ap132_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),6400k(rootfs),64k(art),7808k@0x50000(firmware)
1417 ap135_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
1418 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)
1419 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)
1420 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)
1421 ap147_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art),16000k@0x50000(firmware)
1422 ap152_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)
1423 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
1424 cameo_ap81_mtdlayout=mtdparts=spi0.0:128k(u-boot)ro,64k(config)ro,3840k(firmware),64k(art)ro
1425 cameo_ap91_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,3712k(firmware),64k(mac)ro,64k(art)ro
1426 cameo_ap99_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,3520k(firmware),64k(mac)ro,192k(lp)ro,64k(art)ro
1427 cameo_ap121_mtdlayout=mtdparts=spi0.0:64k(u-boot)ro,64k(art)ro,64k(mac)ro,64k(nvram)ro,192k(language)ro,3648k(firmware)
1428 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)
1429 cameo_ap123_mtdlayout_4M=mtdparts=spi0.0:64k(u-boot)ro,64k(nvram)ro,3712k(firmware),192k(lang)ro,64k(art)ro
1430 cameo_db120_mtdlayout=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,15936k(firmware),192k(lang)ro,64k(mac)ro,64k(art)ro
1431 cameo_db120_mtdlayout_8M=mtdparts=spi0.0:64k(uboot)ro,64k(nvram)ro,7872k(firmware),128k(lang)ro,64k(art)ro
1432 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)
1433 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)
1434 eap300v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),320k(custom),13632k(firmware),2048k(failsafe),64k(art)ro
1435 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)
1436 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
1437 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
1438 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
1439 cameo_ap94_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,1600k(unknown)ro,64k@0x7f0000(caldata_copy)
1440 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)
1441 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)
1442 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)
1443 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)
1444 ew-dorin_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),3712k(firmware),64k(art)
1445 ew-dorin_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
1446 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)
1447 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)
1448 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)
1449 dragino2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,16000k(firmware),64k(config)ro,64k(art)ro
1450 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)
1451 mr12_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x80000(firmware)
1452 mr16_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x80000(firmware)
1453 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)
1454 planex_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),128k(art)ro
1455 ubntxm_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro
1456 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)
1457 ubdev_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7488k(firmware),64k(certs),256k(cfg)ro,64k(EEPROM)ro
1458 whrhpg300n_mtdlayout=mtdparts=spi0.0:248k(u-boot)ro,8k(u-boot-env)ro,3712k(firmware),64k(art)ro
1459 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)
1460 wpj344_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
1461 wpj531_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
1462 wpj558_mtdlayout_16M=mtdparts=spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro
1463 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)
1464 wnr2200_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro
1465 wnr2000v3_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmware),64k(art)ro
1466 wnr2000v4_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,3776k(firmware),64k(art)ro
1467 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)
1468 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)
1469 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)
1470 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
1471 mynet_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro
1472 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)
1473 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)
1476 define Image/BuildKernel
1477 cp $(KDIR)/vmlinux.elf $(VMLINUX).elf
1478 cp $(KDIR)/vmlinux $(VMLINUX).bin
1479 dd if=$(KDIR)/vmlinux.bin.lzma of=$(VMLINUX).lzma bs=65536 conv=sync
1480 dd if=$(KDIR)/vmlinux.bin.gz of=$(VMLINUX).gz bs=65536 conv=sync
1481 $(call MkuImage,gzip,,$(KDIR)/vmlinux.bin.gz,$(UIMAGE)-gzip.bin)
1482 $(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(UIMAGE)-lzma.bin)
1483 cp $(KDIR)/loader-generic.elf $(VMLINUX)-lzma.elf
1484 -mkdir -p $(KDIR_TMP)
1485 $(call Image/Build/Profile/$(IMAGE_PROFILE),buildkernel)
1488 define Image/BuildKernel/Initramfs
1489 cp $(KDIR)/vmlinux-initramfs.elf $(VMLINUX)-initramfs.elf
1490 cp $(KDIR)/vmlinux-initramfs $(VMLINUX)-initramfs.bin
1491 dd if=$(KDIR)/vmlinux-initramfs.bin.lzma of=$(VMLINUX)-initramfs.lzma bs=65536 conv=sync
1492 dd if=$(KDIR)/vmlinux-initramfs.bin.gz of=$(VMLINUX)-initramfs.gz bs=65536 conv=sync
1493 $(call MkuImage,gzip,,$(KDIR)/vmlinux-initramfs.bin.gz,$(UIMAGE)-initramfs-gzip.bin)
1494 $(call MkuImage,lzma,,$(KDIR)/vmlinux-initramfs.bin.lzma,$(UIMAGE)-initramfs-lzma.bin)
1495 cp $(KDIR)/loader-generic-initramfs.elf $(VMLINUX)-initramfs-lzma.elf
1496 $(call Image/Build/Initramfs)
1499 Image/Build/WRT400N/buildkernel=$(call MkuImageLzma,$(2),$(3))
1501 define Image/Build/WRT400N
1502 $(call Sysupgrade/KRuImage,$(1),$(2),1310720,6488064)
1503 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1504 wrt400n $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR)/root.$(1) $(call factoryname,$(1),$(2)); \
1509 define Image/Build/CameoAP94/buildkernel
1510 $(call MkuImageLzma,$(2),$(3) $(4))
1511 $(call MkuImageLzma,$(2)-fat,$(3) $(5))
1514 define Image/Build/CameoAP94
1515 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1516 $(eval fwsize_fat=$(call mtdpartsize,firmware,$(5)))
1517 $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
1518 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1520 dd if=$(call sysupname,$(1),$(2)); \
1522 ) > $(call imgname,$(1),$(2))-backup-loader.bin; \
1523 if [ `stat -c%s $(call sysupname,$(1),$(2))` -gt 4194304 ]; then \
1524 echo "Warning: $(call sysupname,$(1),$(2)) is too big" >&2; \
1527 dd if=$(call sysupname,$(1),$(2)) bs=4096k conv=sync; \
1529 ) > $(call factoryname,$(1),$(2)); \
1532 $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2)-fat.uImage,0,$(KDIR)/root.$(1),$$$$(($(fwsize_fat)-4*64*1024)),$(KDIR_TMP)/$(2)-fat.bin,64)
1533 if [ -e "$(KDIR_TMP)/$(2)-fat.bin" ]; then \
1534 echo -n "" > $(KDIR_TMP)/$(2)-fat.dummy; \
1535 sh $(TOPDIR)/scripts/combined-image.sh \
1536 "$(KDIR_TMP)/$(2)-fat.bin" \
1537 "$(KDIR_TMP)/$(2)-fat.dummy" \
1538 $(call sysupname,$(1),$(2)-fat); \
1542 define Image/Build/WZRHP
1543 $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(3)-4*$(4)*1024)),$(4))
1544 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1546 echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
1547 dd if=$(call sysupname,$(1),$(2)); \
1548 ) > $(call imgname,$(1),$(2))-tftp.bin; \
1549 buffalo-enc -p $(5) -v 1.99 \
1550 -i $(call sysupname,$(1),$(2)) \
1551 -o $(KDIR_TMP)/$(2).enc; \
1552 buffalo-tag -b $(5) -p $(5) -a ath -v 1.99 -m 1.01 -l mlang8 \
1553 -w 3 -c 0x80041000 -d 0x801e8000 -f 1 -r M_ \
1554 -i $(KDIR_TMP)/$(2).enc \
1555 -o $(call factoryname,$(1),$(2)); \
1559 Image/Build/WZRHP64K/buildkernel=$(call MkuImageLzma,$(2),$(3))
1560 Image/Build/WZRHP64K/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1561 Image/Build/WZRHP64K=$(call Image/Build/WZRHP,$(1),$(2),33095680,64,$(4))
1563 Image/Build/WZRHP128K/buildkernel=$(call MkuImageLzma,$(2),$(3))
1564 Image/Build/WZRHP128K/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1565 Image/Build/WZRHP128K=$(call Image/Build/WZRHP,$(1),$(2),33030144,128,$(4))
1568 Image/Build/WHRHPG300N/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1569 Image/Build/WHRHPG300N/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1571 define Image/Build/WHRHPG300N
1572 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1573 $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
1574 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1576 echo -n -e "# Airstation Public Fmt1\x00\x00\x00\x00\x00\x00\x00\x00"; \
1577 dd if=$(call sysupname,$(1),$(2)); \
1578 ) > $(call imgname,$(1),$(2))-tftp.bin; \
1579 buffalo-enc -p $(5) -v 1.99 \
1580 -i $(call sysupname,$(1),$(2)) \
1581 -o $(KDIR_TMP)/$(2).enc; \
1582 buffalo-tag -b $(5) -p $(5) -a ath -v 1.99 -m 1.01 -l mlang8 \
1583 -w 3 -c 0x80041000 -d 0x801e8000 -f 1 -r M_ \
1584 -i $(KDIR_TMP)/$(2).enc \
1585 -o $(call factoryname,$(1),$(2)); \
1590 define Image/Build/Cameo
1591 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1592 $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
1593 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1594 factory_size=$$$$(($(fwsize) - $(6))); \
1596 dd if=$(call sysupname,$(1),$(2)) bs=$$$${factory_size} conv=sync; \
1598 ) > $(call factoryname,$(1),$(2)); \
1602 Image/Build/CameoAP81/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap81_mtdlayout))
1603 Image/Build/CameoAP81=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap81_mtdlayout),$(4),65536)
1604 Image/Build/CameoAP81/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap81_mtdlayout))
1606 Image/Build/CameoAP91/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap91_mtdlayout))
1607 Image/Build/CameoAP91=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap91_mtdlayout),$(4),65536)
1608 Image/Build/CameoAP91/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap91_mtdlayout))
1610 Image/Build/CameoAP99/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap99_mtdlayout))
1611 Image/Build/CameoAP99=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap99_mtdlayout),$(4),65536)
1612 Image/Build/CameoAP99/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap99_mtdlayout))
1614 Image/Build/CameoAP123_4M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap123_mtdlayout_4M))
1615 Image/Build/CameoAP123_4M=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_ap123_mtdlayout_4M),$(4),26)
1616 Image/Build/CameoAP123_4M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap123_mtdlayout_4M))
1618 Image/Build/CameoAP135/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1619 Image/Build/CameoAP135=$(call Image/Build/Cameo,$(1),$(2),$(3),$(4),$(5),26)
1620 Image/Build/CameoAP135/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1622 Image/Build/CameoDB120/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_db120_mtdlayout))
1623 Image/Build/CameoDB120=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_db120_mtdlayout),$(4),26)
1624 Image/Build/CameoDB120/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_db120_mtdlayout))
1626 Image/Build/CameoDB120_8M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_db120_mtdlayout_8M))
1627 Image/Build/CameoDB120_8M=$(call Image/Build/Cameo,$(1),$(2),$(3),$(cameo_db120_mtdlayout_8M),$(4),26)
1628 Image/Build/CameoDB120_8M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_db120_mtdlayout_8M))
1630 define Image/Build/CameoHornet
1631 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1632 $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
1633 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1635 [ -n "$$$$r" ] && dashr="-$$$$r" || dashr=; \
1636 [ -z "$$$$r" ] && r="DEF"; \
1637 mkcameofw -M HORNET -R "$$$$r" -S $(5) -V $(6) -c \
1638 -K $(8) -I $(fwsize) \
1639 -k "$(call sysupname,$(1),$(2))" \
1640 -o $(call imgname,$(1),$(2))-factory$$$$dashr.bin; \
1646 Image/Build/CameoAP121/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap121_mtdlayout))
1647 Image/Build/CameoAP121=$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo_ap121_mtdlayout),$(4),$(5),$(6),0xe0000)
1648 Image/Build/CameoAP121/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap121_mtdlayout))
1650 Image/Build/CameoAP121_8M/buildkernel=$(call MkuImageLzma,$(2),$(3) $(cameo_ap121_mtdlayout_8M))
1651 Image/Build/CameoAP121_8M=$(call Image/Build/CameoHornet,$(1),$(2),$(3),$(cameo_ap121_mtdlayout_8M),$(4),$(5),$(6),0x100000)
1652 Image/Build/CameoAP121_8M/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(cameo_ap121_mtdlayout_8M))
1654 define Image/Build/dLAN
1655 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1656 $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
1657 $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
1658 $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
1659 if [ -e "$(call factoryname,$(1),$(2))" ]; then \
1660 dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
1661 of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
1662 dd if=$(KDIR)/root.$(1) \
1663 of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
1667 Image/Build/dLANLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1668 Image/Build/dLANLzma=$(call Image/Build/dLAN,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
1669 Image/Build/dLANLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1671 define Image/Build/Ath
1672 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1673 $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
1674 $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
1675 $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
1676 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1677 dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
1678 of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
1679 dd if=$(KDIR)/root.$(1) \
1680 of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
1684 Image/Build/AthGzip/buildkernel=$(call MkuImageGzip,$(2),$(3) $(4))
1685 Image/Build/AthGzip=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
1686 Image/Build/AthGzip/initramfs=$(call MkuImageGzip/initramfs,$(2),$(3) $(4))
1688 Image/Build/AthLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1689 Image/Build/AthLzma=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
1690 Image/Build/AthLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1693 Image/Build/Belkin/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1694 Image/Build/Belkin/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1696 define Image/Build/Belkin
1697 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1698 $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
1699 $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
1700 $(call Sysupgrade/RKuImage,$(1),$(2),$(kernsize),$(rootsize))
1701 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1702 edimax_fw_header -m $(5) -v "OpenWrt$(REVISION)" \
1704 -i $(KDIR_TMP)/vmlinux-$(2).uImage \
1705 -o $(KDIR_TMP)/$(2)-uImage; \
1706 edimax_fw_header -m $(5) -v "OpenWrt$(REVISION)" \
1708 -i $(KDIR)/root.$(1) \
1709 -o $(KDIR_TMP)/$(2)-rootfs; \
1711 dd if=$(KDIR_TMP)/$(2)-rootfs; \
1712 dd if=$(KDIR_TMP)/$(2)-uImage; \
1713 ) > "$(call factoryname,$(1),$(2))"; \
1717 define Image/Build/EnGenius
1718 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
1719 $(eval rootsize=$(call mtdpartsize,rootfs,$(4)))
1720 $(eval kernsize=$(call mtdpartsize,kernel,$(4)))
1721 $(call Sysupgrade/$(5),$(1),$(2),$(if $(6),$(6),$(kernsize)),$(if $(rootsize),$(rootsize),$(fwsize)))
1722 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1723 dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
1724 of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync; \
1725 dd if=$(KDIR)/root.$(1) \
1726 of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync; \
1727 mksenaofw -e $(call sysupname,$(1),$(2)) \
1728 -o $(call imgname,$(1),$(2))-factory.dlf \
1729 -r 0x101 -p $(7) -t 2; \
1733 Image/Build/EnGenius/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1734 Image/Build/EnGenius/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1737 define MkuImageHiWiFi
1738 # Field ih_name needs to start with "tw150v1"
1739 mkimage -A mips -O linux -T kernel -a 0x80060000 -C $(1) $(2) \
1740 -e 0x80060000 -n 'tw150v1 MIPS OpenWrt Linux-$(LINUX_VERSION)' \
1744 define MkuImageLzmaHiWiFi
1745 $(call PatchKernelLzma,$(1),$(2),$(3),$(4))
1746 $(call MkuImageHiWiFi,lzma,$(5),$(KDIR_TMP)/vmlinux$(4)-$(1).bin.lzma,$(KDIR_TMP)/vmlinux$(4)-$(1).uImage)
1749 Image/Build/HiWiFi/buildkernel=$(call MkuImageLzmaHiWiFi,$(2),$(3) $(4))
1750 Image/Build/HiWiFi=$(call Image/Build/Ath,$(1),$(2),$(3),$(4),$(5),$(6),$(7))
1751 Image/Build/HiWiFi/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1753 Image/Build/PB4X/buildkernel=$(call PatchKernelLzma,$(2),$(3))
1755 define Image/Build/PB4X
1756 dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma \
1757 of=$(call imgname,kernel,$(2)).bin bs=64k conv=sync
1758 dd if=$(KDIR)/root.$(1) \
1759 of=$(call imgname,$(1),$(2)-rootfs).bin bs=128k conv=sync
1760 -sh $(TOPDIR)/scripts/combined-image.sh \
1761 "$(call imgname,kernel,$(2)).bin" \
1762 "$(call imgname,$(1),$(2)-rootfs).bin" \
1763 $(call sysupname,$(1),$(2))
1767 Image/Build/MyLoader/buildkernel=$(call PatchKernelLzma,$(2),$(3))
1768 Image/Build/MyLoader/initramfs=$(call PatchKernel/initramfs,$(2),$(3))
1770 define Image/Build/MyLoader
1771 $(eval fwsize=$(shell echo $$(($(4)-0x30000-4*64*1024))))
1772 $(eval fwimage=$(KDIR_TMP)/$(2)-$(5)-firmware.bin)
1773 $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).bin.lzma,65536,$(KDIR)/root.$(1),$(fwsize),$(fwimage))
1774 if [ -e "$(fwimage)" ]; then \
1775 $(STAGING_DIR_HOST)/bin/mkmylofw -B $(2) -s $(4) -v \
1776 -p0x00030000:0:al:0x80060000:firmware:$(fwimage) \
1777 $(call imgname,$(1),$(2))-$(5)-factory.img; \
1778 echo -n "" > $(KDIR_TMP)/empty.bin; \
1779 sh $(TOPDIR)/scripts/combined-image.sh \
1780 $(fwimage) $(KDIR_TMP)/empty.bin \
1781 $(call imgname,$(1),$(2))-$(5)-sysupgrade.bin; \
1785 Image/Build/Planex/initramfs=$(call MkuImageGzip/initramfs,$(2),$(3) $(planex_mtdlayout))
1786 Image/Build/Planex/loader=$(call Image/BuildLoaderAlone,$(1),gz,$(2) $(planex_mtdlayout),0x52000,0)
1788 define Image/Build/Planex/buildkernel
1789 [ -e "$(KDIR)/loader-$(2).gz" ]
1790 $(call MkuImageOKLI,$(2))
1792 dd if=$(KDIR)/loader-$(2).gz bs=8128 count=1 conv=sync; \
1793 dd if=$(KDIR_TMP)/vmlinux-$(2).okli; \
1794 ) > $(KDIR_TMP)/kernel-$(2).bin
1795 $(call MkuImage,gzip,,$(KDIR_TMP)/kernel-$(2).bin,$(KDIR_TMP)/vmlinux-$(2).uImage)
1798 define Image/Build/Planex
1799 $(eval fwsize=$(call mtdpartsize,firmware,$(planex_mtdlayout)))
1800 $(call Sysupgrade/KRuImage,$(1),$(2),0,$$$$(($(fwsize)-4*64*1024)),64)
1801 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1802 $(STAGING_DIR_HOST)/bin/mkplanexfw \
1805 -i $(call sysupname,$(1),$(2)) \
1806 -o $(call factoryname,$(1),$(2)); \
1811 Image/Build/ALFA/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1812 Image/Build/ALFA/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1814 define Image/Build/ALFA
1815 $(call Sysupgrade/RKuImage,$(1),$(2),$(5),$(6))
1816 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
1817 rm -rf $(KDIR)/$(1); \
1818 mkdir -p $(KDIR)/$(1); \
1820 cp $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR)/$(1)/$(7); \
1821 cp $(KDIR)/root.$(1) $(KDIR)/$(1)/$(8); \
1822 $(TAR) zcf $(call factoryname,$(1),$(2)) -C $(KDIR)/$(1) $(7) $(8); \
1824 echo WRM7222C | dd bs=32 count=1 conv=sync; \
1826 ) >> $(call factoryname,$(1),$(2)); \
1831 Image/Build/Seama/loader=$(call Image/BuildLoader,$(1),bin,$(2) $(3),0x80060000)
1833 define Image/Build/Seama
1834 [ -e "$(KDIR)/loader-$(2).bin" ]
1835 $(call CompressLzma,$(KDIR)/loader-$(2).bin,$(KDIR_TMP)/loader-$(2).bin.lzma)
1836 -rm -f $(KDIR_TMP)/image-$(2).tmp
1837 $(call CatFiles,$(KDIR_TMP)/loader-$(2).bin.lzma,$$$$(($(6) - 64)),$(KDIR)/root.$(1),$(7),$(KDIR_TMP)/image-$(2).tmp)
1838 [ -e "$(KDIR_TMP)/image-$(2).tmp" ] && { \
1839 head -c -4 "$(KDIR_TMP)/image-$(2).tmp" > "$(KDIR_TMP)/image-$(2).no-jffs2mark.tmp"; \
1840 $(STAGING_DIR_HOST)/bin/seama \
1841 -i $(KDIR_TMP)/image-$(2).no-jffs2mark.tmp \
1842 -m "dev=/dev/mtdblock/1" -m "type=firmware"; \
1843 $(STAGING_DIR_HOST)/bin/seama \
1844 -s $(call imgname,$(1),$(2))-factory.bin \
1845 -m "signature=$(5)" \
1846 -i $(KDIR_TMP)/image-$(2).no-jffs2mark.tmp.seama; \
1847 tail -c 4 "$(KDIR_TMP)/image-$(2).tmp" >> $(call imgname,$(1),$(2))-factory.bin; \
1849 cat $(KDIR_TMP)/loader-$(2).bin.lzma > $(KDIR_TMP)/image-$(2)-sysupgrade.tmp
1850 $(STAGING_DIR_HOST)/bin/seama \
1851 -i $(KDIR_TMP)/image-$(2)-sysupgrade.tmp \
1852 -m "dev=/dev/mtdblock/1" -m "type=firmware"
1853 $(call CatFiles,$(KDIR_TMP)/image-$(2)-sysupgrade.tmp.seama,$(6),$(KDIR)/root.$(1),$(7),$(call sysupname,$(1),$(2)))
1856 define Image/Build/Seama/initramfs
1857 $(call PatchKernelLzma,$(2),$(3) $(4),,-initramfs)
1858 $(STAGING_DIR_HOST)/bin/seama \
1859 -i $(KDIR_TMP)/vmlinux-initramfs-$(2).bin.lzma \
1860 -m "dev=/dev/mtdblock/1" -m "type=firmware"
1861 cat $(KDIR_TMP)/vmlinux-initramfs-$(2).bin.lzma.seama > $(call imgname,initramfs,$(2))-seama.bin
1864 Image/Build/Senao/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1865 Image/Build/Senao/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
1867 define Image/Build/Senao
1868 mkdir -p $(KDIR_TMP)/$(2)/
1869 touch $(KDIR_TMP)/$(2)/FWINFO-OpenWrt-$(REVISION)-$(2)
1870 -$(CP) ./$(2)/* $(KDIR_TMP)/$(2)/
1871 dd if=$(KDIR_TMP)/vmlinux-$(2).uImage \
1872 of=$(KDIR_TMP)/$(2)/openwrt-senao-$(2)-uImage-lzma.bin bs=64k conv=sync
1873 dd if=$(KDIR)/root.$(1) \
1874 of=$(KDIR_TMP)/$(2)/openwrt-senao-$(2)-root.$(1) bs=64k conv=sync
1876 cd $(KDIR_TMP)/$(2)/; \
1877 $(TAR) -cz -f $(call factoryname,$(1),$(2)) * \
1879 -rm -rf $(KDIR_TMP)/$(2)/
1880 -sh $(TOPDIR)/scripts/combined-image.sh \
1881 $(KDIR_TMP)/vmlinux-$(2).uImage \
1883 $(call sysupname,$(1),$(2))
1886 Image/Build/TPLINKOLD/loader=$(call Image/BuildLoaderAlone,$(1),gz,$(2),0x22000,0)
1888 define Image/Build/TPLINKOLD
1889 [ -e "$(KDIR)/loader-$(2).gz" ]
1890 $(call MkuImageOKLI,$(2))
1892 dd if=$(KDIR)/loader-$(2).gz bs=7680 count=1 conv=sync; \
1893 dd if=$(KDIR_TMP)/vmlinux-$(2).okli conv=sync; \
1894 ) > $(KDIR_TMP)/kernel-$(2).bin
1895 -$(STAGING_DIR_HOST)/bin/mktplinkfw \
1896 -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION)\
1898 -k $(KDIR_TMP)/kernel-$(2).bin \
1899 -r $(KDIR)/root.$(1) \
1900 -o $(call factoryname,$(1),$(2))
1901 -$(STAGING_DIR_HOST)/bin/mktplinkfw \
1902 -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s\
1904 -k $(KDIR_TMP)/kernel-$(2).bin \
1905 -r $(KDIR)/root.$(1) \
1906 -o $(call sysupname,$(1),$(2))
1909 define Image/Build/TPLINKOLD/initramfs
1910 $(call Image/BuildLoader,$(2),gz,$(3),0x80060000,-initramfs)
1911 -$(STAGING_DIR_HOST)/bin/mktplinkfw -c \
1912 -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s\
1913 -k $(KDIR)/loader-$(2)-initramfs.gz \
1914 -o $(call imgname,$(1),$(2))-initramfs-uImage.bin
1918 Image/Build/TPLINK/loader=$(call Image/BuildLoaderAlone,$(1),gz,$(2),0x22000,0)
1920 define Image/Build/TPLINK
1921 [ -e "$(KDIR)/loader-$(2).gz" ]
1922 $(call MkuImageOKLI,$(2))
1924 dd if=$(KDIR)/loader-$(2).gz bs=7680 count=1 conv=sync; \
1925 dd if=$(KDIR_TMP)/vmlinux-$(2).okli conv=sync; \
1926 ) > $(KDIR_TMP)/kernel-$(2).bin
1927 -$(STAGING_DIR_HOST)/bin/mktplinkfw \
1928 -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION)\
1930 -k $(KDIR_TMP)/kernel-$(2).bin \
1931 -r $(KDIR)/root.$(1) \
1932 -a $(call rootfs_align,$(1)) -j \
1933 -o $(call factoryname,$(1),$(2))
1934 -$(STAGING_DIR_HOST)/bin/mktplinkfw \
1935 -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s\
1937 -k $(KDIR_TMP)/kernel-$(2).bin \
1938 -r $(KDIR)/root.$(1) \
1939 -a $(call rootfs_align,$(1)) -j \
1940 -o $(call sysupname,$(1),$(2))
1943 define Image/Build/TPLINK/initramfs
1944 $(call Image/BuildLoader,$(2),gz,$(3),0x80060000,-initramfs)
1945 -$(STAGING_DIR_HOST)/bin/mktplinkfw -c \
1946 -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s\
1947 -k $(KDIR)/loader-$(2)-initramfs.gz \
1948 -o $(call imgname,$(1),$(2))-uImage.bin
1951 Image/Build/TPLINK-SAFELOADER/loader = $(call Image/BuildLoaderPatched,$(1),elf,$(2) $(3))
1953 define Image/Build/TPLINK-SAFELOADER
1954 [ -e "$(KDIR)/loader-$(2).elf" ]
1956 -$(STAGING_DIR_HOST)/bin/tplink-safeloader \
1958 -k $(KDIR)/loader-$(2).elf \
1959 -r $(KDIR)/root.$(1) \
1962 -o $(call factoryname,$(1),$(2))
1963 -$(STAGING_DIR_HOST)/bin/tplink-safeloader \
1965 -k $(KDIR)/loader-$(2).elf \
1966 -r $(KDIR)/root.$(1) \
1969 -o $(call sysupname,$(1),$(2))
1973 define Image/Build/CyberTAN
1974 echo -n '' > $(KDIR_TMP)/empty.bin
1975 $(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/image.tmp \
1976 -f $(KDIR_TMP)/vmlinux-$(2).uImage -F $(KDIR_TMP)/empty.bin \
1977 -x 32 -a 0x10000 -x -32 -f $(KDIR)/root.$(1)
1978 -$(STAGING_DIR_HOST)/bin/addpattern -B $(2) -v v$(5) \
1979 -i $(KDIR)/image.tmp \
1980 -o $(call sysupname,$(1),$(2))
1981 $(STAGING_DIR_HOST)/bin/trx -o $(KDIR)/image.tmp -f $(KDIR_TMP)/vmlinux-$(2).uImage \
1982 -x 32 -a 0x10000 -x -32 -f $(KDIR)/root.$(1)
1983 -$(STAGING_DIR_HOST)/bin/addpattern -B $(2) -v v$(5) -g \
1984 -i $(KDIR)/image.tmp \
1985 -o $(call factoryname,$(1),$(2))
1986 rm $(KDIR)/image.tmp
1989 Image/Build/CyberTANGZIP/loader=$(call Image/BuildLoader,$(1),gz,$(2),0x80060000)
1990 Image/Build/CyberTANGZIP/buildkernel=$(call MkuImage,gzip,,$(KDIR)/loader-$(2).gz,$(KDIR_TMP)/vmlinux-$(2).uImage)
1991 Image/Build/CyberTANGZIP=$(call Image/Build/CyberTAN,$(1),$(2),$(3),$(4),$(5))
1993 Image/Build/CyberTANLZMA/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
1994 Image/Build/CyberTANLZMA=$(call Image/Build/CyberTAN,$(1),$(2),$(3),$(4),$(5))
1997 Image/Build/Netgear/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
1999 define Image/Build/Netgear/buildkernel
2000 $(call MkuImageLzma,$(2),$(3) $(4),-d20,,-M $(5))
2001 -rm -rf $(KDIR_TMP)/$(2)
2002 mkdir -p $(KDIR_TMP)/$(2)/image
2003 cat $(KDIR_TMP)/vmlinux-$(2).uImage > $(KDIR_TMP)/$(2)/image/uImage
2004 $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
2005 $(KDIR_TMP)/$(2) $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp1 \
2006 -noappend -root-owned -be -b 65536
2008 cat $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp1; \
2009 dd if=/dev/zero bs=1k count=1 \
2010 ) > $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp2
2011 mkimage -A mips -O linux -T filesystem -C none -M $(5) \
2012 -a 0xbf070000 -e 0xbf070000 \
2013 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
2014 -d $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs.tmp2 \
2015 $(KDIR_TMP)/vmlinux-$(2).uImage.squashfs
2018 define Image/Build/Netgear
2019 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
2020 $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage.squashfs,0,$(KDIR)/root.$(1),$(fwsize),$(call sysupname,$(1),$(2)),64)
2021 if [ -e $(call sysupname,$(1),$(2)) ]; then \
2022 for r in $(7) ; do \
2023 [ -n "$$$$r" ] && dashr="-$$$$r" || dashr= ; \
2024 $(STAGING_DIR_HOST)/bin/mkdniimg \
2025 -B $(6) -v OpenWrt.$(REVISION) -r "$$$$r" $(8) \
2026 -i $(call sysupname,$(1),$(2)) \
2027 -o $(call imgname,$(1),$(2))-factory$$$$dashr.img; \
2033 Image/Build/NetgearLzma/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
2034 Image/Build/NetgearLzma/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4),-d20,,-M $(5))
2036 define Image/Build/NetgearLzma
2037 $(eval fwsize=$(call mtdpartsize,firmware,$(4)))
2038 $(call CatFiles,$(KDIR_TMP)/vmlinux-$(2).uImage,0,$(KDIR)/root.$(1),$(fwsize),$(call sysupname,$(1),$(2)),64)
2042 Image/Build/NetgearNAND/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4),,-M $(5))
2045 # $(2): Board name (small caps)
2046 # $(3): Kernel board specific cmdline
2047 # $(4): Kernel mtdparts definition
2048 # $(5): U-Boot magic
2049 define Image/Build/NetgearNAND/buildkernel
2050 $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
2051 $(call PatchKernelLzma,$(2),$(3) $(4),-d20)
2052 dd if=$(KDIR_TMP)/vmlinux-$(2).bin.lzma \
2053 of=$(KDIR_TMP)/vmlinux-$(2).bin.tmp \
2054 bs=$$$$(($(kernelsize)-131072-2*64-1)) \
2056 $(call MkuImage,lzma,-M $(5),$(KDIR_TMP)/vmlinux-$(2).bin.tmp,$(KDIR_TMP)/vmlinux-$(2).uImage)
2057 echo -ne '\xff' >> $(KDIR_TMP)/vmlinux-$(2).uImage
2058 # create a fake rootfs image
2059 dd if=/dev/zero of=$(KDIR_TMP)/fakeroot-$(2) bs=131072 count=1
2060 mkimage -A mips -O linux -T filesystem -C none \
2061 -a 0xbf070000 -e 0xbf070000 \
2062 -n 'MIPS OpenWrt fakeroot' \
2063 -d $(KDIR_TMP)/fakeroot-$(2) \
2065 $(KDIR_TMP)/fakeroot-$(2).uImage
2066 # append the fake rootfs image to the kernel, it will reside in the last
2067 # erase block of the kernel partition
2068 cat $(KDIR_TMP)/fakeroot-$(2).uImage >> $(KDIR_TMP)/vmlinux-$(2).uImage
2072 # $(1): rootfs image suffix
2073 # $(2): Board name (small caps)
2074 # $(3): Kernel board specific cmdline
2075 # $(4): Kernel mtdparts definition
2076 # $(5): U-Boot magic
2077 # $(6): Board name (upper caps)
2078 # $(7): firmware region code (not used yet)
2079 # $(8): DNI Hardware version
2080 # $(9): suffix of the configuration file for ubinize
2081 define Image/Build/NetgearNAND
2082 $(eval firmwaresize=$(call mtdpartsize,firmware,$(4)))
2083 $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
2084 $(eval imageraw=$(KDIR_TMP)/$(2)-raw.img)
2085 $(CP) $(KDIR)/root.squashfs-raw $(KDIR_TMP)/root.squashfs
2086 echo -ne '\xde\xad\xc0\xde' > $(KDIR_TMP)/jffs2.eof
2087 $(call ubinize,ubinize-$(9).ini,$(KDIR_TMP),$(KDIR_TMP)/$(2)-root.ubi,128KiB,2048,-E 5)
2089 dd if=$(KDIR_TMP)/vmlinux-$(2).uImage; \
2090 dd if=$(KDIR_TMP)/$(2)-root.ubi \
2092 $(STAGING_DIR_HOST)/bin/mkdniimg \
2093 -B $(6) -v OpenWrt.$(REVISION) -r "$$$$r" $(8) \
2095 -o $(call imgname,ubi,$(2))-factory.img
2097 $(call Image/Build/SysupgradeNAND,$(2),squashfs,$(KDIR_TMP)/vmlinux-$(2).uImage)
2101 ifdef CONFIG_PACKAGE_uboot-ar71xx-nbg460n_550n_550nh
2102 Image/Build/ZyXEL/buildkernel=$(call MkuImageLzma,$(2),$(3))
2104 define Image/Build/ZyXEL
2105 $(call Sysupgrade/KRuImage,$(1),$(2),917504,2752512)
2106 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
2107 if [ ! -f $(BIN_DIR)/$(IMG_PREFIX)-$(2)-u-boot.bin ]; then \
2108 echo "Warning: $(IMG_PREFIX)-$(2)-u-boot.bin not found" >&2; \
2110 $(STAGING_DIR_HOST)/bin/mkzynfw \
2112 -b $(BIN_DIR)/$(IMG_PREFIX)-$(2)-u-boot.bin \
2113 -r $(call sysupname,$(1),$(2)):0x10000 \
2114 -o $(call factoryname,$(1),$(2)); \
2120 define Image/Build/ZyXELNAND/buildkernel
2121 $(eval kernelsize=$(call mtdpartsize,kernel,$(5)))
2122 $(call MkuImageLzma,$(2),$(3) $(5) $(6))
2123 mkdir -p $(KDIR_TMP)/$(2)/image/boot
2124 cp $(KDIR_TMP)/vmlinux-$(2).uImage $(KDIR_TMP)/$(2)/image/boot/vmlinux.lzma.uImage
2125 $(STAGING_DIR_HOST)/bin/mkfs.jffs2 \
2126 --pad=$(kernelsize) --big-endian --squash-uids -v -e 128KiB \
2127 -o $(KDIR_TMP)/$(2)-kernel.jffs2 \
2128 -d $(KDIR_TMP)/$(2)/image \
2129 2>&1 1>/dev/null | awk '/^.+$$$$/'
2130 -rm -rf $(KDIR_TMP)/$(2)
2133 define Image/Build/ZyXELNAND
2134 if [ "$(1)" != "squashfs" ]; then \
2135 echo Only squashfs is supported; \
2138 $(eval firmwaresize=$(call mtdpartsize,firmware,$(4)))
2139 $(eval kernelsize=$(call mtdpartsize,kernel,$(4)))
2140 $(eval imageraw=$(KDIR_TMP)/$(2)-raw.img)
2141 $(CP) $(KDIR)/root.$(1) $(KDIR_TMP)/ubi_root.img
2142 $(call ubinize,ubinize-$(2).ini,$(KDIR_TMP),$(KDIR_TMP)/$(2)-root.ubi,128KiB,2048,-E 5)
2144 dd if=$(KDIR_TMP)/$(2)-kernel.jffs2; \
2145 dd if=$(KDIR_TMP)/$(2)-root.ubi \
2147 dd if=$(imageraw) of=$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)-factory.bin \
2149 $(call Image/Build/SysupgradeNAND,$(2),squashfs,$(KDIR_TMP)/$(2)-kernel.jffs2)
2153 Image/Build/OpenMesh/buildkernel=$(call MkuImageLzma,$(2))
2155 define Image/Build/OpenMesh
2156 -sh $(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \
2158 "$(BUILD_DIR)/fwupgrade.cfg-$(4)" \
2159 "$(KDIR_TMP)/vmlinux-$(2).uImage" \
2161 -sh $(TOPDIR)/scripts/combined-ext-image.sh \
2162 "$(4)" "$(call factoryname,$(1),$(2))" \
2163 "$(BUILD_DIR)/fwupgrade.cfg-$(4)" "fwupgrade.cfg" \
2164 "$(KDIR_TMP)/vmlinux-$(2).uImage" "kernel" \
2165 "$(KDIR)/root.$(1)" "rootfs"
2169 Image/Build/Zcomax/buildkernel=$(call MkuImageLzma,$(2),$(3) $(4))
2170 Image/Build/Zcomax/initramfs=$(call MkuImageLzma/initramfs,$(2),$(3) $(4))
2172 define Image/Build/Zcomax
2173 $(call Sysupgrade/RKuImage,$(1),$(2),1507328,6356992)
2174 if [ -e "$(call sysupname,$(1),$(2))" ]; then \
2175 $(STAGING_DIR_HOST)/bin/mkzcfw \
2177 -k $(KDIR_TMP)/vmlinux-$(2).uImage \
2178 -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
2179 -o $(call imgname,$(1),$(2))-factory.img; \
2184 # $(1): template name to be defined, etc. squashfs-only, 64k, 64kraw, etc.
2185 # $(2): jffs2 blocksize.
2186 define Jffs2Template
2187 define Image/Build/Template/$(1)/jffs2-$(2)
2188 $$(call Image/Build/$$(1),jffs2-$(2),$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
2192 # $(1): template name to be defined.
2193 # $(2): squashfs suffix to be used.
2194 # $(3): jffs2 suffix to be used.
2195 define BuildTemplate
2196 # $(1) : name of build method.
2197 # $(2) : board name.
2198 # $(3) : kernel command line.
2199 # $(4)~$(8): extra arguments.
2200 define Image/Build/Template/$(1)/initramfs
2201 $$(call Image/Build/$$(1)/initramfs,initramfs,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
2203 define Image/Build/Template/$(1)/loader
2204 $$(call Image/Build/$$(1)/loader,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
2206 define Image/Build/Template/$(1)/buildkernel
2207 $$(call Image/Build/$$(1)/buildkernel,,$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
2209 define Image/Build/Template/$(1)/squashfs
2210 $$(call Image/Build/$$(1),squashfs$(2),$$(2),$$(3),$$(4),$$(5),$$(6),$$(7),$$(8),$$(9),$$(10))
2212 $(if $(3),$(foreach bs,$(3),$(eval $(call Jffs2Template,$(1),$(bs)))))
2215 $(eval $(call BuildTemplate,squashfs-only))
2216 $(eval $(call BuildTemplate,64k,-64k,64k))
2217 $(eval $(call BuildTemplate,64kraw,-raw,64k))
2218 $(eval $(call BuildTemplate,64kraw-nojffs,-raw))
2219 $(eval $(call BuildTemplate,128k,,128k))
2220 $(eval $(call BuildTemplate,128kraw,-raw,128k))
2221 $(eval $(call BuildTemplate,256k,,256k))
2222 $(eval $(call BuildTemplate,all,,64k 128k 256k))
2224 ifeq ($(SUBTARGET),generic)
2225 $(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))
2226 $(eval $(call SingleProfile,ALFA,64k,HORNETUB,hornet-ub,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,kernel_image,rootfs_image))
2227 $(eval $(call SingleProfile,ALFA,64k,TUBE2H8M,tube2h-8M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_8M),1638400,6291456,kernel.image,rootfs.image))
2229 $(eval $(call SingleProfile,AthGzip,64k,AP81,ap81,AP81,ttyS0,115200,$$(ap81_mtdlayout),RKuImage))
2230 $(eval $(call SingleProfile,AthGzip,64k,AP83,ap83,AP83,ttyS0,115200,$$(ap83_mtdlayout),RKuImage))
2231 $(eval $(call SingleProfile,AthGzip,64k,AP96,ap96,AP96,ttyS0,115200,$$(ap96_mtdlayout),RKuImage))
2232 $(eval $(call SingleProfile,AthGzip,64k,WNDAP360,wndap360,WNDAP360,ttyS0,9600,$$(wndap360_mtdlayout),KRuImage))
2234 $(eval $(call SingleProfile,AthLzma,64k,ALFAAP96,alfa-ap96,ALFA-AP96,ttyS0,115200,$$(alfa_ap96_mtdlayout),RKuImage))
2235 $(eval $(call SingleProfile,AthLzma,64k,ALL0258N,all0258n,ALL0258N,ttyS0,115200,$$(all0258n_mtdlayout),KRuImage,65536))
2236 $(eval $(call SingleProfile,AthLzma,256k,ALL0315N,all0315n,ALL0315N,ttyS0,115200,$$(all0315n_mtdlayout),KRuImage,262144))
2237 $(eval $(call SingleProfile,AthLzma,64k,AP113,ap113,AP113,ttyS0,115200,$$(ap113_mtd_layout),RK))
2238 $(eval $(call SingleProfile,AthLzma,64k,AP121_2M,ap121-2M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_2M),RKuImage))
2239 $(eval $(call SingleProfile,AthLzma,64k,AP121_4M,ap121-4M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_4M),RKuImage))
2240 $(eval $(call SingleProfile,AthLzma,64k,AP121_8M,ap121-8M,AP121,ttyATH0,115200,$$(ap121_mtdlayout_8M),RKuImage))
2241 $(eval $(call SingleProfile,AthLzma,64k,AP121MINI,ap121-mini,AP121-MINI,ttyATH0,115200,$$(ap121_mtdlayout_4M),RKuImage))
2242 $(eval $(call SingleProfile,AthLzma,64k,AP132,ap132,AP132,ttyS0,115200,$$(ap132_mtdlayout),KRuImage))
2243 $(eval $(call SingleProfile,AthLzma,64k,AP135,ap135-020,AP135-020,ttyS0,115200,$$(ap135_mtdlayout),RKuImage))
2244 $(eval $(call SingleProfile,AthLzma,64k,AP136_010,ap136-010,AP136-010,ttyS0,115200,$$(ap136_mtdlayout),RKuImage))
2245 $(eval $(call SingleProfile,AthLzma,64k,AP136_020,ap136-020,AP136-020,ttyS0,115200,$$(ap136_mtdlayout),RKuImage))
2246 $(eval $(call SingleProfile,AthLzma,64k,AP143_8M,ap143-8M,AP143,ttyS0,115200,$$(ap143_mtdlayout_8M),RKuImage))
2247 $(eval $(call SingleProfile,AthLzma,64k,AP143_16M,ap143-16M,AP143,ttyS0,115200,$$(ap143_mtdlayout_16M),RKuImage))
2248 $(eval $(call SingleProfile,AthLzma,64k,AP147_010,ap147-010,AP147-010,ttyS0,115200,$$(ap147_mtdlayout),RKuImage))
2249 $(eval $(call SingleProfile,AthLzma,64k,AP152_16M,ap152-16M,AP152,ttyS0,115200,$$(ap152_mtdlayout_16M),RKuImage))
2250 $(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
2251 $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
2252 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
2253 $(eval $(call SingleProfile,AthLzma,64k,DRAGINO2,dragino2,DRAGINO2,ttyATH0,115200,$$(dragino2_mtdlayout),KRuImage,65536))
2254 $(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
2255 $(eval $(call SingleProfile,AthLzma,64k,EWDORINRT,ew-dorin-router,EW-DORIN-ROUTER,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
2256 $(eval $(call SingleProfile,AthLzma,64k,EWDORIN16M,ew-dorin-16M,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_16M),KRuImage,65536))
2257 $(eval $(call SingleProfile,AthLzma,64k,HORNETUBx2,hornet-ub-x2,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
2258 $(eval $(call SingleProfile,AthLzma,64k,MR12,mr12,MR12,ttyS0,115200,$$(mr12_mtdlayout),RKuImage))
2259 $(eval $(call SingleProfile,AthLzma,64k,MR16,mr16,MR16,ttyS0,115200,$$(mr16_mtdlayout),RKuImage))
2260 $(eval $(call SingleProfile,AthLzma,64k,PB92,pb92,PB92,ttyS0,115200,$$(pb92_mtdlayout),KRuImage))
2261 $(eval $(call SingleProfile,AthLzma,64k,TUBE2H16M,tube2h-16M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
2262 $(eval $(call SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$(wlr8100_mtdlayout),KRuImage))
2263 $(eval $(call SingleProfile,AthLzma,64k,WPJ344_16M,wpj344-16M,WPJ344,ttyS0,115200,$$(wpj344_mtdlayout_16M),KRuImage,65536))
2264 $(eval $(call SingleProfile,AthLzma,64k,WPJ531_16M,wpj531-16M,WPJ531,ttyS0,115200,$$(wpj531_mtdlayout_16M),KRuImage,65536))
2265 $(eval $(call SingleProfile,AthLzma,64k,WPJ558_16M,wpj558-16M,WPJ558,ttyS0,115200,$$(wpj558_mtdlayout_16M),KRuImage,65536))
2267 $(eval $(call SingleProfile,Belkin,64k,F9K1115V2,f9k1115v2,F9K1115V2,ttyS0,115200,$$(f9k1115v2_mtdlayout),BR-6679BAC))
2269 $(eval $(call SingleProfile,CameoAP91,64kraw,DIR600A1,dir-600-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-00"))
2270 $(eval $(call SingleProfile,CameoAP91,64kraw,DIR601A1,dir-601-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-02"))
2271 $(eval $(call SingleProfile,CameoAP91,64kraw,FR54RTR,fr-54rtr,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-01"))
2273 $(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E1,dir-615-e1,DIR-615-E1,ttyS0,115200,"AP93-AR7240-RT-081028-00"))
2274 $(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E4,dir-615-e4,DIR-615-E4,ttyS0,115200,"AP99-AR7240-RT-091105-05"))
2276 $(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I1,dir-615-i1,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-1012I1-00"))
2277 $(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I3,dir-615-i3,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-101214-00"))
2279 $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,A02RBW300N,a02-rb-w300n,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-03"))
2280 $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,DIR615C1,dir-615-c1,DIR-615-C1,ttyS0,115200,"AP81-AR9130-RT-070614-02"))
2281 $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW632BRP,tew-632brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-00"))
2282 $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_FW,tew-652brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-080609-05"))
2283 $(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_RECOVERY,tew-652brp-recovery,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-02"))
2285 $(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,TEW712BR,tew-712br,TEW-712BR,ttyATH0,115200,"HORNET-RT-TEW712BR-3",1.99,""))
2286 $(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,DIR601B1,dir-601-b1,TEW-712BR,ttyATH0,115200,"HORNET-RT-DIR601B1-3",2.99.99,"" "NA"))
2287 $(eval $(call SingleProfile,CameoAP121_8M,64kraw-nojffs,DIR505A1,dir-505-a1,DIR-505-A1,ttyATH0,115200,"HORNET-PACKET-DIR505A1-3",1.99.99,""))
2289 $(eval $(call SingleProfile,CameoAP135,64kraw,DGL5500A1,dgl-5500-a1,DGL-5500-A1,ttyS0,115200,$$(dgl_5500_mtdlayout),"00AP135AR9558-RT-130508-00"))
2291 $(eval $(call SingleProfile,CameoDB120,64kraw,DHP1565A1,dhp-1565-a1,DHP-1565-A1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
2292 $(eval $(call SingleProfile,CameoDB120,64kraw,DIR825C1,dir-825-c1,DIR-825-C1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
2293 $(eval $(call SingleProfile,CameoDB120,64kraw,DIR835A1,dir-835-a1,DIR-835-A1,ttyS0,115200,"00DB120AR9344-RT-101214-00"))
2295 $(eval $(call SingleProfile,CameoDB120_8M,64kraw,TEW732BR,tew-732br,TEW-732BR,ttyS0,115200,"00DB120AR9341-RT-120906-NA"))
2297 $(eval $(call SingleProfile,CyberTANGZIP,64k,WRT160NL,wrt160nl,WRT160NL,ttyS0,115200,,1.00.01))
2299 $(eval $(call SingleProfile,CyberTANLZMA,64k,MYNETREXT,mynet-rext,MYNET-REXT,ttyS0,115200,$$(mynet_rext_mtdlayout) root=31:2,1.00.01))
2301 $(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))
2302 $(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))
2303 $(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))
2305 $(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))
2306 $(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))
2308 $(eval $(call SingleProfile,EnGenius,64k,ESR900,esr900,ESR900,ttyS0,115200,$$(esr900_mtdlayout),KRuImage,,0x4e))
2309 $(eval $(call SingleProfile,EnGenius,64k,ESR1750,esr1750,ESR1750,ttyS0,115200,$$(esr1750_mtdlayout),KRuImage,,0x61))
2310 $(eval $(call SingleProfile,EnGenius,64k,EPG5000,epg5000,EPG5000,ttyS0,115200,$$(epg5000_mtdlayout),KRuImage,,0x71))
2312 $(eval $(call SingleProfile,HiWiFi,64k,HIWIFI_HC6361,hiwifi-hc6361,HiWiFi-HC6361,ttyATH0,115200,$$(hiwifi_hc6361_mtdlayout),KRuImage))
2314 $(eval $(call SingleProfile,MyLoader,64k,WP543_2M,wp543,,ttyS0,115200,0x200000,2M))
2315 $(eval $(call SingleProfile,MyLoader,64k,WP543_4M,wp543,,ttyS0,115200,0x400000,4M))
2316 $(eval $(call SingleProfile,MyLoader,64k,WP543_8M,wp543,,ttyS0,115200,0x800000,8M))
2317 $(eval $(call SingleProfile,MyLoader,64k,WP543_16M,wp543,,ttyS0,115200,0x1000000,16M))
2318 $(eval $(call SingleProfile,MyLoader,64k,WPE72_4M,wpe72,,ttyS0,115200,0x400000,4M))
2319 $(eval $(call SingleProfile,MyLoader,64k,WPE72_8M,wpe72,,ttyS0,115200,0x800000,8M))
2320 $(eval $(call SingleProfile,MyLoader,64k,WPE72_16M,wpe72,,ttyS0,115200,0x1000000,16M))
2322 $(eval $(call SingleProfile,Netgear,64kraw,WNR2000V3,wnr2000v3,WNR2000V3,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303033,WNR2000V3,"" NA,-H 29763551+04+32))
2323 $(eval $(call SingleProfile,NetgearLzma,64kraw,WNR2000V4,wnr2000v4,WNR2000V4,ttyS0,115200,$$(wnr2000v4_mtdlayout),0x32303034,WNR2000V4,"" NA,))
2324 $(eval $(call SingleProfile,Netgear,64kraw,WNR2200,wnr2200,WNR2200,ttyS0,115200,$$(wnr2200_mtdlayout),0x32323030,WNR2200,"" NA,))
2325 $(eval $(call SingleProfile,Netgear,64kraw,REALWNR612V2,wnr612v2,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,WNR612V2,"",))
2326 $(eval $(call SingleProfile,Netgear,64kraw,N150R,n150r,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,N150R,"",))
2327 $(eval $(call SingleProfile,Netgear,64kraw,REALWNR1000V2,wnr1000v2,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303031,WNR1000V2,"",))
2328 $(eval $(call SingleProfile,Netgear,64kraw,WNR1000V2_VC,wnr1000v2-vc,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303030,WNR1000V2-VC,"",))
2330 $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2p,,,,OM2P))
2331 $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5P,om5p,,,,OM5P))
2332 $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR600,mr600,,,,MR600))
2333 $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR900,mr900,,,,MR900))
2334 $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR1750,mr1750,,,,MR1750))
2336 $(eval $(call SingleProfile,PB4X,128k,ALL0305,all0305,ALL0305,ttyS0,115200))
2337 $(eval $(call SingleProfile,PB4X,128k,EAP7660D,eap7660d,EAP7660D,ttyS0,115200))
2338 $(eval $(call SingleProfile,PB4X,64k,JA76PF,ja76pf,JA76PF,ttyS0,115200))
2339 $(eval $(call SingleProfile,PB4X,64k,JA76PF2,ja76pf2,JA76PF2,ttyS0,115200))
2340 $(eval $(call SingleProfile,PB4X,64k,JWAP003,jwap003,JWAP003,ttyS0,115200))
2341 $(eval $(call SingleProfile,PB4X,64k,PB42,pb42,PB42,ttyS0,115200))
2342 $(eval $(call SingleProfile,PB4X,64k,PB44,pb44,PB44,ttyS0,115200))
2344 $(eval $(call SingleProfile,Planex,64kraw,MZKW04NU,mzk-w04nu,MZK-W04NU,ttyS0,115200))
2345 $(eval $(call SingleProfile,Planex,64kraw,MZKW300NH,mzk-w300nh,MZK-W300NH,ttyS0,115200))
2347 $(eval $(call SingleProfile,Seama,64k,MYNETN600,mynet-n600,MYNET-N600,ttyS0,115200,$$(mynet_n600_mtdlayout),wrgnd16_wd_db600,65536,16187392))
2348 $(eval $(call SingleProfile,Seama,64k,MYNETN750,mynet-n750,MYNET-N750,ttyS0,115200,$$(mynet_n600_mtdlayout),wrgnd13_wd_av,65536,16187392))
2350 $(eval $(call SingleProfile,Seama,64k,QIHOO360,qihoo-c301,QIHOO-C301,ttyS0,115200,$$(qihoo_c301_mtdlayout),wrgac26_qihoo360_360rg,65536,16121856))
2352 $(eval $(call SingleProfile,Senao,squashfs-only,EAP300V2,eap300v2,EAP300V2,ttyS0,115200,$$(eap300v2_mtdlayout)))
2354 $(eval $(call SingleProfile,TPLINKOLD,squashfs-only,TLWR841NV15,tl-wr841nd-v1.5,TL-WR841N-v1.5,ttyS0,115200,0x08410002,2,4M))
2356 $(eval $(call SingleProfile,TPLINK-SAFELOADER,64kraw,CPE510,cpe210-220-510-520,CPE510,ttyS0,115200,$$(cpe510_mtdlayout),CPE510))
2358 $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N))
2359 $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPG300N,whr-hp-g300n,WHR-HP-G300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-G300N))
2360 $(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPGN,whr-hp-gn,WHR-HP-GN,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-GN))
2361 $(eval $(call SingleProfile,WHRHPG300N,64kraw,WLAEAG300N,wlae-ag300n,WLAE-AG300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WLAE-AG300N))
2363 $(eval $(call SingleProfile,WRT400N,64k,WRT400N,wrt400n,WRT400N,ttyS0,115200))
2365 $(eval $(call SingleProfile,WZRHP128K,128kraw,WZRHPG300NH,wzr-hp-g300nh,WZR-HP-G300NH,ttyS0,115200,WZR-HP-G300NH))
2366 $(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPG300NH2,wzr-hp-g300nh2,WZR-HP-G300NH2,ttyS0,115200,WZR-HP-G300NH2))
2367 $(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPAG300H,wzr-hp-ag300h,WZR-HP-AG300H,ttyS0,115200,WZR-HP-AG300H))
2368 $(eval $(call SingleProfile,WZRHP64K,64kraw,WZRHPG450H,wzr-hp-g450h,WZR-HP-G450H,ttyS0,115200,WZR-HP-AG450H))
2369 $(eval $(call SingleProfile,WZRHP64K,64kraw,WZR600DHP,wzr-600dhp,WZR-HP-AG300H,ttyS0,115200,WZR-600DHP))
2370 $(eval $(call SingleProfile,WZRHP64K,64kraw,WZR450HP2,wzr-450hp2,WZR-450HP2,ttyS0,115200,WZR-450HP2))
2372 $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H28,zcn-1523h-2-8,ZCN-1523H-2,ttyS0,115200,$$(zcn1523h_mtdlayout)))
2373 $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H516,zcn-1523h-5-16,ZCN-1523H-5,ttyS0,115200,$$(zcn1523h_mtdlayout)))
2375 $(eval $(call SingleProfile,ZyXEL,64k,NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG460N,ttyS0,115200,NBG-460N))
2377 $(eval $(call MultiProfile,AP121,AP121_2M AP121_4M AP121_8M))
2378 $(eval $(call MultiProfile,AP136,AP136_010 AP136_020))
2379 $(eval $(call MultiProfile,AP143,AP143_8M AP143_16M))
2380 $(eval $(call MultiProfile,AP147,AP147_010))
2381 $(eval $(call MultiProfile,AP152,AP152_16M))
2382 $(eval $(call MultiProfile,DIR615IX,DIR615I1 DIR615I3))
2383 $(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT EWDORIN16M))
2384 $(eval $(call MultiProfile,OPENMESH,OM2P OM5P MR600 MR900 MR1750))
2385 $(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY))
2386 $(eval $(call MultiProfile,TLWR841,TLWR841NV15))
2387 $(eval $(call MultiProfile,TUBE2H,TUBE2H8M TUBE2H16M))
2388 $(eval $(call MultiProfile,WNR612V2,REALWNR612V2 N150R))
2389 $(eval $(call MultiProfile,WNR1000V2,REALWNR1000V2 WNR1000V2_VC))
2390 $(eval $(call MultiProfile,WP543,WP543_2M WP543_4M WP543_8M WP543_16M))
2391 $(eval $(call MultiProfile,WPE72,WPE72_4M WPE72_8M WPE72_16M))
2392 $(eval $(call MultiProfile,WPJ344,WPJ344_16M))
2393 $(eval $(call MultiProfile,WPJ531,WPJ531_16M))
2394 $(eval $(call MultiProfile,WPJ558,WPJ558_16M))
2396 $(eval $(call MultiProfile,Minimal,$(SINGLE_PROFILES)))
2397 $(eval $(call MultiProfile,Madwifi,EAP7660D WP543))
2398 endif # ifeq ($(SUBTARGET),generic)
2400 ifeq ($(SUBTARGET),nand)
2401 $(eval $(call SingleProfile,NetgearNAND,64k,WNDR3700V4,wndr3700v4,WNDR3700_V4,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR3700v4,"",-H 29763948+128+128,wndr4300))
2402 $(eval $(call SingleProfile,NetgearNAND,64k,WNDR4300V1,wndr4300,WNDR4300,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR4300,"",-H 29763948+0+128+128+2x2+3x3,wndr4300))
2403 $(eval $(call SingleProfile,NetgearNAND,64k,R6100,r6100,R6100,ttyS0,115200,$$(r6100_mtdlayout),0x36303030,R6100,"",-H 29764434+0+128+128+2x2+2x2,wndr4300))
2405 $(eval $(call SingleProfile,ZyXELNAND,128k,NBG6716,nbg6716,NBG6716,ttyS0,115200,NBG6716,$$(zyx_nbg6716_mtdlayout),mem=256M))
2407 $(eval $(call MultiProfile,WNDR4300,WNDR3700V4 WNDR4300V1))
2408 endif # ifeq ($(SUBTARGET),nand)
2411 $(eval $(call MultiProfile,Default,$(SINGLE_PROFILES)))
2413 define Image/Build/squashfs
2414 cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-raw
2415 cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-64k
2416 $(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR)/root.squashfs-64k 64
2417 cp $(KDIR)/root.squashfs-64k $(BIN_DIR)/$(IMG_PREFIX)-root.squashfs-64k
2418 $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
2419 dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
2422 define Image/Build/jffs2
2423 dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
2426 define Image/Build/Initramfs
2427 $(call Image/Build/Profile/$(IMAGE_PROFILE),initramfs)
2430 define Image/Prepare
2431 gzip -9n -c $(KDIR)/vmlinux > $(KDIR)/vmlinux.bin.gz
2432 $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
2433 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
2434 gzip -9n -c $(KDIR)/vmlinux-initramfs > $(KDIR)/vmlinux-initramfs.bin.gz
2435 $(call CompressLzma,$(KDIR)/vmlinux-initramfs,$(KDIR)/vmlinux-initramfs.bin.lzma)
2436 $(call Image/BuildLoader,generic,elf,,,-initramfs)
2438 $(call Image/BuildLoader,generic,elf)
2439 $(call Image/Build/Profile/$(if $(CONFIG_IB),Default,$(IMAGE_PROFILE)),loader)
2442 # $(1): filesystem type.
2444 $(call Image/Build/$(call rootfs_type,$(1)),$(1))
2445 $(call Image/Build/Profile/$(IMAGE_PROFILE),$(1))
2448 $(eval $(call BuildImage))