warning if mount is failing after formatting

pull/262/head
cronyx 2022-07-11 23:35:37 +03:00
parent 3d9984afe5
commit dcf9d0c198
1 changed files with 7 additions and 1 deletions

View File

@ -21,7 +21,13 @@ else
if [ $? -ne 0 ] || { dmesg | grep "jffs2.*: Magic bitmask.*not found" > /dev/null 2>&1; } then
echo "jffs2 health check error, format required!"
flash_eraseall -j /dev/${mtdchrdev}
mount -t jffs2 /dev/${mtdblkdev} /overlay || mount -t tmpfs tmpfs /overlay || exit
echo "Done! Remounting..."
mount -t jffs2 /dev/${mtdblkdev} /overlay || mount -t tmpfs tmpfs /overlay || exit
if ! cat /etc/mtab | grep ${mtdblkdev}; then
echo "--------------------------------"
echo "Crash - your flash in the trash!"
echo "--------------------------------"
fi
fi
fi