Improve robustness of mount-data script
#!/bin/sh
MOUNTED=`mount | grep mmcblk0p4`
if [ "$MOUNTED" != "" ]; then
+ echo "already mounted"
exit
fi
@@ -11,3 +12,16 @@ else
fsck -p -y /dev/mmcblk0p4
fi
mount /data
+
+RES=$?
+
+if [ "$RES" != 0 ]; then
+ # it might have been mounted already in parallel
+ sleep 5
+ MOUNTED=`mount | grep mmcblk0p4`
+ if [ "$MOUNTED" != "" ]; then
+ echo "already mounted"
+ exit
+ fi
+fi
+
