1 # SPDX-License-Identifier: GPL-2.0-only
3 # Copyright (C) 2009-2013 OpenWrt.org
5 include $(TOPDIR
)/rules.mk
6 include $(INCLUDE_DIR
)/image.mk
8 KERNEL_LOADADDR
:=0x8000
10 # Some info about Ctera firmware:
11 # 1. It's simple tar file (GNU standard), but it must have ".firm" suffix.
12 # 2. It contains two images: kernel and romdisk. Both are required.
13 # 3. Every image has header and trailer file.
14 # 4. The struct of tar firmware is: header kernel trailer header romdisk trailer
15 # 5. In header file are some strings used to describe image. It was decoded from
17 # 6. Version format in header file is restricted by Original FW.
18 # 7. Trailer file contains MD5 sum string of header and image file.
19 # 8. Firmware file must have <=24MB size.
21 define Build
/ctera-firmware
24 # Prepare header and trailer file for kernel
25 echo
"# CTera firmware information file" > $@.tmp
/header
26 echo
"image_type=kernel" >> $@.tmp
/header
27 echo
"arch=Kirkwood" >> $@.tmp
/header
28 echo
"board=Any" >> $@.tmp
/header
29 echo
"version=3.1.22.30669" >> $@.tmp
/header
30 echo
"kernel_cmd=console=ttyS0,115200 earlyprintk" >> $@.tmp
/header
31 echo
"date=$$(date $(if $(SOURCE_DATE_EPOCH),-d@$(SOURCE_DATE_EPOCH)))" \
36 echo
"MD5=$$(cat $@.tmp/header $@.tmp/kernel | $(MKHASH) md5)" \
39 tar $(if
$(SOURCE_DATE_EPOCH
),--mtime
="@$(SOURCE_DATE_EPOCH)") \
40 -H gnu
-C
$@.tmp
-cf
$@.
tar header kernel trailer
42 # Prepare header and trailer file for fake romdisk
43 echo
"# CTera firmware information file" > $@.tmp
/header
44 echo
"image_type=romdisk" >> $@.tmp
/header
45 echo
"initrd=yes" >> $@.tmp
/header
46 echo
"arch=Kirkwood" >> $@.tmp
/header
47 echo
"board=Any" >> $@.tmp
/header
48 echo
"version=3.1.22.30669" >> $@.tmp
/header
49 echo
"date=$$(date $(if $(SOURCE_DATE_EPOCH),-d@$(SOURCE_DATE_EPOCH)))" \
54 $(call Build
/append-uImage-fakehdr
, ramdisk
)
57 echo
"MD5=$$(cat $@.tmp/header $@.tmp/romdisk | $(MKHASH) md5)" \
60 tar $(if
$(SOURCE_DATE_EPOCH
),--mtime
="@$(SOURCE_DATE_EPOCH)") \
61 -H gnu
-C
$@.tmp
-rf
$@.
tar header romdisk trailer
67 define Device
/kernel-size-migration-iomega
68 DEVICE_COMPAT_VERSION
:= 2.0
69 DEVICE_COMPAT_MESSAGE
:= \n$\
70 !The partitioning of the router has changed
! \n$\
71 Partition design has changed compared to \
72 older versions
(up to
23.05) due to kernel size restrictions. \
73 Upgrade via sysupgrade mechanism is not possible
, so new \
74 installation via initramfs image is required.
\n$\
75 Please adjust bootcmd in u-boot console
:\n$\
77 'setenv bootargs $$$${console} $$$${mtdparts} $$$${bootargs_root}; \
78 nand read.e 0x800000 0x100000 0x400000; bootm 0x00800000'\n$\
80 or use OpenWrt
shell:\n$\
82 "setenv bootargs $$$${console} $$$${mtdparts} $$$${bootargs_root};\
83 nand read.e 0x800000 0x100000 0x400000; bootm 0x00800000"\n$\
84 and reinstall image with initramfs image. \
85 Please see original instructions for more details.
88 define Device
/kernel-size-migration-linksys
89 DEVICE_COMPAT_VERSION
:= 3.0
90 DEVICE_COMPAT_MESSAGE
:= \n$\
91 !The partitioning of the router has changed
! \n$\
92 Partition design has changed compared to \
93 older versions
(up to
23.05) due to kernel size restrictions.
\n$\
94 Upgrade via sysupgrade mechanism is not possible
, so u-boot args \
95 adjustment and new installation via factory style image is required.
\n$\
96 Upgrade instructions
: \n$\
97 2. Run folowing commands in console
(ssh or serial
): \n$\
99 \t fw_setenv nandboot \
100 "$$$$(fw_printenv nandboot | awk -F= '{sub(/^nandboot=/, "");print}' \
101 | sed 's/0x300000/0x400000/g')"\n$\
102 \t fw_setenv altnandboot \
103 "$$$$(fw_printenv altnandboot | awk -F= '{sub(/^altnandboot=/, "");print}' \
104 | sed 's/0x300000/0x400000/g')"\n$\
105 3. Test if envs are ok by
'fw_printenv'. \
106 It should be the same except last argument of\
107 'nand read.e' in
'nandboot' and
'altnandboot'.
\n$\
108 4. If envs are ok
, please apply FACTORY image with command
:\n$\
109 \t sysupgrade
-F
-n OPENWRT_FACTORY_IMAGE.bin
\n$\
110 5. System should start normally. If not
, serial console will be required.
113 define Device
/Default
115 DEVICE_DTS
= kirkwood-
$(lastword
$(subst _
, ,$(1)))
116 KERNEL_DEPENDS
= $$(wildcard $(DTS_DIR
)/$$(DEVICE_DTS
).dts
)
117 KERNEL
:= kernel-bin | append-dtb | uImage none
118 KERNEL_NAME
:= zImage
119 KERNEL_SUFFIX
:= -uImage
125 IMAGES
:= sysupgrade.bin factory.bin
126 IMAGE
/sysupgrade.bin
:= sysupgrade-tar | append-metadata
127 IMAGE
/factory.bin
:= append-ubi
130 define Device
/checkpoint_l-50
131 DEVICE_VENDOR
:= Check Point
133 DEVICE_PACKAGES
:= kmod-ath9k kmod-gpio-button-hotplug kmod-mvsdio \
134 kmod-rtc-s35390a kmod-usb-ledtrig-usbport wpad-basic-mbedtls
135 IMAGES
:= sysupgrade.bin
137 TARGET_DEVICES
+= checkpoint_l-50
139 define Device
/cisco_on100
140 DEVICE_VENDOR
:= Cisco Systems
141 DEVICE_MODEL
:= ON100
145 IMAGE
/factory.bin
:= append-kernel | pad-to
$$$$(KERNEL_SIZE
) | append-ubi
146 DEVICE_PACKAGES
:= kmod-mvsdio kmod-rtc-mv
147 SUPPORTED_DEVICES
+= on100
149 TARGET_DEVICES
+= cisco_on100
151 define Device
/cloudengines_pogoe02
152 DEVICE_VENDOR
:= Cloud Engines
153 DEVICE_MODEL
:= Pogoplug E02
154 DEVICE_DTS
:= kirkwood-pogo_e02
155 DEVICE_PACKAGES
:= kmod-rtc-mv
156 SUPPORTED_DEVICES
+= pogo_e02
158 TARGET_DEVICES
+= cloudengines_pogoe02
160 define Device
/cloudengines_pogoplugv4
161 DEVICE_VENDOR
:= Cloud Engines
162 DEVICE_MODEL
:= Pogoplug V4
163 DEVICE_DTS
:= kirkwood-pogoplug-series-4
164 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 kmod-mvsdio kmod-usb3 \
165 kmod-gpio-button-hotplug kmod-rtc-mv
167 TARGET_DEVICES
+= cloudengines_pogoplugv4
169 define Device
/ctera_c200-v1
170 DEVICE_VENDOR
:= Ctera
173 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-gpio-button-hotplug \
174 kmod-hwmon-lm63 kmod-rtc-s35390a kmod-usb-ledtrig-usbport
175 KERNEL
:= kernel-bin | append-dtb | uImage none | ctera-firmware
177 KERNEL_SUFFIX
:= -factory.firm
178 IMAGES
:= sysupgrade.bin
180 TARGET_DEVICES
+= ctera_c200-v1
182 define Device
/endian_4i-edge-200
183 DEVICE_VENDOR
:= Endian
184 DEVICE_MODEL
:= 4i Edge
200
185 DEVICE_ALT0_VENDOR
:= Endian
186 DEVICE_ALT0_MODEL
:= UTM Mini Firewall
187 DEVICE_PACKAGES
:= kmod-ath9k kmod-mvsdio wpad-basic-mbedtls kmod-rtc-mv
189 IMAGES
:= sysupgrade.bin
191 TARGET_DEVICES
+= endian_4i-edge-200
193 define Device
/globalscale_sheevaplug
194 DEVICE_VENDOR
:= Globalscale
195 DEVICE_MODEL
:= Sheevaplug
196 DEVICE_PACKAGES
:= kmod-mvsdio kmod-rtc-mv
198 TARGET_DEVICES
+= globalscale_sheevaplug
200 define Device
/iom_iconnect-1.1
201 DEVICE_VENDOR
:= Iomega
202 DEVICE_MODEL
:= Iconnect
203 DEVICE_PACKAGES
:= kmod-rtc-mv
204 DEVICE_DTS
:= kirkwood-iconnect
205 SUPPORTED_DEVICES
+= iconnect
207 TARGET_DEVICES
+= iom_iconnect-1.1
209 define Device
/iom_ix2-200
210 $(Device
/kernel-size-migration-iomega
)
211 DEVICE_VENDOR
:= Iomega
212 DEVICE_MODEL
:= StorCenter ix2-200
213 DEVICE_DTS
:= kirkwood-iomega_ix2_200
214 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 \
215 kmod-gpio-button-hotplug kmod-hwmon-lm63 kmod-rtc-mv
223 IMAGE
/factory.bin
:= append-kernel | pad-to
$$$$(KERNEL_SIZE
) | append-ubi | \
226 TARGET_DEVICES
+= iom_ix2-200
228 define Device
/iom_ix4-200d
229 $(Device
/kernel-size-migration-iomega
)
230 DEVICE_VENDOR
:= Iomega
231 DEVICE_MODEL
:= StorCenter ix4-200d
232 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 \
233 kmod-gpio-button-hotplug kmod-gpio-nxp-74hc164 \
234 kmod-hwmon-adt7475 kmod-mvsdio kmod-spi-gpio kmod-rtc-mv
242 IMAGE
/factory.bin
:= append-kernel | pad-to
$$$$(KERNEL_SIZE
) | append-ubi | \
245 TARGET_DEVICES
+= iom_ix4-200d
247 define Device
/iptime_nas1
248 DEVICE_VENDOR
:= ipTIME
250 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 \
251 kmod-gpio-button-hotplug kmod-gpio-pca953x kmod-hwmon-drivetemp \
252 kmod-hwmon-gpiofan kmod-usb-ledtrig-usbport kmod-rtc-mv kmod-thermal \
254 KERNEL
:= $$(KERNEL
) | iptime-naspkg nas1
257 IMAGES
:= sysupgrade.bin
258 IMAGE
/sysupgrade.bin
:= append-kernel | append-rootfs | pad-rootfs | \
259 check-size | append-metadata
261 TARGET_DEVICES
+= iptime_nas1
263 define Device
/linksys
264 $(Device
/kernel-size-migration-linksys
)
265 DEVICE_VENDOR
:= Linksys
266 DEVICE_PACKAGES
:= kmod-mwl8k wpad-basic-mbedtls kmod-gpio-button-hotplug \
271 IMAGE
/factory.bin
:= append-kernel | pad-to
$$$$(KERNEL_SIZE
) | append-ubi
274 define Device
/linksys_e4200-v2
276 DEVICE_MODEL
:= E4200
278 SUPPORTED_DEVICES
+= linksys
,viper linksys-viper
280 TARGET_DEVICES
+= linksys_e4200-v2
282 define Device
/linksys_ea3500
284 DEVICE_MODEL
:= EA3500
288 SUPPORTED_DEVICES
+= linksys
,audi linksys-audi
290 TARGET_DEVICES
+= linksys_ea3500
292 define Device
/linksys_ea4500
294 DEVICE_MODEL
:= EA4500
295 SUPPORTED_DEVICES
+= linksys
,viper linksys-viper
297 TARGET_DEVICES
+= linksys_ea4500
299 define Device
/netgear_readynas-duo-v2
300 DEVICE_VENDOR
:= NETGEAR
301 DEVICE_MODEL
:= ReadyNAS Duo
303 DEVICE_DTS
:= kirkwood-netgear_readynas_duo_v2
305 IMAGES
:= sysupgrade.bin
306 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 \
307 kmod-gpio-button-hotplug kmod-hwmon-g762 kmod-rtc-rs5c372a kmod-usb3
309 TARGET_DEVICES
+= netgear_readynas-duo-v2
311 define Device
/netgear_stora
312 DEVICE_VENDOR
:= Netgear
313 DEVICE_MODEL
:= Stora
(MS2000
/2110)
314 DEVICE_DTS
:= kirkwood-stora
315 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 \
316 kmod-rtc-pcf8563 kmod-hwmon-lm75 kmod-hwmon-tc654 \
317 kmod-gpio-button-hotplug
319 TARGET_DEVICES
+= netgear_stora
321 define Device
/raidsonic_ib-nas62x0
322 DEVICE_VENDOR
:= RaidSonic
323 DEVICE_MODEL
:= ICY BOX IB-NAS62x0
324 DEVICE_DTS
:= kirkwood-ib62x0
325 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 kmod-rtc-mv
326 SUPPORTED_DEVICES
+= ib62x0
328 TARGET_DEVICES
+= raidsonic_ib-nas62x0
330 define Device
/seagate_blackarmor-nas220
331 DEVICE_VENDOR
:= Seagate
332 DEVICE_MODEL
:= Blackarmor NAS220
333 DEVICE_PACKAGES
:= kmod-hwmon-adt7475 kmod-fs-ext4 kmod-ata-marvell-sata \
334 mdadm kmod-gpio-button-hotplug kmod-rtc-mv
340 TARGET_DEVICES
+= seagate_blackarmor-nas220
342 define Device
/seagate_dockstar
343 DEVICE_VENDOR
:= Seagate
344 DEVICE_MODEL
:= FreeAgent Dockstar
345 DEVICE_PACKAGES
:= kmod-rtc-mv
346 SUPPORTED_DEVICES
+= dockstar
348 TARGET_DEVICES
+= seagate_dockstar
350 define Device
/seagate_goflexnet
351 DEVICE_VENDOR
:= Seagate
352 DEVICE_MODEL
:= GoFlexNet
353 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 kmod-rtc-mv
354 SUPPORTED_DEVICES
+= goflexnet
356 TARGET_DEVICES
+= seagate_goflexnet
358 define Device
/seagate_goflexhome
359 DEVICE_VENDOR
:= Seagate
360 DEVICE_MODEL
:= GoFlexHome
361 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 kmod-rtc-mv
362 SUPPORTED_DEVICES
+= goflexhome
364 TARGET_DEVICES
+= seagate_goflexhome
366 define Device
/zyxel_nsa310b
367 DEVICE_VENDOR
:= ZyXEL
368 DEVICE_MODEL
:= NSA310b
369 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-r8169 kmod-fs-ext4 \
370 kmod-gpio-button-hotplug kmod-hwmon-lm85 kmod-rtc-mv
371 SUPPORTED_DEVICES
+= nsa310b
373 TARGET_DEVICES
+= zyxel_nsa310b
375 define Device
/zyxel_nsa310s
376 DEVICE_VENDOR
:= ZyXEL
377 DEVICE_MODEL
:= NSA310S
378 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 kmod-gpio-button-hotplug
380 TARGET_DEVICES
+= zyxel_nsa310s
382 define Device
/zyxel_nsa325
383 DEVICE_VENDOR
:= ZyXEL
384 DEVICE_MODEL
:= NSA325
385 DEVICE_VARIANT
:= v1
/v2
386 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 \
387 kmod-gpio-button-hotplug kmod-rtc-pcf8563 kmod-usb3
388 SUPPORTED_DEVICES
+= nsa325
390 TARGET_DEVICES
+= zyxel_nsa325
392 $(eval
$(call BuildImage
))