diff options
author | Imre Kaloz <kaloz@openwrt.org> | 2015-04-12 08:35:33 +0000 |
---|---|---|
committer | Imre Kaloz <kaloz@openwrt.org> | 2015-04-12 08:35:33 +0000 |
commit | a62fa2d36554600a1eb828c51aa0a7e5e47e7adc (patch) | |
tree | b18e35553eba732920e9bd49e13933d7d274b581 /target/linux/mvebu/base-files/lib | |
parent | 1a797043e50d1fa047ca6037a41df50d36e17c07 (diff) | |
download | mtk-20170518-a62fa2d36554600a1eb828c51aa0a7e5e47e7adc.zip mtk-20170518-a62fa2d36554600a1eb828c51aa0a7e5e47e7adc.tar.gz mtk-20170518-a62fa2d36554600a1eb828c51aa0a7e5e47e7adc.tar.bz2 |
mvebu: reformat the damaged syscfg partition on the mamba
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
SVN-Revision: 45386
Diffstat (limited to 'target/linux/mvebu/base-files/lib')
-rw-r--r-- | target/linux/mvebu/base-files/lib/preinit/81_linksys_syscfg | 11 |
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 54aff7d..fdd0d1e 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 -" |