From 8d9b6ee6218b38fbb629df9ee0fdf9a8249394bb Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Wed, 15 Nov 2017 10:55:07 -0800 Subject: [PATCH] fastboot: make_f2fs call by linux/darwin Bug: 69298953 Change-Id: I6a7483e8617b649666247c4ca985384d086f15f8 Signed-off-by: Jaegeuk Kim --- fastboot/Android.mk | 5 ++--- fastboot/fs.cpp | 13 +++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fastboot/Android.mk b/fastboot/Android.mk index 7723ec678..b0b23379a 100644 --- a/fastboot/Android.mk +++ b/fastboot/Android.mk @@ -39,7 +39,7 @@ LOCAL_MODULE := fastboot LOCAL_MODULE_TAGS := debug LOCAL_MODULE_HOST_OS := darwin linux windows LOCAL_CFLAGS += -Wall -Wextra -Werror -Wunreachable-code -LOCAL_REQUIRED_MODULES := mke2fs e2fsdroid +LOCAL_REQUIRED_MODULES := mke2fs e2fsdroid make_f2fs LOCAL_SRC_FILES_linux := usb_linux.cpp LOCAL_STATIC_LIBRARIES_linux := libselinux @@ -66,8 +66,6 @@ LOCAL_STATIC_LIBRARIES := \ libcutils \ libgtest_host \ -LOCAL_CFLAGS_linux := -DUSE_F2FS - LOCAL_CXX_STL := libc++_static # Don't add anything here, we don't want additional shared dependencies @@ -80,6 +78,7 @@ include $(BUILD_HOST_EXECUTABLE) my_dist_files := $(LOCAL_BUILT_MODULE) my_dist_files += $(HOST_OUT_EXECUTABLES)/mke2fs$(HOST_EXECUTABLE_SUFFIX) my_dist_files += $(HOST_OUT_EXECUTABLES)/e2fsdroid$(HOST_EXECUTABLE_SUFFIX) +my_dist_files += $(HOST_OUT_EXECUTABLES)/make_f2fs$(HOST_EXECUTABLE_SUFFIX) $(call dist-for-goals,dist_files sdk win_sdk,$(my_dist_files)) ifdef HOST_CROSS_OS # Archive fastboot.exe for win_sdk build. diff --git a/fastboot/fs.cpp b/fastboot/fs.cpp index 8877b09b7..4141a3bea 100644 --- a/fastboot/fs.cpp +++ b/fastboot/fs.cpp @@ -154,10 +154,10 @@ static int generate_ext4_image(const char* fileName, long long partSize, 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 mkf2fs_args = {mkf2fs_path.c_str()}; @@ -180,12 +180,15 @@ static int generate_f2fs_image(const char* fileName, long long partSize, const s } 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 @@ static const struct fs_generator { } 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) {