Skip to content

Commit

Permalink
Add f2fs shared library
Browse files Browse the repository at this point in the history
Signed-off-by: Shaka Huang <[email protected]>
  • Loading branch information
shakalaca committed Mar 2, 2017
1 parent ba46f90 commit a23e7e3
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 4 deletions.
1 change: 1 addition & 0 deletions 01_getsource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ clone external/gtest
clone external/libselinux
clone external/pcre
clone external/f2fs-tools
clone external/e2fsprogs

git clone https://boringssl.googlesource.com/boringssl src/boringssl

Expand Down
13 changes: 9 additions & 4 deletions Android_fastboot.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ LOCAL_MODULE := fastboot
LOCAL_CFLAGS := \
-DANDROID_HOST_BUILD -DADB_HOST \
-Wall -Wextra -Werror -Wunreachable-code \
-DFASTBOOT_REVISION='"shakalaca-$(shell date +%Y-%m-%d)-$(fastboot_version)"' \
-DUSE_F2FS
-DFASTBOOT_REVISION='"shakalaca-$(shell date +%Y-%m-%d)-$(fastboot_version)"'

LOCAL_C_INCLUDES := \
src/system/core/include \
src/system/core/adb \
src/system/core/mkbootimg \
src/system/extras/f2fs_utils \
src/external/gtest/include

LOCAL_SRC_FILES := \
Expand Down Expand Up @@ -43,9 +43,14 @@ LOCAL_SRC_FILES += \
LOCAL_SRC_FILES += \
src/system/core/adb/diagnose_usb.cpp

LOCAL_LDFLAGS := -ldl -rdynamic -Wl,-rpath,.
LOCAL_LDLIBS += -lz
LOCAL_STATIC_LIBRARIES := selinux ext4_utils f2fs_utils sparse base cutils log_fake
LOCAL_STATIC_LIBRARIES := selinux ext4_utils sparse base cutils log_fake

ifeq ($(SUPPORT_F2FS),yes)
LOCAL_CFLAGS += -DUSE_F2FS
LOCAL_LDFLAGS := -ldl -rdynamic
LOCAL_STATIC_LIBRARIES += f2fs_utils f2fs_fmt_host_dyn
endif

include $(BUILD_EXECUTABLE)

Expand Down
90 changes: 90 additions & 0 deletions Android_library.mk
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,95 @@ LOCAL_STATIC_LIBRARIES := selinux sparse

include $(BUILD_STATIC_LIBRARY)

ifeq ($(SUPPORT_F2FS),yes)
##############################################################################
# libext2_uuid
##############################################################################
include $(CLEAR_VARS)

LOCAL_MODULE := libext2_uuid

LOCAL_SRC_FILES := \
src/external/e2fsprogs/lib/uuid/clear.c \
src/external/e2fsprogs/lib/uuid/compare.c \
src/external/e2fsprogs/lib/uuid/copy.c \
src/external/e2fsprogs/lib/uuid/gen_uuid.c \
src/external/e2fsprogs/lib/uuid/isnull.c \
src/external/e2fsprogs/lib/uuid/pack.c \
src/external/e2fsprogs/lib/uuid/parse.c \
src/external/e2fsprogs/lib/uuid/unpack.c \
src/external/e2fsprogs/lib/uuid/unparse.c \
src/external/e2fsprogs/lib/uuid/uuid_time.c

LOCAL_C_INCLUDES := \
src/external/e2fsprogs/lib

LOCAL_EXPORT_C_INCLUDES := \
src/external/e2fsprogs/lib \
src/external/e2fsprogs

LOCAL_CFLAGS := -O2 -g -W -Wall \
-Wno-unused-parameter \
-Wno-unused-function \
-DHAVE_INTTYPES_H \
-DHAVE_UNISTD_H \
-DHAVE_ERRNO_H \
-DHAVE_NETINET_IN_H \
-DHAVE_SYS_IOCTL_H \
-DHAVE_SYS_MMAN_H \
-DHAVE_SYS_MOUNT_H \
-DHAVE_SYS_PRCTL_H \
-DHAVE_SYS_RESOURCE_H \
-DHAVE_SYS_SELECT_H \
-DHAVE_SYS_STAT_H \
-DHAVE_SYS_TYPES_H \
-DHAVE_STDLIB_H \
-DHAVE_STRDUP \
-DHAVE_MMAP \
-DHAVE_UTIME_H \
-DHAVE_GETPAGESIZE \
-DHAVE_LSEEK64 \
-DHAVE_LSEEK64_PROTOTYPE \
-DHAVE_EXT2_IOCTLS \
-DHAVE_LINUX_FD_H \
-DHAVE_TYPE_SSIZE_T \
-DHAVE_SYS_TIME_H \
-DHAVE_SYS_PARAM_H \
-DHAVE_SYSCONF

include $(BUILD_STATIC_LIBRARY)

##############################################################################
# libf2fs_fmt_host_dyn
##############################################################################
include $(CLEAR_VARS)

LOCAL_MODULE := libf2fs_fmt_host_dyn

LOCAL_CFLAGS := \
-DF2FS_MAJOR_VERSION=1 \
-DF2FS_MINOR_VERSION=4 \
-DF2FS_TOOLS_VERSION=\"1.4.0\" \
-DF2FS_TOOLS_DATE=\"2014-10-18\"

LOCAL_C_INCLUDES := \
src/external/f2fs-tools/include \
src/external/f2fs-tools/mkfs

LOCAL_EXPORT_C_INCLUDES := \
src/external/f2fs-tools/include \
src/external/f2fs-tools/mkfs

LOCAL_SRC_FILES := \
src/external/f2fs-tools/lib/libf2fs.c \
src/external/f2fs-tools/mkfs/f2fs_format.c \
src/system/extras/f2fs_utils/f2fs_ioutils.c

LOCAL_LDLIBS := -lz
LOCAL_STATIC_LIBRARIES := ext2_uuid sparse selinux

include $(BUILD_SHARED_LIBRARY)

##############################################################################
# libf2fs_utils
##############################################################################
Expand All @@ -158,6 +247,7 @@ LOCAL_SRC_FILES += \
LOCAL_STATIC_LIBRARIES := selinux sparse

include $(BUILD_STATIC_LIBRARY)
endif # SUPPORT_F2FS

##############################################################################
# liblog
Expand Down

0 comments on commit a23e7e3

Please sign in to comment.