ors: Implement 'twrp format data' to format the data partition
Change-Id: Ic01685602a47d0b468616e3d5c3f26a44313cdc8 (cherry picked from commit 3b3bd12be11bd859a5f65bb1e8c71136044b3ad3)
This commit is contained in:
@@ -165,6 +165,14 @@ int OpenRecoveryScript::run_script_file(void) {
|
||||
LOGERR("Error with wipe command value: '%s'\n", value);
|
||||
ret_val = 1;
|
||||
}
|
||||
} else if (strcmp(command, "format") == 0) {
|
||||
// Format
|
||||
if (strcmp(value, "data") == 0 || strcmp(value, "/data") == 0 || strcmp(value, "factory") == 0 || strcmp(value, "factoryreset") == 0) {
|
||||
PartitionManager.Format_Data();
|
||||
} else {
|
||||
LOGERR("Error with format command value: '%s'\n", value);
|
||||
ret_val = 1;
|
||||
}
|
||||
} else if (strcmp(command, "backup") == 0) {
|
||||
// Backup
|
||||
DataManager::SetValue("tw_action_text2", gui_parse_text("{@backing}"));
|
||||
|
||||
@@ -43,6 +43,7 @@ void print_usage(void) {
|
||||
printf(" backup <SDCRBAEM> [backupname]\n");
|
||||
printf(" restore <SDCRBAEM> [backupname]\n");
|
||||
printf(" wipe <partition name>\n");
|
||||
printf(" format data\n");
|
||||
printf(" sideload\n");
|
||||
printf(" set <variable> [value]\n");
|
||||
printf(" decrypt <password> [USER ID]\n");
|
||||
|
||||
Reference in New Issue
Block a user