Archived
1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
archive/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg
Imre Kaloz 59f81354b4 mvebu: add support for the Linksys WRT1900ACS (Shelby)
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>



SVN-Revision: 47164
2015-10-08 10:01:30 +00:00

37 lines
830 B
Plaintext

#
# Copyright (C) 2014 OpenWrt.org
#
preinit_mount_syscfg() {
. /lib/functions.sh
. /lib/mvebu.sh
case $(mvebu_board_name) in
armada-385-linksys-caiman|armada-385-linksys-cobra|armada-385-linksys-shelby|armada-xp-linksys-mamba)
needs_recovery=0
ubiattach -m 8 || needs_recovery=1
if [ $needs_recovery -eq 1 ]
then
echo "ubifs syscfg partition is damaged, reformatting"
ubidetach -m 8
ubiformat -y -O 2048 -q /dev/mtd8
ubiattach -m 8
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