fs_mgr: call format_f2fs correctly with -f
This patch formats f2fs with -f option.
Change-Id: I3fc415f35d81f22cbf1eadebc619465d36205927
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
diff --git a/fs_mgr/fs_mgr_format.cpp b/fs_mgr/fs_mgr_format.cpp
index 5705f93..a03d92c 100644
--- a/fs_mgr/fs_mgr_format.cpp
+++ b/fs_mgr/fs_mgr_format.cpp
@@ -86,13 +86,15 @@
static int format_f2fs(char *fs_blkdev)
{
- char * args[3];
+ char * args[5];
int pid;
int rc = 0;
- args[0] = (char *)"/sbin/mkfs.f2fs";
- args[1] = fs_blkdev;
- args[2] = (char *)0;
+ args[0] = (char *)"/system/bin/make_f2fs";
+ args[1] = (char *)"-f";
+ args[2] = (char *)"-O encrypt";
+ args[3] = fs_blkdev;
+ args[4] = (char *)0;
pid = fork();
if (pid < 0) {
@@ -100,7 +102,7 @@
}
if (!pid) {
/* This doesn't return */
- execv("/sbin/mkfs.f2fs", args);
+ execv(args[0], args);
exit(1);
}
for(;;) {