mvebu: add ClearFog .tar.gz bundle
[lede.git] / target / linux / mvebu / image / Makefile
1 #
2 # Copyright (C) 2012-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 JFFS2_BLOCKSIZE = 128k
9
10 include $(TOPDIR)/rules.mk
11 include $(INCLUDE_DIR)/image.mk
12
13 KERNEL_LOADADDR := 0x00008000
14
15 DEVICE_VARS += KERNEL_SIZE
16
17 define Image/mkfs/bundle
18         $(TAR) -cp --numeric-owner --owner=0 --group=0 --sort=name \
19                 $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
20                 -C $(call mkfs_target_dir,$(1))/ . > $@
21 endef
22 TARGET_FILESYSTEMS += bundle
23
24 define Build/dtb
25         $(call Image/BuildDTB,$(DTS_DIR)/$(DEVICE_DTS).dts,$@.dtb)
26 endef
27
28 define Build/clearfog-bundle
29         cp $(IMAGE_ROOTFS) $@.new
30         $(TAR) -rp --numeric-owner --owner=0 --group=0 --sort=name \
31                 $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
32                 --file=$@.new -C $(dir $(IMAGE_KERNEL))/ $(notdir $(IMAGE_KERNEL)) $(notdir $(IMAGE_KERNEL).dtb)
33         gzip -9n -c $@.new > $@
34 endef
35
36
37 define Device/Default
38   PROFILES := Default
39   DEVICE_DTS := $(1)
40   BOARD_NAME = $$(DEVICE_DTS)
41   KERNEL_NAME := zImage
42   KERNEL := kernel-bin | append-dtb | uImage none
43   FILESYSTEMS = $(filter-out bundle,$(TARGET_FILESYSTEMS))
44 endef
45
46 define Device/UBI
47   IMAGES := sysupgrade.bin
48   IMAGE/sysupgrade.bin := sysupgrade-tar
49 endef
50
51 define Device/UBI-factory
52   $(Device/UBI)
53   IMAGES += factory.img
54   IMAGE/factory.img := append-kernel $$$$(KERNEL_SIZE) | append-ubi | pad-to $$$$(PAGESIZE)
55 endef
56
57 define Device/NAND-128K
58   $(Device/UBI)
59   BLOCKSIZE := 128KiB
60   PAGESIZE := 2048
61   SUBPAGESIZE := 512
62   VID_HDR_OFFSET := 2048
63 endef
64
65 define Device/NAND-256K
66   $(Device/UBI)
67   BLOCKSIZE := 256KiB
68   PAGESIZE := 4096
69 endef
70
71 define Device/NAND-512K
72   $(Device/UBI)
73   BLOCKSIZE := 512KiB
74   PAGESIZE := 4096
75 endef
76
77 define Device/linksys
78   DEVICE_TITLE := Linksys $(1)
79   DEVICE_PACKAGES := kmod-mwlwifi wpad-mini swconfig
80 endef
81
82 define Device/armada-385-linksys
83   $(Device/NAND-128K)
84   $(Device/UBI-factory)
85   KERNEL_SIZE := 6144k
86 endef
87
88 define Device/linksys-wrt1200ac
89   $(call Device/linksys,WRT1200AC (Caiman))
90   $(Device/armada-385-linksys)
91   DEVICE_DTS := armada-385-linksys-caiman
92 endef
93 TARGET_DEVICES += linksys-wrt1200ac
94
95 define Device/linksys-wrt1900acv2
96   $(call Device/linksys,WRT1900ACv2 (Cobra))
97   $(Device/armada-385-linksys)
98   DEVICE_DTS := armada-385-linksys-cobra
99 endef
100 TARGET_DEVICES += linksys-wrt1900acv2
101
102 define Device/linksys-wrt1900acs
103   $(call Device/linksys,WRT1900ACS (Shelby))
104   $(Device/armada-385-linksys)
105   DEVICE_DTS := armada-385-linksys-shelby
106 endef
107 TARGET_DEVICES += linksys-wrt1900acs
108
109 define Device/linksys-wrt1900ac
110   $(call Device/linksys,WRT1900AC (Mamba))
111   DEVICE_DTS := armada-xp-linksys-mamba
112   $(Device/NAND-128K)
113   $(Device/UBI-factory)
114   KERNEL_SIZE := 3072k
115 endef
116 TARGET_DEVICES += linksys-wrt1900ac
117
118 define Device/openblocks-ax3
119   $(Device/UBI-factory)
120   DEVICE_DTS := armada-xp-openblocks-ax3-4
121   BLOCKSIZE := 128KiB
122   PAGESIZE := 1
123   IMAGE/factory.img := append-kernel $$$$(KERNEL_SIZE) | append-ubi
124   DEVICE_TITLE := Plat'Home OpenBlocks AX3
125 endef
126 TARGET_DEVICES += openblocks-ax3
127
128 define Device/armada-385-db-ap
129   $(Device/NAND-256K)
130   $(Device/UBI-factory)
131   KERNEL_SIZE := 8192k
132   DEVICE_TITLE := Marvell Armada 385 DB AP (DB-88F6820-AP)
133 endef
134 TARGET_DEVICES += armada-385-db-ap
135
136 define Device/marvell-nand
137   $(Device/NAND-512K)
138   DEVICE_TITLE := Marvell Armada $(1)
139 endef
140
141 Device/armada-370-db = $(call Device/marvell-nand,370 DB (DB-88F6710-BP-DDR3))
142 Device/armada-370-rd = $(call Device/marvell-nand,370 RD (RD-88F6710-A1))
143 Device/armada-xp-db = $(call Device/marvell-nand,XP DB (DB-78460-BP))
144 Device/armada-xp-gp = $(call Device/marvell-nand,XP GP (DB-MV784MP-GP))
145 TARGET_DEVICES += armada-370-db armada-370-rd armada-xp-db armada-xp-gp
146
147 define Device/armada-388-rd
148   DEVICE_TITLE := Marvell Armada 388 RD (RD-88F6820-AP)
149   IMAGES := firmware.bin
150   IMAGE/firmware.bin := append-kernel 256k | append-rootfs | pad-rootfs
151 endef
152 TARGET_DEVICES += armada-388-rd
153
154 define Device/armada-388-clearfog
155   KERNEL_INSTALL := 1
156   KERNEL := dtb | kernel-bin
157   DEVICE_TITLE := SolidRun ClearFog
158   FILESYSTEMS := bundle
159   IMAGES := bundle.tar.gz
160   IMAGE/bundle.tar.gz := append-rootfs | clearfog-bundle
161   IMAGE_NAME = $$(IMAGE_PREFIX)-$$(2)
162 endef
163 TARGET_DEVICES += armada-388-clearfog
164
165 define Device/globalscale-mirabox
166   $(Device/NAND-512K)
167   DEVICE_DTS := armada-370-mirabox
168   DEVICE_TITLE := Globalscale Mirabox
169 endef
170 TARGET_DEVICES += globalscale-mirabox
171
172 $(eval $(call BuildImage))