openwrtv3/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg
Michael Gray bfbdeeb3de mvebu: add support for WRT32X (venom)
Linksys WRT32X (Venom) is identical in hardware to the WRT3200ACM
with a different flash layout and boots zImage rather than uImage.

Specification:
- Marvell Armada 385 88F6820 (2x 1.8GHz)
- 256MB of Flash
- 512MB of RAM
- 2.4GHz (bgn) and 5GHz (an+ac wave 2)
- 4x 1Gbps LAN + 1x 1Gbps WAN
- 1x USB 3.0 and 1x USB 2.0/eSATA (combo port)

Flash instruction:
Apply factory image via web-gui.

Signed-off-by: Michael Gray <michael.gray@lantisproject.com>
2018-05-14 17:20:10 +02:00

37 lines
992 B
Text

#
# Copyright (C) 2014-2016 OpenWrt.org
# Copyright (C) 2016 LEDE-Project.org
#
preinit_mount_syscfg() {
. /lib/functions.sh
case $(board_name) in
armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-rango|armada-385-linksys-shelby|armada-385-linksys-venom|armada-xp-linksys-mamba)
needs_recovery=0
syscfg_part=$(grep syscfg /proc/mtd |cut -c4)
ubiattach -m $syscfg_part || needs_recovery=1
if [ $needs_recovery -eq 1 ]
then
echo "ubifs syscfg partition is damaged, reformatting"
ubidetach -m $syscfg_part
ubiformat -y -O 2048 -q /dev/mtd$syscfg_part
ubiattach -m $syscfg_part
ubimkvol /dev/ubi1 -n 0 -N syscfg -t dynamic --maxavsize
fi
mkdir /tmp/syscfg
mount -t ubifs ubi1:syscfg /tmp/syscfg
[ -f /tmp/syscfg/sysupgrade.tgz ] && {
echo "- config restore -"
cd /
mv /tmp/syscfg/sysupgrade.tgz /tmp
tar xzf /tmp/sysupgrade.tgz
rm -f /tmp/sysupgrade.tgz
sync
}
;;
esac
}
boot_hook_add preinit_main preinit_mount_syscfg