Initial f2fs support

Need to add this to your source tree:
https://github.com/razrqcom-dev-team/android_external_f2fs-tools

Change-Id: I3ee9ebbb617259655518f8ea356ce7b8c246cd4d
This commit is contained in:
Dees_Troy
2013-08-29 16:38:55 +00:00
parent 329383e593
commit e5017045b5
3 changed files with 35 additions and 0 deletions
+29
View File
@@ -500,6 +500,7 @@ bool TWPartition::Is_File_System(string File_System) {
File_System == "ntfs" ||
File_System == "yaffs2" ||
File_System == "exfat" ||
File_System == "f2fs" ||
File_System == "auto")
return true;
else
@@ -1005,6 +1006,8 @@ bool TWPartition::Wipe(string New_File_System) {
wiped = Wipe_EXFAT();
else if (New_File_System == "yaffs2")
wiped = Wipe_MTD();
else if (New_File_System == "f2fs")
wiped = Wipe_F2FS();
else {
LOGERR("Unable to wipe '%s' -- unknown file system '%s'\n", Mount_Point.c_str(), New_File_System.c_str());
unlink("/.layout_version");
@@ -1398,6 +1401,32 @@ bool TWPartition::Wipe_RMRF() {
return true;
}
bool TWPartition::Wipe_F2FS() {
string command, result;
if (TWFunc::Path_Exists("/sbin/mkfs.f2fs")) {
if (!UnMount(true))
return false;
gui_print("Formatting %s using mkfs.f2fs...\n", Display_Name.c_str());
Find_Actual_Block_Device();
command = "mkfs.f2fs " + Actual_Block_Device;
if (TWFunc::Exec_Cmd(command, result) == 0) {
Recreate_AndSec_Folder();
gui_print("Done.\n");
return true;
} else {
LOGERR("Unable to wipe '%s'.\n", Mount_Point.c_str());
return false;
}
return true;
} else {
gui_print("mkfs.f2fs binary not found, using rm -rf to wipe.\n");
return Wipe_RMRF();
}
return false;
}
bool TWPartition::Wipe_Data_Without_Wiping_Media() {
string dir;