From dcf9d0c1989a4962285d04602290e4507fa4bde9 Mon Sep 17 00:00:00 2001 From: cronyx Date: Mon, 11 Jul 2022 23:35:37 +0300 Subject: [PATCH] warning if mount is failing after formatting --- general/overlay/init | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/general/overlay/init b/general/overlay/init index b293f766..7339dd7b 100755 --- a/general/overlay/init +++ b/general/overlay/init @@ -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