mvebu: reformat the damaged syscfg partition on the mamba

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>

SVN-Revision: 45386
This commit is contained in:
Imre Kaloz 2015-04-12 08:35:33 +00:00
parent 1a797043e5
commit a62fa2d365

View file

@ -9,8 +9,17 @@ preinit_mount_syscfg() {
case $(mvebu_board_name) in case $(mvebu_board_name) in
armada-xp-mamba) 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 mkdir /tmp/syscfg
ubiattach -p /dev/mtd8
mount -t ubifs ubi1:syscfg /tmp/syscfg mount -t ubifs ubi1:syscfg /tmp/syscfg
[ -f /tmp/syscfg/sysupgrade.tgz ] && { [ -f /tmp/syscfg/sysupgrade.tgz ] && {
echo "- config restore -" echo "- config restore -"