summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscript/run-factory-reset.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/script/run-factory-reset.sh b/script/run-factory-reset.sh
index 800a413..5486906 100755
--- a/script/run-factory-reset.sh
+++ b/script/run-factory-reset.sh
@@ -125,7 +125,8 @@ fs_ready() {
/bin/mkdir -p $USRDATADIR
/bin/mount $USRDATADIR
mret=`/bin/grep "$USRDATADIR " /proc/mounts | /usr/bin/awk '{print $1}'`
- device=`/bin/grep "$USRDATADIR" /etc/fstab | /usr/bin/awk '{print $1}'`
+ #device=`/bin/grep "$USRDATADIR" /etc/fstab | /usr/bin/awk '{print $1}'`
+ device=`blkid --match-token PARTLABEL=user -o device`
device=`/usr/bin/readlink -f $device`
if [[ "z$mret" != "z" && "$mret" != "$device" ]]; then
echo "$mret != $device" >> $logfile
@@ -136,6 +137,7 @@ fs_ready() {
# mount failed. format and remount
echo "$USRDATADIR mount failed. format and retry to mount again" >> $logfile
fstype=`/bin/grep "$USRDATADIR " /etc/fstab | /usr/bin/awk '{print $3}'`
+ fstype=`blkid --match-token PARTLABEL=user -o device`
/sbin/mkfs.$fstype $device -F
/bin/mount -t $fstype $device $USRDATADIR
fi