extended command script waits for the sd card device

This commit is contained in:
Koushik K. Dutta 2010-03-08 19:22:41 -08:00
parent 85c2a5386b
commit 3a25cf553d
2 changed files with 15 additions and 1 deletions

View File

@ -25,7 +25,7 @@ LOCAL_MODULE := recovery
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.

View File

@ -457,6 +457,20 @@ int run_script(char* filename)
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;