aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorImre Kaloz <kaloz@openwrt.org>2015-04-12 08:35:33 +0000
committerImre Kaloz <kaloz@openwrt.org>2015-04-12 08:35:33 +0000
commitd6e3b008b89efd7993da283da70ce2e04f7a25fa (patch)
tree4beb5e74f93ca596477ada9b2751808f29142a84 /target
parent088f959729a66daf214f7fb5aa7154e7f2610ebe (diff)
downloadupstream-d6e3b008b89efd7993da283da70ce2e04f7a25fa.tar.gz
upstream-d6e3b008b89efd7993da283da70ce2e04f7a25fa.tar.bz2
upstream-d6e3b008b89efd7993da283da70ce2e04f7a25fa.zip
mvebu: reformat the damaged syscfg partition on the mamba
Signed-off-by: Imre Kaloz <kaloz@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45386 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg11
1 files changed, 10 insertions, 1 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
index 54aff7dbcc..fdd0d1e669 100644
--- a/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg
+++ b/target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg
@@ -9,8 +9,17 @@ preinit_mount_syscfg() {
case $(mvebu_board_name) in
armada-xp-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
- ubiattach -p /dev/mtd8
mount -t ubifs ubi1:syscfg /tmp/syscfg
[ -f /tmp/syscfg/sysupgrade.tgz ] && {
echo "- config restore -"