2 # Copyright (C) 2014 OpenWrt.org
5 preinit_mount_syscfg() {
10 case $(mvebu_board_name) in
13 ubiattach -m 8 || needs_recovery=1
14 if [ $needs_recovery -eq 1 ]
16 echo "ubifs syscfg partition is damaged, reformatting"
18 ubiformat -y -O 2048 -q /dev/mtd8
20 ubimkvol /dev/ubi1 -n 0 -N syscfg -t dynamic --maxavsize
23 mount -t ubifs ubi1:syscfg /tmp/syscfg
24 [ -f /tmp/syscfg/sysupgrade.tgz ] && {
25 echo "- config restore -"
27 mv /tmp/syscfg/sysupgrade.tgz /tmp
28 tar xzf /tmp/sysupgrade.tgz
29 rm -f /tmp/sysupgrade.tgz
36 boot_hook_add preinit_main preinit_mount_syscfg