fastboot: make_f2fs call by linux/darwin
Bug: 69298953
Change-Id: I6a7483e8617b649666247c4ca985384d086f15f8
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
diff --git a/fastboot/fs.cpp b/fastboot/fs.cpp
index 8877b09..4141a3b 100644
--- a/fastboot/fs.cpp
+++ b/fastboot/fs.cpp
@@ -154,10 +154,10 @@
return 0;
}
-#ifdef USE_F2FS
static int generate_f2fs_image(const char* fileName, long long partSize, const std::string& initial_dir,
unsigned /* unused */, unsigned /* unused */)
{
+#ifndef WIN32
const std::string exec_dir = android::base::GetExecutableDirectory();
const std::string mkf2fs_path = exec_dir + "/make_f2fs";
std::vector<const char*> mkf2fs_args = {mkf2fs_path.c_str()};
@@ -180,12 +180,15 @@
}
if (!initial_dir.empty()) {
- fprintf(stderr, "Unable to set initial directory on F2FS filesystem: %s\n", strerror(errno));
- return -1;
+ fprintf(stderr, "sload.f2s not supported yet\n");
+ return 0;
}
return 0;
-}
+#else
+ fprintf(stderr, "make_f2fs not supported on Windows\n");
+ return -1;
#endif
+}
static const struct fs_generator {
const char* fs_type; //must match what fastboot reports for partition type
@@ -196,9 +199,7 @@
} generators[] = {
{ "ext4", generate_ext4_image},
-#ifdef USE_F2FS
{ "f2fs", generate_f2fs_image},
-#endif
};
const struct fs_generator* fs_get_generator(const std::string& fs_type) {