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