summaryrefslogtreecommitdiff
path: root/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg
diff options
context:
space:
mode:
authorImre Kaloz <kaloz@openwrt.org>2014-07-13 22:12:56 +0000
committerImre Kaloz <kaloz@openwrt.org>2014-07-13 22:12:56 +0000
commit81d85a717ad9f0765d56be21953ead02a5a1ab52 (patch)
tree1961bb93694137cc90695673e16b114b6584d97a /target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg
parent88121f229c1399c0ad23a94c09094a714eb7a8a2 (diff)
downloadmtk-20170518-81d85a717ad9f0765d56be21953ead02a5a1ab52.zip
mtk-20170518-81d85a717ad9f0765d56be21953ead02a5a1ab52.tar.gz
mtk-20170518-81d85a717ad9f0765d56be21953ead02a5a1ab52.tar.bz2
add sysupgrade support
Signed-off-by: Imre Kaloz <kaloz@openwrt.org> SVN-Revision: 41630
Diffstat (limited to 'target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg')
-rw-r--r--target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg27
1 files changed, 27 insertions, 0 deletions
diff --git a/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg b/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg
new file mode 100644
index 0000000..54aff7d
--- /dev/null
+++ b/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg
@@ -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