~aleteoryx/muditaos

66034c911dce57601f84136f8cf9620dd44f2036 — Lucjan Bryndza 5 years ago 486d21a
[EGD-4298] Detect RO filesystem with errors (#963)

Linux remount filesystem in RO mode when errors
are detected on disk. Flash script detect mounting
filesystem as read only and suggest to user commnand
how to fix the VFS errors.

Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
1 files changed, 12 insertions(+), 0 deletions(-)

M flash_eMMC.sh
M flash_eMMC.sh => flash_eMMC.sh +12 -0
@@ 40,6 40,18 @@ if [ $? -ne 0 ]; then
	>&2 echo "PurePhone not mounted. Mount or retry with Ozone. https://github.com/muditacom/PurePhone/blob/master/doc/running_on_phone.md#eMMC_upload"
	exit 2
fi
grep "[[:space:]]ro[[:space:],]" <<< $MOUNT_ENTRY
if [ $? -eq 0 ]; then
	>&2 echo "PurePhone mounted in readonly mode please unmount fs and check disc with command"
	>&2 echo "sudo fsck.vfat -a $(awk '{ print $1 }' <<< $MOUNT_ENTRY)"
	exit 3
fi
grep "[[:space:]]ro[[:space:],]" <<< $MOUNT_ENTRY_RECOVER
if [ $? -eq 0 ]; then
	>&2 echo "PurePhone mounted in readonly mode please unmount fs and check disc with command"
	>&2 echo "sudo fsck.vfat -a $(awk '{ print $1 }' <<< $MOUNT_ENTRY_RECOVER)"
	exit 4
fi

MUDITAOS_PATH=$(echo $MOUNT_ENTRY | awk -F " " '{print $2}')
# unespace