Skip to content

Commit

Permalink
Allow wiping f2fs to reserve space for a crypto footer
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dhacker29 authored and Dees-Troy committed Feb 2, 2015
1 parent 1b03920 commit a3fa75f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit a3fa75f

Please sign in to comment.