add sysupgrade support

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>

SVN-Revision: 41630
This commit is contained in:
Imre Kaloz
2014-07-13 22:12:56 +00:00
parent 88121f229c
commit 81d85a717a
3 changed files with 131 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
#
# Copyright (C) 2014 OpenWrt.org
#
preinit_mount_syscfg() {
. /lib/functions.sh
. /lib/mvebu.sh
case $(mvebu_board_name) in
armada-xp-mamba)
mkdir /tmp/syscfg
ubiattach -p /dev/mtd8
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