2 # Copyright (C) 2012-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
10 include $(TOPDIR
)/rules.mk
11 include $(INCLUDE_DIR
)/image.mk
13 KERNEL_LOADADDR
:= 0x00008000
15 DEVICE_VARS
+= KERNEL_SIZE
18 $(call Image
/BuildDTB
,$(DTS_DIR
)/$(DEVICE_DTS
).dts
,$@.dtb
)
21 define Build
/clearfog-bundle
23 $(TAR
) -cp
--numeric-owner
--owner
=0 --group
=0 --sort=name \
24 $(if
$(SOURCE_DATE_EPOCH
),--mtime
="@$(SOURCE_DATE_EPOCH)") \
25 --file
=$@.new
-C
$(TARGET_DIR
)/ .
26 $(TAR
) -rp
--numeric-owner
--owner
=0 --group
=0 --sort=name \
27 $(if
$(SOURCE_DATE_EPOCH
),--mtime
="@$(SOURCE_DATE_EPOCH)") \
28 --file
=$@.new
-C
$(dir $(IMAGE_KERNEL
)) $(notdir $(IMAGE_KERNEL
)) $(notdir $(IMAGE_KERNEL
).dtb
)
29 gzip
-9n
-c
$@.new
> $@
33 # these values are optimized for a 4GB labeled sdcard that actually holds 7744512 sectors of 512 byte
35 # Partition 1: 32768 sectors
36 # Partition 2: 98304 sectors (configurable)
37 # Partition 3: 7611392 sectors (configurable, depends on p2 size)
41 mkimage
-A arm
-O linux
-T script
-C none
-a
0 -e
0 -d boot.script
$@.bootscript
46 mkfs.fat
-C
$@.boot
16384
47 $(foreach dts
,$(DEVICE_DTS
), mcopy
-i
$@.boot
$(DTS_DIR
)/$(dts
).dtb
::$(dts
).dtb
)
48 mcopy
-i
$@.boot
$(IMAGE_KERNEL
) ::zImage
49 mcopy
-i
$@.boot
$@.bootscript
::boot.scr
52 define Build
/sdcard-img
53 rm -rf
$@
$@.rootfsdata
$@.tmp
55 ROOTFS_SIZE
=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE
) * 1024 * 2 )); \
56 DATA_SIZE
=$$(( 7709696 - ($(CONFIG_TARGET_ROOTFS_PARTSIZE
) * 1024 * 2) )); \
57 make_ext4fs
-J
-l
$$DATA_SIZE $@.rootfsdata
$@.tmp
&& \
58 .
/gen_mvebu_sdcard_img.sh
7744512 $@ \
59 "$(BIN_DIR)/uboot-mvebu-clearfog/openwrt-mvebu-clearfog-u-boot-spl.kwb" \
61 83 $$ROOTFS_SIZE $(IMAGE_ROOTFS
) \
62 83 $$DATA_SIZE $@.rootfsdata
68 BOARD_NAME
= $$(DEVICE_DTS
)
70 KERNEL
:= kernel-bin | append-dtb | uImage none
74 IMAGES
:= sysupgrade.bin
75 IMAGE
/sysupgrade.bin
:= sysupgrade-tar
78 define Device
/UBI-factory
81 IMAGE
/factory.img
:= append-kernel
$$$$(KERNEL_SIZE
) | append-ubi | pad-to
$$$$(PAGESIZE
)
84 define Device
/NAND-128K
89 VID_HDR_OFFSET
:= 2048
92 define Device
/NAND-256K
98 define Device
/NAND-512K
104 define Device
/linksys
105 DEVICE_TITLE
:= Linksys
$(1)
106 DEVICE_PACKAGES
:= kmod-mwlwifi wpad-mini swconfig
109 define Device
/armada-385-linksys
111 $(Device
/UBI-factory
)
115 define Device
/linksys-wrt1200ac
116 $(call Device
/linksys
,WRT1200AC
(Caiman
))
117 $(Device
/armada-385-linksys
)
118 DEVICE_DTS
:= armada-385-linksys-caiman
120 TARGET_DEVICES
+= linksys-wrt1200ac
122 define Device
/linksys-wrt1900acv2
123 $(call Device
/linksys
,WRT1900ACv2
(Cobra
))
124 $(Device
/armada-385-linksys
)
125 DEVICE_DTS
:= armada-385-linksys-cobra
127 TARGET_DEVICES
+= linksys-wrt1900acv2
129 define Device
/linksys-wrt1900acs
130 $(call Device
/linksys
,WRT1900ACS
(Shelby
))
131 $(Device
/armada-385-linksys
)
132 DEVICE_DTS
:= armada-385-linksys-shelby
134 TARGET_DEVICES
+= linksys-wrt1900acs
136 define Device
/linksys-wrt1900ac
137 $(call Device
/linksys
,WRT1900AC
(Mamba
))
138 DEVICE_DTS
:= armada-xp-linksys-mamba
140 $(Device
/UBI-factory
)
143 TARGET_DEVICES
+= linksys-wrt1900ac
145 define Device
/openblocks-ax3
146 $(Device
/UBI-factory
)
147 DEVICE_DTS
:= armada-xp-openblocks-ax3-4
150 IMAGE
/factory.img
:= append-kernel
$$$$(KERNEL_SIZE
) | append-ubi
151 DEVICE_TITLE
:= Plat
'Home OpenBlocks AX3
153 TARGET_DEVICES += openblocks-ax3
155 define Device/armada-385-db-ap
157 $(Device/UBI-factory)
159 DEVICE_TITLE := Marvell Armada 385 DB AP (DB-88F6820-AP)
161 TARGET_DEVICES += armada-385-db-ap
163 define Device/marvell-nand
165 DEVICE_TITLE := Marvell Armada $(1)
168 Device/armada-370-db = $(call Device/marvell-nand,370 DB (DB-88F6710-BP-DDR3))
169 Device/armada-370-rd = $(call Device/marvell-nand,370 RD (RD-88F6710-A1))
170 Device/armada-xp-db = $(call Device/marvell-nand,XP DB (DB-78460-BP))
171 Device/armada-xp-gp = $(call Device/marvell-nand,XP GP (DB-MV784MP-GP))
172 TARGET_DEVICES += armada-370-db armada-370-rd armada-xp-db armada-xp-gp
174 define Device/armada-388-rd
175 DEVICE_TITLE := Marvell Armada 388 RD (RD-88F6820-AP)
176 IMAGES := firmware.bin
177 IMAGE/firmware.bin := append-kernel 256k | append-rootfs | pad-rootfs
179 TARGET_DEVICES += armada-388-rd
181 define Device/armada-388-clearfog
183 KERNEL := dtb | kernel-bin
184 DEVICE_TITLE := SolidRun ClearFog
185 DEVICE_PACKAGES := uboot-mvebu-clearfog kmod-fs-ext4
186 IMAGES := bundle.tar.gz sdcard.img.gz
187 IMAGE/bundle.tar.gz := clearfog-bundle
188 IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip
189 IMAGE_NAME = $$(IMAGE_PREFIX)-$$(2)
191 TARGET_DEVICES += armada-388-clearfog
193 define Device/globalscale-mirabox
195 DEVICE_DTS := armada-370-mirabox
196 DEVICE_TITLE := Globalscale Mirabox
198 TARGET_DEVICES += globalscale-mirabox
200 $(eval $(call BuildImage))