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 ifdef CONFIG_LINUX_6_6
116 DEVICE_DTS_DIR
:= $(DTS_DIR
)/marvell
118 DEVICE_DTS
= kirkwood-
$(lastword
$(subst _
, ,$(1)))
119 KERNEL_DEPENDS
= $$(wildcard $(DTS_DIR
)/$$(DEVICE_DTS
).dts
)
120 KERNEL
:= kernel-bin | append-dtb | uImage none
121 KERNEL_NAME
:= zImage
122 KERNEL_SUFFIX
:= -uImage
128 IMAGES
:= sysupgrade.bin factory.bin
129 IMAGE
/sysupgrade.bin
:= sysupgrade-tar | append-metadata
130 IMAGE
/factory.bin
:= append-ubi
133 define Device
/checkpoint_l-50
134 DEVICE_VENDOR
:= Check Point
136 DEVICE_PACKAGES
:= kmod-ath9k kmod-gpio-button-hotplug kmod-mvsdio \
137 kmod-rtc-s35390a kmod-usb-ledtrig-usbport wpad-basic-mbedtls
138 IMAGES
:= sysupgrade.bin
140 TARGET_DEVICES
+= checkpoint_l-50
142 define Device
/cisco_on100
143 DEVICE_VENDOR
:= Cisco Systems
144 DEVICE_MODEL
:= ON100
148 IMAGE
/factory.bin
:= append-kernel | pad-to
$$$$(KERNEL_SIZE
) | append-ubi
149 DEVICE_PACKAGES
:= kmod-mvsdio kmod-rtc-mv
150 SUPPORTED_DEVICES
+= on100
152 TARGET_DEVICES
+= cisco_on100
154 define Device
/cloudengines_pogoe02
155 DEVICE_VENDOR
:= Cloud Engines
156 DEVICE_MODEL
:= Pogoplug E02
157 DEVICE_DTS
:= kirkwood-pogo_e02
158 DEVICE_PACKAGES
:= kmod-rtc-mv
159 SUPPORTED_DEVICES
+= pogo_e02
161 TARGET_DEVICES
+= cloudengines_pogoe02
163 define Device
/cloudengines_pogoplugv4
164 DEVICE_VENDOR
:= Cloud Engines
165 DEVICE_MODEL
:= Pogoplug V4
166 DEVICE_DTS
:= kirkwood-pogoplug-series-4
167 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 kmod-mvsdio kmod-usb3 \
168 kmod-gpio-button-hotplug kmod-rtc-mv
170 TARGET_DEVICES
+= cloudengines_pogoplugv4
172 define Device
/ctera_c200-v1
173 DEVICE_VENDOR
:= Ctera
176 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-gpio-button-hotplug \
177 kmod-hwmon-lm63 kmod-rtc-s35390a kmod-usb-ledtrig-usbport
178 KERNEL
:= kernel-bin | append-dtb | uImage none | ctera-firmware
180 KERNEL_SUFFIX
:= -factory.firm
181 IMAGES
:= sysupgrade.bin
183 TARGET_DEVICES
+= ctera_c200-v1
185 define Device
/endian_4i-edge-200
186 DEVICE_VENDOR
:= Endian
187 DEVICE_MODEL
:= 4i Edge
200
188 DEVICE_ALT0_VENDOR
:= Endian
189 DEVICE_ALT0_MODEL
:= UTM Mini Firewall
190 DEVICE_PACKAGES
:= kmod-ath9k kmod-mvsdio wpad-basic-mbedtls kmod-rtc-mv
192 IMAGES
:= sysupgrade.bin
194 TARGET_DEVICES
+= endian_4i-edge-200
196 define Device
/globalscale_sheevaplug
197 DEVICE_VENDOR
:= Globalscale
198 DEVICE_MODEL
:= Sheevaplug
199 DEVICE_PACKAGES
:= kmod-mvsdio kmod-rtc-mv
201 TARGET_DEVICES
+= globalscale_sheevaplug
203 define Device
/iom_iconnect-1.1
204 DEVICE_VENDOR
:= Iomega
205 DEVICE_MODEL
:= Iconnect
206 DEVICE_PACKAGES
:= kmod-rtc-mv
207 DEVICE_DTS
:= kirkwood-iconnect
208 SUPPORTED_DEVICES
+= iconnect
210 TARGET_DEVICES
+= iom_iconnect-1.1
212 define Device
/iom_ix2-200
213 $(Device
/kernel-size-migration-iomega
)
214 DEVICE_VENDOR
:= Iomega
215 DEVICE_MODEL
:= StorCenter ix2-200
216 DEVICE_DTS
:= kirkwood-iomega_ix2_200
217 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 \
218 kmod-gpio-button-hotplug kmod-hwmon-lm63 kmod-rtc-mv
226 IMAGE
/factory.bin
:= append-kernel | pad-to
$$$$(KERNEL_SIZE
) | append-ubi | \
229 TARGET_DEVICES
+= iom_ix2-200
231 define Device
/iom_ix4-200d
232 $(Device
/kernel-size-migration-iomega
)
233 DEVICE_VENDOR
:= Iomega
234 DEVICE_MODEL
:= StorCenter ix4-200d
235 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 \
236 kmod-gpio-button-hotplug kmod-gpio-nxp-74hc164 \
237 kmod-hwmon-adt7475 kmod-mvsdio kmod-spi-gpio kmod-rtc-mv
245 IMAGE
/factory.bin
:= append-kernel | pad-to
$$$$(KERNEL_SIZE
) | append-ubi | \
248 TARGET_DEVICES
+= iom_ix4-200d
250 define Device
/iptime_nas1
251 DEVICE_VENDOR
:= ipTIME
253 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 \
254 kmod-gpio-button-hotplug kmod-gpio-pca953x kmod-hwmon-drivetemp \
255 kmod-hwmon-gpiofan kmod-usb-ledtrig-usbport kmod-rtc-mv kmod-thermal \
257 KERNEL
:= $$(KERNEL
) | iptime-naspkg nas1
260 IMAGES
:= sysupgrade.bin
261 IMAGE
/sysupgrade.bin
:= append-kernel | append-rootfs | pad-rootfs | \
262 check-size | append-metadata
264 TARGET_DEVICES
+= iptime_nas1
266 define Device
/linksys
267 $(Device
/kernel-size-migration-linksys
)
268 DEVICE_VENDOR
:= Linksys
269 DEVICE_PACKAGES
:= kmod-mwl8k wpad-basic-mbedtls kmod-gpio-button-hotplug \
274 IMAGE
/factory.bin
:= append-kernel | pad-to
$$$$(KERNEL_SIZE
) | append-ubi
277 define Device
/linksys_e4200-v2
279 DEVICE_MODEL
:= E4200
281 SUPPORTED_DEVICES
+= linksys
,viper linksys-viper
283 TARGET_DEVICES
+= linksys_e4200-v2
285 define Device
/linksys_ea3500
287 DEVICE_MODEL
:= EA3500
291 SUPPORTED_DEVICES
+= linksys
,audi linksys-audi
293 TARGET_DEVICES
+= linksys_ea3500
295 define Device
/linksys_ea4500
297 DEVICE_MODEL
:= EA4500
298 SUPPORTED_DEVICES
+= linksys
,viper linksys-viper
300 TARGET_DEVICES
+= linksys_ea4500
302 define Device
/netgear_readynas-duo-v2
303 DEVICE_VENDOR
:= NETGEAR
304 DEVICE_MODEL
:= ReadyNAS Duo
306 DEVICE_DTS
:= kirkwood-netgear_readynas_duo_v2
308 IMAGES
:= sysupgrade.bin
309 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 \
310 kmod-gpio-button-hotplug kmod-hwmon-g762 kmod-rtc-rs5c372a kmod-usb3
312 TARGET_DEVICES
+= netgear_readynas-duo-v2
314 define Device
/netgear_stora
315 DEVICE_VENDOR
:= Netgear
316 DEVICE_MODEL
:= Stora
(MS2000
/2110)
317 DEVICE_DTS
:= kirkwood-stora
318 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 \
319 kmod-rtc-pcf8563 kmod-hwmon-lm75 kmod-hwmon-tc654 \
320 kmod-gpio-button-hotplug
322 TARGET_DEVICES
+= netgear_stora
324 define Device
/raidsonic_ib-nas62x0
325 DEVICE_VENDOR
:= RaidSonic
326 DEVICE_MODEL
:= ICY BOX IB-NAS62x0
327 DEVICE_DTS
:= kirkwood-ib62x0
328 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 kmod-rtc-mv
329 SUPPORTED_DEVICES
+= ib62x0
331 TARGET_DEVICES
+= raidsonic_ib-nas62x0
333 define Device
/seagate_blackarmor-nas220
334 DEVICE_VENDOR
:= Seagate
335 DEVICE_MODEL
:= Blackarmor NAS220
336 DEVICE_PACKAGES
:= kmod-hwmon-adt7475 kmod-fs-ext4 kmod-ata-marvell-sata \
337 mdadm kmod-gpio-button-hotplug kmod-rtc-mv
343 TARGET_DEVICES
+= seagate_blackarmor-nas220
345 define Device
/seagate_dockstar
346 DEVICE_VENDOR
:= Seagate
347 DEVICE_MODEL
:= FreeAgent Dockstar
348 DEVICE_PACKAGES
:= kmod-rtc-mv
349 SUPPORTED_DEVICES
+= dockstar
351 TARGET_DEVICES
+= seagate_dockstar
353 define Device
/seagate_goflexnet
354 DEVICE_VENDOR
:= Seagate
355 DEVICE_MODEL
:= GoFlexNet
356 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 kmod-rtc-mv
357 SUPPORTED_DEVICES
+= goflexnet
359 TARGET_DEVICES
+= seagate_goflexnet
361 define Device
/seagate_goflexhome
362 DEVICE_VENDOR
:= Seagate
363 DEVICE_MODEL
:= GoFlexHome
364 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 kmod-rtc-mv
365 SUPPORTED_DEVICES
+= goflexhome
367 TARGET_DEVICES
+= seagate_goflexhome
369 define Device
/zyxel_nsa310b
370 DEVICE_VENDOR
:= ZyXEL
371 DEVICE_MODEL
:= NSA310b
372 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-r8169 kmod-fs-ext4 \
373 kmod-gpio-button-hotplug kmod-hwmon-lm85 kmod-rtc-mv
374 SUPPORTED_DEVICES
+= nsa310b
376 TARGET_DEVICES
+= zyxel_nsa310b
378 define Device
/zyxel_nsa310s
379 DEVICE_VENDOR
:= ZyXEL
380 DEVICE_MODEL
:= NSA310S
381 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 kmod-gpio-button-hotplug
383 TARGET_DEVICES
+= zyxel_nsa310s
385 define Device
/zyxel_nsa325
386 DEVICE_VENDOR
:= ZyXEL
387 DEVICE_MODEL
:= NSA325
388 DEVICE_VARIANT
:= v1
/v2
389 DEVICE_PACKAGES
:= kmod-ata-marvell-sata kmod-fs-ext4 \
390 kmod-gpio-button-hotplug kmod-rtc-pcf8563 kmod-usb3
391 SUPPORTED_DEVICES
+= nsa325
393 TARGET_DEVICES
+= zyxel_nsa325
395 $(eval
$(call BuildImage
))