extended command script waits for the sd card device
diff --git a/Android.mk b/Android.mk
index 6c11018..b596941 100644
--- a/Android.mk
+++ b/Android.mk
@@ -25,7 +25,7 @@
LOCAL_FORCE_STATIC_EXECUTABLE := true
-RECOVERY_API_VERSION := 1.6.1
+RECOVERY_API_VERSION := 1.6.3
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
# This binary is in the recovery ramdisk, which is otherwise a copy of root.
diff --git a/extendedcommands.c b/extendedcommands.c
index 6a00cd3..f38ffd0 100644
--- a/extendedcommands.c
+++ b/extendedcommands.c
@@ -457,6 +457,20 @@
int run_and_remove_extendedcommand()
{
+ int i = 0;
+ for (i = 20; i > 0; i--) {
+ ui_print("Waiting for SD Card to mount (%ds)\n", i);
+ if (ensure_root_path_mounted("SDCARD:") == 0) {
+ ui_print("SD Card mounted...\n");
+ break;
+ }
+ sleep(1);
+ }
+ if (i == 0) {
+ ui_print("Timed out waiting for SD card... continuing anyways.");
+ }
+
+
int ret = run_script(EXTENDEDCOMMAND_SCRIPT);
remove(EXTENDEDCOMMAND_SCRIPT);
return ret;