openwrt/package/boot/uboot-envtools/files/mvebu
Vladimir Vid 7dff6a8c89 mvebu: uDPU: add sysupgrade support
This patch adds sysupgrade, uboot-env and networking support
for Methode uDPU device.

Device features 4 partitions:

-----------------------------------------
|  boot   | recovery  | rootfs |  misc  |
| (ext4)  |  (ext4)   | (fsf2) | (f2fs) |
_________________________________________

Idea was to use f2fs only but the u-boot currently lacks support
so first 2 partition are ext4 to be u-boot readable, and this was
a reason why custom build and sysupgrade sections were required.

On the sysupgrade, boot and rootfs partitions are updated, firmare
image and user configuration is saved on the misc partition and if
the upgrade was successfull, recovery partition will be updated on
after the reboot from preinit script. If the sysupgrade fails for any
reason, device will fallback to recovery initramfs image.

Signed-off-by: Vladimir Vid <vladimir.vid@sartura.hr>
2019-08-24 23:11:15 +02:00

48 lines
1020 B
Bash

#!/bin/sh
#
# Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#
[ -e /etc/config/ubootenv ] && exit 0
touch /etc/config/ubootenv
. /lib/uboot-envtools.sh
. /lib/functions.sh
board=$(board_name)
case "$board" in
cznic,turris-omnia)
ubootenv_add_uci_config "/dev/mtd0" "0xC0000" "0x10000" "0x40000"
;;
globalscale,espressobin|\
globalscale,espressobin-emmc|\
globalscale,espressobin-v7|\
globalscale,espressobin-v7-emmc|\
marvell,armada8040-mcbin)
ubootenv_add_uci_config "/dev/mtd0" "0x3f0000" "0x10000" "0x10000" "1"
;;
linksys,caiman|\
linksys,cobra|\
linksys,shelby)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x40000"
;;
linksys,mamba)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x20000"
;;
linksys,rango|\
linksys,venom)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
;;
methode,udpu)
ubootenv_add_uci_config "/dev/mtd0" "0x180000" "0x10000" "0x10000"
;;
esac
config_load ubootenv
config_foreach ubootenv_add_app_config ubootenv
exit 0