summaryrefslogtreecommitdiffstats
path: root/partition.cpp
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2012-10-14 04:07:49 +0200
committerDees_Troy <dees_troy@teamw.in>2012-10-14 04:07:49 +0200
commit8e337f36052469040d20d3322599cc4e25391480 (patch)
tree766d70c3cb9555133a3f5a3ea73742ab50f4af6b /partition.cpp
parentRemove unneeded duplicate code (diff)
downloadandroid_bootable_recovery-8e337f36052469040d20d3322599cc4e25391480.tar
android_bootable_recovery-8e337f36052469040d20d3322599cc4e25391480.tar.gz
android_bootable_recovery-8e337f36052469040d20d3322599cc4e25391480.tar.bz2
android_bootable_recovery-8e337f36052469040d20d3322599cc4e25391480.tar.lz
android_bootable_recovery-8e337f36052469040d20d3322599cc4e25391480.tar.xz
android_bootable_recovery-8e337f36052469040d20d3322599cc4e25391480.tar.zst
android_bootable_recovery-8e337f36052469040d20d3322599cc4e25391480.zip
Diffstat (limited to 'partition.cpp')
-rw-r--r--partition.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/partition.cpp b/partition.cpp
index 505e310c5..a7adf9984 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -249,6 +249,7 @@ bool TWPartition::Process_Fstab_Line(string Line, bool Display_Error) {
Removable = true;
#ifndef RECOVERY_SDCARD_ON_DATA
Setup_AndSec();
+ Mount_Storage_Retry();
#endif
}
#endif
@@ -258,6 +259,7 @@ bool TWPartition::Process_Fstab_Line(string Line, bool Display_Error) {
Storage_Path = EXPAND(TW_INTERNAL_STORAGE_PATH);
#ifndef RECOVERY_SDCARD_ON_DATA
Setup_AndSec();
+ Mount_Storage_Retry();
#endif
}
#else
@@ -266,6 +268,7 @@ bool TWPartition::Process_Fstab_Line(string Line, bool Display_Error) {
Storage_Path = "/emmc";
#ifndef RECOVERY_SDCARD_ON_DATA
Setup_AndSec();
+ Mount_Storage_Retry();
#endif
}
#endif
@@ -444,6 +447,18 @@ void TWPartition::Find_Real_Block_Device(string& Block, bool Display_Error) {
}
}
+void TWPartition::Mount_Storage_Retry(void) {
+ // On some devices, storage doesn't want to mount right away, retry and sleep
+ if (!Mount(false)) {
+ int retry_count = 5;
+ while (retry_count > 0 && !Mount(false)) {
+ usleep(500000);
+ retry_count--;
+ }
+ Mount(true);
+ }
+}
+
bool TWPartition::Find_MTD_Block_Device(string MTD_Name) {
FILE *fp = NULL;
char line[255];