extended command script waits for the sd card device
This commit is contained in:
parent
85c2a5386b
commit
3a25cf553d
@ -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.
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user