summaryrefslogtreecommitdiff
path: root/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg
blob: 54aff7dbcc8206a00151d031fcf38626ce8e3b5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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