Allow wiping f2fs to reserve space for a crypto footer

We will convert a -16384 to 16384 if needed because mkfs.f2fs
does not like negative numbers like make_ext4fs does. Also enable
trim by default on f2fs.

Change-Id: I8b41e65d1ff894433665c65d0569a51803c67891
This commit is contained in:
dhacker29
2015-01-17 19:42:33 -05:00
committed by Ethan Yonker
parent 1b03920ca7
commit a3fa75fd66
+12 -1
View File
@@ -1642,7 +1642,18 @@ bool TWPartition::Wipe_F2FS() {
gui_print("Formatting %s using mkfs.f2fs...\n", Display_Name.c_str());
Find_Actual_Block_Device();
command = "mkfs.f2fs " + Actual_Block_Device;
command = "mkfs.f2fs -t 1";
if (!Is_Decrypted && Length != 0) {
// Only use length if we're not decrypted
char len[32];
int mod_length = Length;
if (Length < 0)
mod_length *= -1;
sprintf(len, "%i", mod_length);
command += " -r ";
command += len;
}
command += " " + Actual_Block_Device;
if (TWFunc::Exec_Cmd(command) == 0) {
Recreate_AndSec_Folder();
gui_print("Done.\n");