Skip to content

Commit

Permalink
ors: Implement 'twrp format data' to format the data partition
Browse files Browse the repository at this point in the history
Change-Id: Ic01685602a47d0b468616e3d5c3f26a44313cdc8
(cherry picked from commit 3b3bd12be11bd859a5f65bb1e8c71136044b3ad3)
  • Loading branch information
AdrianDC authored and bigbiff committed Mar 4, 2021
1 parent ef7768e commit f7a54e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions openrecoveryscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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}"));
Expand Down
1 change: 1 addition & 0 deletions orscmd/orscmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit f7a54e5

Please sign in to comment.