2 # Copyright (C) 2008-2011 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 JFFS2_BLOCKSIZE
= 64k
128k
256k
10 include $(TOPDIR
)/rules.mk
11 include $(INCLUDE_DIR
)/image.mk
13 IMAGE_PROFILE
:=$(if
$(PROFILE
),$(PROFILE
),Default
)
15 KERNEL_LOADADDR
= 0x80060000
17 DEVICE_VARS
+= NETGEAR_KERNEL_MAGIC NETGEAR_BOARD_ID NETGEAR_HW_ID CMDLINE CONSOLE IMAGE_SIZE BOARDNAME LOADER_FLASH_OFFS LOADER_TYPE
22 define Build
/netgear-squashfs
23 rm -rf
$@.fs
$@.squashfs
25 cp
$@
$@.fs
/image
/uImage
26 $(STAGING_DIR_HOST
)/bin
/mksquashfs-lzma \
28 -noappend
-root-owned
-be
-b
65536 \
29 $(if
$(SOURCE_DATE_EPOCH
),-fixed-time
$(SOURCE_DATE_EPOCH
))
31 dd if
=/dev
/zero bs
=1k count
=1 >> $@.squashfs
33 -A mips
-O linux
-T filesystem
-C none \
34 -M
$(NETGEAR_KERNEL_MAGIC
) \
35 -a
0xbf070000 -e
0xbf070000 \
36 -n
'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
38 rm -rf
$@.squashfs
$@.fs
41 define Build
/netgear-uImage
42 $(call Build
/uImage
,$(1) -M
$(NETGEAR_KERNEL_MAGIC
))
45 define Build
/loader-common
47 $(MAKE
) -C lzma-loader \
48 PKG_BUILD_DIR
="$@.src" \
49 TARGET_DIR
="$(dir $@)" LOADER_NAME
="$(notdir $@)" \
50 BOARD
="$(BOARDNAME)" \
51 LZMA_TEXT_START
=0x80a00000 LOADADDR
=0x80060000 \
52 $(1) compile loader.
$(LOADER_TYPE
)
53 mv
"$@.$(LOADER_TYPE)" "$@"
57 define Build
/loader-okli-compile
58 $(call Build
/loader-common
,FLASH_OFFS
=$(LOADER_FLASH_OFFS
) FLASH_MAX
=0 KERNEL_CMDLINE
="$(CMDLINE)")
61 define Build
/loader-kernel
62 $(call Build
/loader-common
,LOADER_DATA
="$@")
65 define Build
/loader-kernel-cmdline
66 $(call Build
/loader-common
,LOADER_DATA
="$@" KERNEL_CMDLINE
="$(CMDLINE)")
69 define Build
/loader-okli
70 dd if
=$(KDIR
)/loader-
$(1).gz bs
=7680 conv
=sync of
="$@.new"
75 define Build
/copy-file
79 # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
80 # UBNT_TYPE e.g. one of (BZ, XM, XW)
81 # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
83 # mkubntimage is using the kernel image direct
84 # routerboard creates partitions out of the ubnt header
85 define Build
/mkubntimage
86 $(STAGING_DIR_HOST
)/bin
/mkfwimage \
87 -B
$(UBNT_BOARD
) -v
$(UBNT_TYPE
).
$(UBNT_CHIP
).v6.0
.0-OpenWrt-
$(REVISION
) \
93 # all UBNT XM device expect the kernel image to have 1024k while flash, when
94 # booting the image, the size doesn't matter.
95 define Build
/mkubntimage-split
96 dd if
=$@ of
=$@.old1 bs
=1024k count
=1
97 dd if
=$@ of
=$@.old2 bs
=1024k skip
=1
98 $(STAGING_DIR_HOST
)/bin
/mkfwimage \
99 -B
$(UBNT_BOARD
) -v
$(UBNT_TYPE
).
$(UBNT_CHIP
).v6.0
.0-OpenWrt-
$(REVISION
) \
106 define Build
/mkubntimage2
107 $(STAGING_DIR_HOST
)/bin
/mkfwimage2
-f
0x9f000000 \
108 -v
$(UBNT_TYPE
).
$(UBNT_CHIP
).v6.0
.0-OpenWrt-
$(REVISION
) \
109 -p jffs2
:0x50000:0xf60000:0:0:$@ \
114 DEVICE_VARS
+= UBNT_BOARD UBNT_CHIP UBNT_TYPE
116 define Device
/Default
118 DEVICE_PROFILE
= $$(BOARDNAME
)
119 PROFILES
= Default Minimal
$$(DEVICE_PROFILE
)
121 IMAGES
:= sysupgrade.bin
123 FILESYSTEMS
= $(filter-out jffs2-
%,$(TARGET_FILESYSTEMS
)) jffs2-
$$(BLOCKSIZE
)
124 CONSOLE
= ttyS0
,115200
125 CMDLINE
= $$(if
$$(BOARDNAME
),board
=$$(BOARDNAME
)) $$(if
$$(MTDPARTS
),mtdparts
=$$(MTDPARTS
)) $$(if
$$(CONSOLE
),console
=$$(CONSOLE
))
126 KERNEL
:= kernel-bin | patch-cmdline | lzma | uImage lzma
128 IMAGES
:= sysupgrade.bin
129 IMAGE
/sysupgrade.bin
= append-kernel
$$$$(BLOCKSIZE
) | append-rootfs | pad-rootfs | check-size
$$$$(IMAGE_SIZE
)
135 CONSOLE
= ttyATH0
,115200
136 MTDPARTS
= spi0.0
:128k
(u-boot
)ro
,64k
(u-boot-env
)ro
,16128k
(firmware
),64k
(art
)ro
138 TARGET_DEVICES
+= bsb
140 define Device
/carambola2
141 BOARDNAME
= CARAMBOLA2
143 CONSOLE
= ttyATH0
,115200
144 MTDPARTS
= spi0.0
:256k
(u-boot
)ro
,64k
(u-boot-env
)ro
,16000k
(firmware
),64k
(art
)ro
146 TARGET_DEVICES
+= carambola2
148 define Device
/cf-e316n-v2
149 BOARDNAME
= CF-E316N-V2
151 CONSOLE
= ttyS0
,115200
152 MTDPARTS
= spi0.0
:64k
(u-boot
)ro
,64k
(art
)ro
,16192k
(firmware
),64k
(nvram
)ro
154 TARGET_DEVICES
+= cf-e316n-v2
159 CONSOLE
= ttyATH0
,115200
160 MTDPARTS
= spi0.0
:256k
(u-boot
)ro
,64k
(u-boot-env
)ro
,16000k
(firmware
),64k
(art
)ro
162 TARGET_DEVICES
+= weio
164 define Device
/gl-ar150
167 CONSOLE
= ttyATH0
,115200
168 MTDPARTS
= spi0.0
:256k
(u-boot
)ro
,64k
(u-boot-env
)ro
,16000k
(firmware
),64k
(art
)ro
170 TARGET_DEVICES
+= gl-ar150
172 define Device
/gl-ar300
175 CONSOLE
= ttyS0
,115200
176 MTDPARTS
= spi0.0
:256k
(u-boot
)ro
,64k
(u-boot-env
)ro
,16000k
(firmware
),64k
(art
)ro
178 TARGET_DEVICES
+= gl-ar300
180 define Device
/gl-domino
183 CONSOLE
= ttyATH0
,115200
184 MTDPARTS
= spi0.0
:256k
(u-boot
)ro
,64k
(u-boot-env
)ro
,16000k
(firmware
),64k
(art
)ro
186 TARGET_DEVICES
+= gl-domino
188 define Device
/wndr3700
190 NETGEAR_KERNEL_MAGIC
= 0x33373030
191 NETGEAR_BOARD_ID
= WNDR3700
193 MTDPARTS
= spi0.0
:320k
(u-boot
)ro
,128k
(u-boot-env
)ro
,7680k
(firmware
),64k
(art
)ro
194 IMAGES
:= sysupgrade.bin factory.img factory-NA.img
195 KERNEL
:= kernel-bin | patch-cmdline | lzma
-d20 | netgear-uImage lzma
196 IMAGE
/default
= append-kernel
$$$$(BLOCKSIZE
) | netgear-squashfs | append-rootfs | pad-rootfs
197 IMAGE
/sysupgrade.bin
= $$(IMAGE
/default
) | check-size
$$$$(IMAGE_SIZE
)
198 IMAGE
/factory.img
= $$(IMAGE
/default
) | netgear-dni | check-size
$$$$(IMAGE_SIZE
)
199 IMAGE
/factory-NA.img
= $$(IMAGE
/default
) | netgear-dni NA | check-size
$$$$(IMAGE_SIZE
)
202 define Device
/wndr3700v2
204 NETGEAR_BOARD_ID
= WNDR3700v2
205 NETGEAR_KERNEL_MAGIC
= 0x33373031
206 NETGEAR_HW_ID
= 29763654+16+64
208 MTDPARTS
= spi0.0
:320k
(u-boot
)ro
,128k
(u-boot-env
)ro
,15872k
(firmware
),64k
(art
)ro
209 IMAGES
:= sysupgrade.bin factory.img
212 define Device
/wndr3800
214 NETGEAR_BOARD_ID
= WNDR3800
215 NETGEAR_HW_ID
= 29763654+16+128
218 define Device
/wndr3800ch
220 NETGEAR_BOARD_ID
= WNDR3800CH
223 define Device
/wndrmac
225 NETGEAR_BOARD_ID
= WNDRMAC
228 define Device
/wndrmacv2
230 NETGEAR_BOARD_ID
= WNDRMACv2
233 TARGET_DEVICES
+= wndr3700 wndr3700v2 wndr3800 wndr3800ch wndrmac wndrmacv2
237 DEVICE_PROFILE
:= CAP324
239 MTDPARTS
= spi0.0
:256k
(u-boot
),64k
(u-boot-env
)ro
,15296k
(firmware
),640k
(certs
),64k
(nvram
),64k
(art
)
242 TARGET_DEVICES
+= cap324
244 define Device
/cap324-nocloud
246 DEVICE_PROFILE
:= CAP324
248 MTDPARTS
= spi0.0
:256k
(u-boot
),64k
(u-boot-env
)ro
,16000k
(firmware
),64k
(art
)
251 TARGET_DEVICES
+= cap324-nocloud
255 DEVICE_PROFILE
:= CR3000
257 MTDPARTS
= spi0.0
:256k
(u-boot
),64k
(u-boot-env
)ro
,7104k
(firmware
),640k
(certs
),64k
(nvram
),64k
(art
)
260 TARGET_DEVICES
+= cr3000
262 define Device
/cr3000-nocloud
264 DEVICE_PROFILE
:= CR3000
266 MTDPARTS
= spi0.0
:256k
(u-boot
),64k
(u-boot-env
)ro
,7808k
(firmware
),64k
(art
)
269 TARGET_DEVICES
+= cr3000-nocloud
273 DEVICE_PROFILE
:= CR5000
275 MTDPARTS
= spi0.0
:256k
(u-boot
),64k
(u-boot-env
)ro
,7104k
(firmware
),640k
(certs
),64k
(nvram
),64k
(art
)
278 TARGET_DEVICES
+= cr5000
280 define Device
/cr5000-nocloud
282 DEVICE_PROFILE
:= CR5000
284 MTDPARTS
= spi0.0
:256k
(u-boot
),64k
(u-boot-env
)ro
,7808k
(firmware
),64k
(art
)
287 TARGET_DEVICES
+= cr5000-nocloud
289 define Device
/antminer-s1
290 $(Device
/tplink-8mlzma
)
291 BOARDNAME
:= ANTMINER-S1
292 DEVICE_PROFILE
:= ANTMINERS1
293 TPLINK_HWID
:= 0x04440101
294 CONSOLE
:= ttyATH0
,115200
297 define Device
/antminer-s3
298 $(Device
/tplink-8mlzma
)
299 BOARDNAME
:= ANTMINER-S3
300 DEVICE_PROFILE
:= ANTMINERS3
301 TPLINK_HWID
:= 0x04440301
302 CONSOLE
:= ttyATH0
,115200
305 define Device
/antrouter-r1
306 $(Device
/tplink-8mlzma
)
307 BOARDNAME
:= ANTROUTER-R1
308 DEVICE_PROFILE
:= ANTROUTERR1
309 TPLINK_HWID
:= 0x44440101
310 CONSOLE
:= ttyATH0
,115200
313 define Device
/el-m150
314 $(Device
/tplink-8mlzma
)
316 DEVICE_PROFILE
:= ELM150
317 TPLINK_HWID
:= 0x01500101
318 CONSOLE
:= ttyATH0
,115200
321 define Device
/el-mini
322 $(Device
/tplink-8mlzma
)
324 DEVICE_PROFILE
:= ELMINI
325 TPLINK_HWID
:= 0x01530001
326 CONSOLE
:= ttyATH0
,115200
328 TARGET_DEVICES
+= antminer-s1 antminer-s3 antrouter-r1 el-m150 el-mini
330 define Device
/gl-inet-6408A-v1
331 $(Device
/tplink-8mlzma
)
333 DEVICE_PROFILE
:= GLINET
334 TPLINK_HWID
:= 0x08000001
335 CONSOLE
:= ttyATH0
,115200
338 define Device
/gl-inet-6416A-v1
339 $(Device
/tplink-16mlzma
)
341 DEVICE_PROFILE
:= GLINET
342 TPLINK_HWID
:= 0x08000001
343 CONSOLE
:= ttyATH0
,115200
345 TARGET_DEVICES
+= gl-inet-6408A-v1 gl-inet-6416A-v1
347 define Device
/rnx-n360rt
349 BOARDNAME
:= TL-WR941ND
350 DEVICE_PROFILE
:= RNXN360RT
351 TPLINK_HWID
:= 0x09410002
352 TPLINK_HWREV
:= 0x00420001
354 TARGET_DEVICES
+= rnx-n360rt
356 define Device
/mc-mac1200r
357 $(Device
/tplink-8mlzma
)
358 BOARDNAME
:= MC-MAC1200R
359 DEVICE_PROFILE
:= MAC1200R
360 TPLINK_HWID
:= 0x12000001
362 TARGET_DEVICES
+= mc-mac1200r
364 define Device
/minibox-v1
365 $(Device
/tplink-16mlzma
)
366 BOARDNAME
:= MINIBOX-V1
367 DEVICE_PROFILE
:= MINIBOXV1
368 TPLINK_HWID
:= 0x3C000201
369 CONSOLE
:= ttyATH0
,115200
371 TARGET_DEVICES
+= minibox-v1
374 $(Device
/tplink-16mlzma
)
376 DEVICE_PROFILE
:= OMYG1
377 TPLINK_HWID
:= 0x06660101
381 $(Device
/tplink-8mlzma
)
383 DEVICE_PROFILE
:= OMYX1
384 TPLINK_HWID
:= 0x06660201
386 TARGET_DEVICES
+= omy-g1 omy-x1
388 define Device
/onion-omega
389 $(Device
/tplink-16mlzma
)
390 BOARDNAME
:= ONION-OMEGA
391 DEVICE_PROFILE
:= OMEGA
392 TPLINK_HWID
:= 0x04700001
393 CONSOLE
:= ttyATH0
,115200
395 TARGET_DEVICES
+= onion-omega
397 define Device
/smart-300
398 $(Device
/tplink-8mlzma
)
399 BOARDNAME
:= SMART-300
400 DEVICE_PROFILE
:= SMART-300
401 TPLINK_HWID
:= 0x93410001
403 TARGET_DEVICES
+= smart-300
405 define Device
/tellstick-znet-lite
406 $(Device
/tplink-16mlzma
)
407 BOARDNAME
:= TELLSTICK-ZNET-LITE
408 DEVICE_PROFILE
:= TELLSTICKZNETLITE
409 TPLINK_HWID
:= 0x00726001
410 CONSOLE
:= ttyATH0
,115200
412 TARGET_DEVICES
+= tellstick-znet-lite
415 $(Device
/tplink-16mlzma
)
416 BOARDNAME
:= GS-OOLITE
417 DEVICE_PROFILE
:= OOLITE
418 TPLINK_HWID
:= 0x3C000101
419 CONSOLE
:= ttyATH0
,115200
421 TARGET_DEVICES
+= oolite
423 # UBNT_BOARD e.g. one of (XS2, XS5, RS, XM)
424 # UBNT_TYPE e.g. one of (BZ, XM, XW)
425 # UBNT_CHIP e.g. one of (ar7240, ar933x, ar934x)
426 define Device
/ubnt-xm
427 DEVICE_PROFILE
:= UBNT
429 MTDPARTS
= spi0.0
:256k
(u-boot
)ro
,64k
(u-boot-env
)ro
,7552k
(firmware
),256k
(cfg
)ro
,64k
(EEPROM
)ro
433 IMAGES
:= sysupgrade.bin factory.bin
434 IMAGE
/factory.bin
= $$(IMAGE
/sysupgrade.bin
) | mkubntimage-split
435 IMAGE
/sysupgrade.bin
= append-kernel
$$$$(BLOCKSIZE
) | append-rootfs | pad-rootfs | check-size
$$$$(IMAGE_SIZE
)
438 define Device
/ubnt-xw
439 DEVICE_PROFILE
:= UBNT
441 MTDPARTS
= spi0.0
:256k
(u-boot
)ro
,64k
(u-boot-env
)ro
,7552k
(firmware
),256k
(cfg
)ro
,64k
(EEPROM
)ro
445 IMAGES
:= sysupgrade.bin factory.bin
446 IMAGE
/factory.bin
= $$(IMAGE
/sysupgrade.bin
) | mkubntimage-split
447 IMAGE
/sysupgrade.bin
= append-kernel
$$$$(BLOCKSIZE
) | append-rootfs | pad-rootfs | check-size
$$$$(IMAGE_SIZE
)
450 define Device
/ubnt-bz
451 DEVICE_PROFILE
:= UBNT
453 MTDPARTS
= spi0.0
:256k
(u-boot
)ro
,64k
(u-boot-env
)ro
,7552k
(firmware
),256k
(cfg
)ro
,64k
(EEPROM
)ro
457 IMAGES
:= sysupgrade.bin factory.bin
458 IMAGE
/factory.bin
= $$(IMAGE
/sysupgrade.bin
) | mkubntimage-split
459 IMAGE
/sysupgrade.bin
= append-kernel
$$$$(BLOCKSIZE
) | append-rootfs | pad-rootfs | check-size
$$$$(IMAGE_SIZE
)
462 define Device
/ubnt-unifiac
463 DEVICE_PROFILE
:= UBNT
465 MTDPARTS
= spi0.0
:384k
(u-boot
)ro
,64k
(u-boot-env
)ro
,7744k
(firmware
),7744k
(ubnt-airos
)ro
,128k
(bs
)ro
,256k
(cfg
)ro
,64k
(EEPROM
)ro
466 IMAGES
:= sysupgrade.bin
467 IMAGE
/sysupgrade.bin
= append-kernel
$$$$(BLOCKSIZE
) | append-rootfs | pad-rootfs | check-size
$$$$(IMAGE_SIZE
)
470 define Device
/rw2458n
475 define Device
/ubnt-airrouter
480 define Device
/ubnt-bullet-m
485 define Device
/ubnt-rocket-m
490 define Device
/ubnt-nano-m
494 TARGET_DEVICES
+= rw2458n ubnt-airrouter ubnt-bullet-m ubnt-rocket-m ubnt-nano-m
496 define Device
/ubnt-unifi
499 DEVICE_PROFILE
:= UBNT UBNTUNIFI
502 define Device
/ubnt-unifiac-lite
503 $(Device
/ubnt-unifiac
)
504 DEVICE_PROFILE
:= UBNT UBNTUNIFIACLITE
505 BOARDNAME
:= UBNT-UF-AC-LITE
508 define Device
/ubnt-unifiac-pro
509 $(Device
/ubnt-unifiac
)
510 DEVICE_PROFILE
:= UBNT UBNTUNIFIACPRO
511 BOARDNAME
:= UBNT-UF-AC-PRO
514 define Device
/ubnt-unifi-outdoor
516 BOARDNAME
:= UBNT-U20
517 DEVICE_PROFILE
:= UBNT UBNTUNIFIOUTDOOR
519 TARGET_DEVICES
+= ubnt-unifi ubnt-unifiac-lite ubnt-unifiac-pro ubnt-unifi-outdoor
521 define Device
/ubnt-nano-m-xw
523 BOARDNAME
:= UBNT-NM-XW
526 define Device
/ubnt-loco-m-xw
528 BOARDNAME
:= UBNT-LOCO-XW
531 define Device
/ubnt-rocket-m-xw
533 BOARDNAME
:= UBNT-RM-XW
536 define Device
/ubnt-rocket-m-ti
538 BOARDNAME
:= UBNT-RM-TI
542 TARGET_DEVICES
+= ubnt-nano-m-xw ubnt-loco-m-xw ubnt-rocket-m-xw ubnt-rocket-m-ti
544 define Device
/ubnt-air-gateway
546 BOARDNAME
:= UBNT-AGW
550 CONSOLE
= ttyATH0
,115200
552 TARGET_DEVICES
+= ubnt-air-gateway
554 define Device
/ubnt-air-gateway-pro
556 BOARDNAME
:= UBNT-AGWP
559 CONSOLE
= ttyS0
,115200
561 TARGET_DEVICES
+= ubnt-air-gateway-pro
563 define Device
/ubdev01
565 MTDPARTS
:= spi0.0
:256k
(u-boot
)ro
,64k
(u-boot-env
)ro
,7488k
(firmware
),64k
(certs
),256k
(cfg
)ro
,64k
(EEPROM
)ro
567 UBNT_BOARD
:= UBDEV01
572 TARGET_DEVICES
+= ubdev01
574 define Device
/ubnt-routerstation
576 IMAGES
:= sysupgrade.bin factory.bin
577 IMAGE
/factory.bin
= append-rootfs | pad-rootfs | mkubntimage
578 IMAGE
/sysupgrade.bin
= append-rootfs | pad-rootfs | combined-image | check-size
$$$$(IMAGE_SIZE
)
579 KERNEL
:= kernel-bin | patch-cmdline | lzma | pad-to
$$(BLOCKSIZE
)
582 define Device
/ubnt-rs
583 $(Device
/ubnt-routerstation
)
585 DEVICE_PROFILE
:= Madwifi UBNT UBNTRS
591 define Device
/ubnt-rspro
592 $(Device
/ubnt-routerstation
)
593 BOARDNAME
:= UBNT-RSPRO
594 DEVICE_PROFILE
:= Madwifi UBNT UBNTRSPRO
597 UBNT_CHIP
:= ar7100pro
600 define Device
/ubnt-ls-sr71
601 $(Device
/ubnt-routerstation
)
602 BOARDNAME
:= UBNT-LS-SR71
603 DEVICE_PROFILE
:= Madwifi UBNT
604 UBNT_BOARD
:= LS-SR71
609 TARGET_DEVICES
+= ubnt-rs ubnt-rspro ubnt-ls-sr71
611 define Device
/ubnt-uap-pro
614 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
)
618 DEVICE_PROFILE
:= UBNT UAPPRO
619 KERNEL
:= kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 kernel0
620 IMAGES
:= sysupgrade.bin factory.bin
621 IMAGE
/sysupgrade.bin
= append-kernel
$$$$(KERNEL_SIZE
) | append-rootfs | pad-rootfs | check-size
$$$$(IMAGE_SIZE
)
622 IMAGE
/factory.bin
= $$(IMAGE
/sysupgrade.bin
) | mkubntimage2
625 define Device
/ubnt-unifi-outdoor-plus
626 $(Device
/ubnt-uap-pro
)
628 BOARDNAME
:= UBNT-UOP
629 DEVICE_PROFILE
:= UBNT
632 TARGET_DEVICES
+= ubnt-uap-pro ubnt-unifi-outdoor-plus
634 define Device
/NBG6616
638 MTDPARTS
= spi0.0
:192k
(u-boot
)ro
,64k
(env
)ro
,64k
(RFdata
)ro
,384k
(zyxel_rfsd
),384k
(romd
),64k
(header
),2048k
(kernel
),13184k
(rootfs
),15232k@
0x120000(firmware
)
640 IMAGES
:= sysupgrade.bin
641 KERNEL
:= kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 boot
/vmlinux.lzma.uImage
642 IMAGE
/sysupgrade.bin
= append-kernel
$$$$(KERNEL_SIZE
) | append-rootfs | pad-rootfs | check-size
$$$$(IMAGE_SIZE
)
643 # We cannot currently build a factory image. It is the sysupgrade image
644 # prefixed with a header (which is actually written into the MTD device).
645 # The header is 2kiB and is filled with 0xff. The format seems to be:
647 # 2 bytes: checksum of the data partition (big endian)
648 # 4 bytes: length of the contained image file (big endian)
649 # 32 bytes: Firmware Version string (NUL terminated, 0xff padded)
651 # 2 bytes: checksum over the header partition (big endian)
652 # 32 bytes: Model (e.g. "NBG6616", NUL termiated, 0xff padded)
655 # The checksums are calculated by adding up all bytes and if a 16bit
656 # overflow occurs, one is added and the sum is masked to 16 bit:
657 # csum = csum + databyte; if (csum > 0xffff) { csum += 1; csum &= 0xffff };
658 # Should the file have an odd number of bytes then the byte len-0x800 is
660 # The checksum for the header is calcualted over the first 2048 bytes with
661 # the firmware checksum as the placeholder during calculation.
663 # The header is padded with 0xff to the erase block size of the device.
666 TARGET_DEVICES
+= NBG6616
668 ifeq ($(SUBTARGET
),generic
)
673 MTDPARTS
= spi0.0
:256k
(u-boot
)ro
,128k
(u-boot-env
)ro
,2048k
(kernel
),13824k
(rootfs
),13824k
(opt
)ro
,2624k
(failsafe
)ro
,64k
(art
)ro
,15872k@
0x60000(firmware
)
674 IMAGE
/sysupgrade.bin
= append-kernel
$$$$(KERNEL_SIZE
) | append-rootfs | pad-rootfs | check-size
$$$$(IMAGE_SIZE
)
677 TARGET_DEVICES
+= c-55
679 endif # ifeq ($(SUBTARGET),generic)
681 ifeq ($(SUBTARGET
),nand
)
683 define Build
/MerakiNAND
684 -$(STAGING_DIR_HOST
)/bin
/mkmerakifw \
694 CONSOLE
= ttyS0
,115200
695 MTDPARTS
= ar934x-nfc
:512k
(nandloader
)ro
,8M
(kernel
),8M
(recovery
),113664k
(ubi
),128k@
130944k
(odm-caldata
)ro
696 IMAGES
:= sysupgrade.
tar
697 KERNEL
:= kernel-bin | patch-cmdline | MerakiNAND
698 KERNEL_INITRAMFS
:= kernel-bin | patch-cmdline | MerakiNAND
699 IMAGE
/sysupgrade.
tar := sysupgrade-nand
701 TARGET_DEVICES
+= mr18
703 endif # ifeq ($(SUBTARGET),nand)
705 $(eval
$(call BuildImage
))