From 018ef1be61e749d0fbe0f05179a4f0f9b858ae57 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 5 Oct 2016 12:44:18 -0700 Subject: [PATCH] ext4_utils: Export headers for libext4_utils* libs. So we can do "#include " without adding "LOCAL_C_INCLUDES += system/extras/ext4_utils". Also clean up the #include lines in system/extras/ext4_utils/. Test: `m checkbuild` works. Change-Id: I3c8b07c9b6f5996160e0cb6d9d069579b1609f60 --- ext4_utils/Android.mk | 31 ++++++++++++++++++---- ext4_utils/allocate.c | 7 ++--- ext4_utils/allocate.h | 2 +- ext4_utils/contents.c | 15 ++++++----- ext4_utils/contents.h | 2 ++ ext4_utils/crc16.c | 2 +- ext4_utils/ext2simg.c | 16 ++++++----- ext4_utils/ext4_crypt.cpp | 9 +++---- ext4_utils/ext4_crypt_init_extensions.cpp | 20 +++++++------- ext4_utils/ext4_sb.c | 2 +- ext4_utils/ext4_utils.c | 22 ++++++++------- ext4_utils/ext4fixup.c | 17 +++++++----- ext4_utils/ext4fixup_main.c | 3 ++- ext4_utils/extent.c | 7 ++--- ext4_utils/extent.h | 6 +++-- ext4_utils/{ => include/ext4_utils}/ext4.h | 0 ext4_utils/{ => include/ext4_utils}/ext4_crypt.h | 5 ++++ .../ext4_utils}/ext4_crypt_init_extensions.h | 5 ++++ ext4_utils/{ => include/ext4_utils}/ext4_extents.h | 2 +- .../{ => include/ext4_utils}/ext4_kernel_headers.h | 8 +++--- ext4_utils/{ => include/ext4_utils}/ext4_sb.h | 2 +- ext4_utils/{ => include/ext4_utils}/ext4_utils.h | 0 ext4_utils/{ => include/ext4_utils}/jbd2.h | 0 ext4_utils/{ => include/ext4_utils}/key_control.h | 5 ++++ ext4_utils/{ => include/ext4_utils}/make_ext4fs.h | 0 ext4_utils/{ => include/ext4_utils}/wipe.h | 2 +- ext4_utils/{ => include/ext4_utils}/xattr.h | 0 ext4_utils/indirect.c | 10 ++++--- ext4_utils/indirect.h | 5 +++- ext4_utils/key_control.cpp | 2 +- ext4_utils/make_ext4fs.c | 19 ++++++++----- ext4_utils/make_ext4fs_main.c | 4 +-- ext4_utils/setup_fs.c | 3 ++- ext4_utils/wipe.c | 5 ++-- tests/fstest/Android.mk | 3 +-- tests/fstest/recovery_test.cpp | 4 +-- verity/Android.mk | 2 +- 37 files changed, 154 insertions(+), 93 deletions(-) rename ext4_utils/{ => include/ext4_utils}/ext4.h (100%) rename ext4_utils/{ => include/ext4_utils}/ext4_crypt.h (92%) rename ext4_utils/{ => include/ext4_utils}/ext4_crypt_init_extensions.h (89%) rename ext4_utils/{ => include/ext4_utils}/ext4_extents.h (98%) rename ext4_utils/{ => include/ext4_utils}/ext4_kernel_headers.h (90%) rename ext4_utils/{ => include/ext4_utils}/ext4_sb.h (97%) rename ext4_utils/{ => include/ext4_utils}/ext4_utils.h (100%) rename ext4_utils/{ => include/ext4_utils}/jbd2.h (100%) rename ext4_utils/{ => include/ext4_utils}/key_control.h (93%) rename ext4_utils/{ => include/ext4_utils}/make_ext4fs.h (100%) rename ext4_utils/{ => include/ext4_utils}/wipe.h (96%) rename ext4_utils/{ => include/ext4_utils}/xattr.h (100%) diff --git a/ext4_utils/Android.mk b/ext4_utils/Android.mk index a8362b22..16b73c4a 100644 --- a/ext4_utils/Android.mk +++ b/ext4_utils/Android.mk @@ -24,6 +24,10 @@ LOCAL_SRC_FILES := $(libext4_utils_src_files) LOCAL_MODULE := libext4_utils_host # Various instances of dereferencing a type-punned pointer in extent.c LOCAL_CFLAGS += -fno-strict-aliasing +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/include +LOCAL_EXPORT_C_INCLUDE_DIRS := \ + $(LOCAL_PATH)/include LOCAL_STATIC_LIBRARIES := \ libsparse_host \ libz @@ -36,6 +40,8 @@ include $(BUILD_HOST_STATIC_LIBRARY) include $(CLEAR_VARS) LOCAL_SRC_FILES := make_ext4fs_main.c LOCAL_MODULE := make_ext4fs +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/include LOCAL_SHARED_LIBRARIES += libcutils LOCAL_STATIC_LIBRARIES += \ libext4_utils_host \ @@ -48,10 +54,11 @@ LOCAL_CFLAGS_darwin := -DHOST LOCAL_CFLAGS_linux := -DHOST include $(BUILD_HOST_EXECUTABLE) + include $(CLEAR_VARS) LOCAL_SRC_FILES := blk_alloc_to_base_fs.c LOCAL_MODULE := blk_alloc_to_base_fs -LOCAL_SHARED_LIBRARIES += libcutils +LOCAL_SHARED_LIBRARIES := libcutils LOCAL_CFLAGS_darwin := -DHOST LOCAL_CFLAGS_linux := -DHOST include $(BUILD_HOST_EXECUTABLE) @@ -69,9 +76,14 @@ ifneq ($(HOST_OS),windows) include $(CLEAR_VARS) LOCAL_SRC_FILES := $(libext4_utils_src_files) LOCAL_MODULE := libext4_utils -LOCAL_C_INCLUDES += system/core/logwrapper/include +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/include \ + system/core/logwrapper/include # Various instances of dereferencing a type-punned pointer in extent.c LOCAL_CFLAGS += -fno-strict-aliasing +LOCAL_CFLAGS += -DREAL_UUID +LOCAL_EXPORT_C_INCLUDE_DIRS := \ + $(LOCAL_PATH)/include LOCAL_SHARED_LIBRARIES := \ libbase \ libcutils \ @@ -79,18 +91,21 @@ LOCAL_SHARED_LIBRARIES := \ libselinux \ libsparse \ libz -LOCAL_CFLAGS := -DREAL_UUID include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) -LOCAL_SRC_FILES := $(libext4_utils_src_files) \ +LOCAL_SRC_FILES := \ + $(libext4_utils_src_files) \ ext4_crypt_init_extensions.cpp LOCAL_MODULE := libext4_utils_static +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/include # Various instances of dereferencing a type-punned pointer in extent.c LOCAL_CFLAGS += -fno-strict-aliasing +LOCAL_EXPORT_C_INCLUDE_DIRS := \ + $(LOCAL_PATH)/include LOCAL_STATIC_LIBRARIES := \ - libbase \ liblogwrap \ libsparse_static \ libselinux \ @@ -101,6 +116,8 @@ include $(BUILD_STATIC_LIBRARY) include $(CLEAR_VARS) LOCAL_SRC_FILES := make_ext4fs_main.c LOCAL_MODULE := make_ext4fs +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/include LOCAL_SHARED_LIBRARIES := \ libcutils \ libext2_uuid \ @@ -114,6 +131,8 @@ include $(BUILD_EXECUTABLE) include $(CLEAR_VARS) LOCAL_SRC_FILES := ext2simg.c LOCAL_MODULE := ext2simg +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/include LOCAL_SHARED_LIBRARIES += \ libext4_utils \ libselinux \ @@ -125,6 +144,8 @@ include $(BUILD_EXECUTABLE) include $(CLEAR_VARS) LOCAL_SRC_FILES := ext2simg.c LOCAL_MODULE := ext2simg +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/include LOCAL_SHARED_LIBRARIES += \ libselinux LOCAL_STATIC_LIBRARIES += \ diff --git a/ext4_utils/allocate.c b/ext4_utils/allocate.c index 497f580e..6f5e4d32 100644 --- a/ext4_utils/allocate.c +++ b/ext4_utils/allocate.c @@ -14,14 +14,15 @@ * limitations under the License. */ -#include "ext4_utils.h" #include "allocate.h" -#include - #include #include +#include + +#include "ext4_utils/ext4_utils.h" + struct xattr_list_element { struct ext4_inode *inode; struct ext4_xattr_header *header; diff --git a/ext4_utils/allocate.h b/ext4_utils/allocate.h index 4a733d00..67af7c11 100644 --- a/ext4_utils/allocate.h +++ b/ext4_utils/allocate.h @@ -19,7 +19,7 @@ #define EXT4_ALLOCATE_FAILED (u32)(~0) -#include "ext4_utils.h" +#include "ext4_utils/ext4_utils.h" struct region { u32 block; diff --git a/ext4_utils/contents.c b/ext4_utils/contents.c index e66573e3..a2cd3b88 100644 --- a/ext4_utils/contents.c +++ b/ext4_utils/contents.c @@ -14,10 +14,18 @@ * limitations under the License. */ +#include "contents.h" + #include #include #include +#include "allocate.h" +#include "ext4_utils/ext4_utils.h" +#include "ext4_utils/make_ext4fs.h" +#include "extent.h" +#include "indirect.h" + #ifdef __ANDROID__ #include #else @@ -27,13 +35,6 @@ #define XATTR_SELINUX_SUFFIX "selinux" #define XATTR_CAPS_SUFFIX "capability" -#include "ext4_utils.h" -#include "make_ext4fs.h" -#include "allocate.h" -#include "contents.h" -#include "extent.h" -#include "indirect.h" - #ifdef _WIN32 #define S_IFLNK 0 /* used by make_link, not needed under mingw */ #endif diff --git a/ext4_utils/contents.h b/ext4_utils/contents.h index e57687e0..d4c87d85 100644 --- a/ext4_utils/contents.h +++ b/ext4_utils/contents.h @@ -17,6 +17,8 @@ #ifndef _DIRECTORY_H_ #define _DIRECTORY_H_ +#include "ext4_utils/ext4_utils.h" + struct dentry { char *path; char *full_path; diff --git a/ext4_utils/crc16.c b/ext4_utils/crc16.c index 25758121..d86dcb83 100644 --- a/ext4_utils/crc16.c +++ b/ext4_utils/crc16.c @@ -9,7 +9,7 @@ /* Converted to crc16 */ -#include "ext4_utils.h" +#include "ext4_utils/ext4_utils.h" static u16 crc16_tab[] = { 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, diff --git a/ext4_utils/ext2simg.c b/ext4_utils/ext2simg.c index f4672666..b1d06118 100644 --- a/ext4_utils/ext2simg.c +++ b/ext4_utils/ext2simg.c @@ -14,22 +14,26 @@ * limitations under the License. */ +#ifndef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 +#endif + +#ifndef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE 1 +#endif -#include -#include -#include -#include #include #include +#include +#include +#include #include #include -#include "ext4_utils.h" -#include "make_ext4fs.h" #include "allocate.h" +#include "ext4_utils/ext4_utils.h" +#include "ext4_utils/make_ext4fs.h" #if defined(__APPLE__) && defined(__MACH__) #define off64_t off_t diff --git a/ext4_utils/ext4_crypt.cpp b/ext4_utils/ext4_crypt.cpp index be77b791..4478904c 100644 --- a/ext4_utils/ext4_crypt.cpp +++ b/ext4_utils/ext4_crypt.cpp @@ -14,18 +14,17 @@ * limitations under the License. */ -#include "ext4_crypt.h" +#include "ext4_utils/ext4_crypt.h" +#include #include #include -#include -#include - #include -#include +#include #include #include #include +#include #include #include diff --git a/ext4_utils/ext4_crypt_init_extensions.cpp b/ext4_utils/ext4_crypt_init_extensions.cpp index 14e3d44a..3c2bc8e9 100644 --- a/ext4_utils/ext4_crypt_init_extensions.cpp +++ b/ext4_utils/ext4_crypt_init_extensions.cpp @@ -14,15 +14,7 @@ * limitations under the License. */ -#define TAG "ext4_utils" - -#include "ext4_crypt_init_extensions.h" -#include "ext4_crypt.h" - -#include - -#include -#include +#include "ext4_utils/ext4_crypt_init_extensions.h" #include #include @@ -30,15 +22,21 @@ #include #include +#include +#include + #include +#include #include - #include #include #include #include -#include "key_control.h" +#include "ext4_utils/ext4_crypt.h" +#include "ext4_utils/key_control.h" + +#define TAG "ext4_utils" static const std::string arbitrary_sequence_number = "42"; static const int vold_command_timeout_ms = 60 * 1000; diff --git a/ext4_utils/ext4_sb.c b/ext4_utils/ext4_sb.c index 7bbbcfe3..5c3e4f3f 100644 --- a/ext4_utils/ext4_sb.c +++ b/ext4_utils/ext4_sb.c @@ -16,7 +16,7 @@ #include -#include "ext4_sb.h" +#include "ext4_utils/ext4_sb.h" int ext4_parse_sb(struct ext4_super_block *sb, struct fs_info *info) { diff --git a/ext4_utils/ext4_utils.c b/ext4_utils/ext4_utils.c index f358960c..bfa57bc7 100644 --- a/ext4_utils/ext4_utils.c +++ b/ext4_utils/ext4_utils.c @@ -14,24 +14,26 @@ * limitations under the License. */ -#include "ext4_utils.h" +#include "ext4_utils/ext4_utils.h" + +#include +#include +#include +#include +#include +#include + +#include + #include "allocate.h" -#include "indirect.h" #include "extent.h" +#include "indirect.h" #include "sha1.h" -#include #ifdef REAL_UUID #include #endif -#include -#include -#include -#include -#include -#include - #ifdef _WIN32 #include #else diff --git a/ext4_utils/ext4fixup.c b/ext4_utils/ext4fixup.c index 09602b62..f9285d03 100644 --- a/ext4_utils/ext4fixup.c +++ b/ext4_utils/ext4fixup.c @@ -13,20 +13,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "ext4_utils.h" -#include "make_ext4fs.h" -#include "ext4_extents.h" -#include "allocate.h" + #include "ext4fixup.h" -#include +#define _LARGEFILE64_SOURCE -#include +#include #include #include -#include #include +#include + +#include "allocate.h" +#include "ext4_utils/ext4_extents.h" +#include "ext4_utils/ext4_utils.h" +#include "ext4_utils/make_ext4fs.h" + #ifndef _WIN32 #include #endif diff --git a/ext4_utils/ext4fixup_main.c b/ext4_utils/ext4fixup_main.c index 47c7e659..f4428cbf 100644 --- a/ext4_utils/ext4fixup_main.c +++ b/ext4_utils/ext4fixup_main.c @@ -14,10 +14,11 @@ * limitations under the License. */ -#include #include #include #include +#include + #include "ext4fixup.h" static void usage(char *me) diff --git a/ext4_utils/extent.c b/ext4_utils/extent.c index 78874882..ff56a141 100644 --- a/ext4_utils/extent.c +++ b/ext4_utils/extent.c @@ -14,15 +14,16 @@ * limitations under the License. */ -#include "ext4_utils.h" #include "extent.h" -#include - #include #include #include +#include + +#include "allocate.h" +#include "ext4_utils/ext4_utils.h" /* Creates data buffers for the first backing_len bytes of a block allocation and queues them to be written */ diff --git a/ext4_utils/extent.h b/ext4_utils/extent.h index a78a7b0a..44cee10b 100644 --- a/ext4_utils/extent.h +++ b/ext4_utils/extent.h @@ -17,8 +17,10 @@ #ifndef _EXTENT_H_ #define _EXTENT_H_ -#include "allocate.h" -#include "ext4_utils.h" +#include "ext4_utils/ext4_utils.h" + +struct ext4_inode; +struct block_allocation; void inode_allocate_extents(struct ext4_inode *inode, u64 len); struct block_allocation* inode_allocate_file_extents( diff --git a/ext4_utils/ext4.h b/ext4_utils/include/ext4_utils/ext4.h similarity index 100% rename from ext4_utils/ext4.h rename to ext4_utils/include/ext4_utils/ext4.h diff --git a/ext4_utils/ext4_crypt.h b/ext4_utils/include/ext4_utils/ext4_crypt.h similarity index 92% rename from ext4_utils/ext4_crypt.h rename to ext4_utils/include/ext4_utils/ext4_crypt.h index ddc09a71..d02ff813 100644 --- a/ext4_utils/ext4_crypt.h +++ b/ext4_utils/include/ext4_utils/ext4_crypt.h @@ -14,6 +14,9 @@ * limitations under the License. */ +#ifndef _EXT4_CRYPT_H_ +#define _EXT4_CRYPT_H_ + #include #include #include @@ -28,3 +31,5 @@ static const char* e4crypt_unencrypted_folder = "/unencrypted"; static const char* e4crypt_key_ref = "/unencrypted/ref"; __END_DECLS + +#endif // _EXT4_CRYPT_H_ diff --git a/ext4_utils/ext4_crypt_init_extensions.h b/ext4_utils/include/ext4_utils/ext4_crypt_init_extensions.h similarity index 89% rename from ext4_utils/ext4_crypt_init_extensions.h rename to ext4_utils/include/ext4_utils/ext4_crypt_init_extensions.h index 63f6d88c..2cf98de4 100644 --- a/ext4_utils/ext4_crypt_init_extensions.h +++ b/ext4_utils/include/ext4_utils/ext4_crypt_init_extensions.h @@ -14,6 +14,9 @@ * limitations under the License. */ +#ifndef _EXT4_CRYPT_INIT_EXTENSIONS_H_ +#define _EXT4_CRYPT_INIT_EXTENSIONS_H_ + #include #include #include @@ -29,3 +32,5 @@ int e4crypt_set_directory_policy(const char* path); int e4crypt_do_init_user0(); __END_DECLS + +#endif // _EXT4_CRYPT_INIT_EXTENSIONS_H_ diff --git a/ext4_utils/ext4_extents.h b/ext4_utils/include/ext4_utils/ext4_extents.h similarity index 98% rename from ext4_utils/ext4_extents.h rename to ext4_utils/include/ext4_utils/ext4_extents.h index b1290f4b..68fc4a45 100644 --- a/ext4_utils/ext4_extents.h +++ b/ext4_utils/include/ext4_utils/ext4_extents.h @@ -12,7 +12,7 @@ #ifndef _EXT4_EXTENTS #define _EXT4_EXTENTS -#include "ext4.h" +#include "ext4_utils/ext4.h" #define AGGRESSIVE_TEST_ diff --git a/ext4_utils/ext4_kernel_headers.h b/ext4_utils/include/ext4_utils/ext4_kernel_headers.h similarity index 90% rename from ext4_utils/ext4_kernel_headers.h rename to ext4_utils/include/ext4_utils/ext4_kernel_headers.h index 4b24dce4..ebdf202f 100644 --- a/ext4_utils/ext4_kernel_headers.h +++ b/ext4_utils/include/ext4_utils/ext4_kernel_headers.h @@ -36,10 +36,10 @@ #define __u8 uint8_t #endif -#include "ext4.h" -#include "xattr.h" -#include "ext4_extents.h" -#include "jbd2.h" +#include "ext4_utils/ext4.h" +#include "ext4_utils/ext4_extents.h" +#include "ext4_utils/jbd2.h" +#include "ext4_utils/xattr.h" #ifndef __BIONIC__ #undef __le64 diff --git a/ext4_utils/ext4_sb.h b/ext4_utils/include/ext4_utils/ext4_sb.h similarity index 97% rename from ext4_utils/ext4_sb.h rename to ext4_utils/include/ext4_utils/ext4_sb.h index 159580da..11b89715 100644 --- a/ext4_utils/ext4_sb.h +++ b/ext4_utils/include/ext4_utils/ext4_sb.h @@ -17,7 +17,7 @@ #ifndef _EXT4_UTILS_EXT4_SB_H_ #define _EXT4_UTILS_EXT4_SB_H_ -#include "ext4_kernel_headers.h" +#include "ext4_utils/ext4_kernel_headers.h" #define EXT4_SUPER_MAGIC 0xEF53 diff --git a/ext4_utils/ext4_utils.h b/ext4_utils/include/ext4_utils/ext4_utils.h similarity index 100% rename from ext4_utils/ext4_utils.h rename to ext4_utils/include/ext4_utils/ext4_utils.h diff --git a/ext4_utils/jbd2.h b/ext4_utils/include/ext4_utils/jbd2.h similarity index 100% rename from ext4_utils/jbd2.h rename to ext4_utils/include/ext4_utils/jbd2.h diff --git a/ext4_utils/key_control.h b/ext4_utils/include/ext4_utils/key_control.h similarity index 93% rename from ext4_utils/key_control.h rename to ext4_utils/include/ext4_utils/key_control.h index 748c32d1..fe6a6b5f 100644 --- a/ext4_utils/key_control.h +++ b/ext4_utils/include/ext4_utils/key_control.h @@ -1,3 +1,6 @@ +#ifndef _KEY_CONTROL_H_ +#define _KEY_CONTROL_H_ + #include #include @@ -29,3 +32,5 @@ long keyctl_search(key_serial_t ringid, const char *type, const char *description, key_serial_t destringid); __END_DECLS + +#endif // _KEY_CONTROL_H_ diff --git a/ext4_utils/make_ext4fs.h b/ext4_utils/include/ext4_utils/make_ext4fs.h similarity index 100% rename from ext4_utils/make_ext4fs.h rename to ext4_utils/include/ext4_utils/make_ext4fs.h diff --git a/ext4_utils/wipe.h b/ext4_utils/include/ext4_utils/wipe.h similarity index 96% rename from ext4_utils/wipe.h rename to ext4_utils/include/ext4_utils/wipe.h index c7a86fa0..d7d089e7 100644 --- a/ext4_utils/wipe.h +++ b/ext4_utils/include/ext4_utils/wipe.h @@ -21,7 +21,7 @@ extern "C" { #endif -#include "ext4_utils.h" +#include "ext4_utils/ext4_utils.h" /* Set WIPE_IS_SUPPORTED to 1 if the current platform supports * wiping of block devices. 0 otherwise. For now, only Linux does. diff --git a/ext4_utils/xattr.h b/ext4_utils/include/ext4_utils/xattr.h similarity index 100% rename from ext4_utils/xattr.h rename to ext4_utils/include/ext4_utils/xattr.h diff --git a/ext4_utils/indirect.c b/ext4_utils/indirect.c index cd85a434..992cc326 100644 --- a/ext4_utils/indirect.c +++ b/ext4_utils/indirect.c @@ -14,14 +14,16 @@ * limitations under the License. */ -#include "ext4_utils.h" #include "indirect.h" -#include "allocate.h" + +#include +#include #include -#include -#include +#include "allocate.h" +#include "ext4_utils/ext4_utils.h" + /* Creates data buffers for the first backing_len bytes of a block allocation and queues them to be written */ diff --git a/ext4_utils/indirect.h b/ext4_utils/indirect.h index cee89790..93741c00 100644 --- a/ext4_utils/indirect.h +++ b/ext4_utils/indirect.h @@ -17,7 +17,10 @@ #ifndef _INDIRECT_H_ #define _INDIRECT_H_ -#include "allocate.h" +#include "ext4_utils/ext4_utils.h" + +struct ext4_inode; +struct block_allocation; void inode_allocate_indirect(struct ext4_inode *inode, unsigned long len); u8 *inode_allocate_data_indirect(struct ext4_inode *inode, unsigned long len, diff --git a/ext4_utils/key_control.cpp b/ext4_utils/key_control.cpp index 64f230a2..de6bde2a 100644 --- a/ext4_utils/key_control.cpp +++ b/ext4_utils/key_control.cpp @@ -1,4 +1,4 @@ -#include "key_control.h" +#include "ext4_utils/key_control.h" #include #include diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c index 744cf0af..a1cfe060 100644 --- a/ext4_utils/make_ext4fs.c +++ b/ext4_utils/make_ext4fs.c @@ -14,13 +14,11 @@ * limitations under the License. */ -#include "make_ext4fs.h" -#include "ext4_utils.h" -#include "allocate.h" -#include "contents.h" -#include "wipe.h" +#include "ext4_utils/make_ext4fs.h" -#include +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif #include #include @@ -30,9 +28,16 @@ #include #include #include -#include #include #include +#include + +#include + +#include "allocate.h" +#include "contents.h" +#include "ext4_utils/ext4_utils.h" +#include "ext4_utils/wipe.h" #ifdef _WIN32 diff --git a/ext4_utils/make_ext4fs_main.c b/ext4_utils/make_ext4fs_main.c index 1343cc6c..87cb53e6 100644 --- a/ext4_utils/make_ext4fs_main.c +++ b/ext4_utils/make_ext4fs_main.c @@ -40,8 +40,8 @@ struct selabel_handle; #endif -#include "make_ext4fs.h" -#include "ext4_utils.h" +#include "ext4_utils/ext4_utils.h" +#include "ext4_utils/make_ext4fs.h" #ifndef _WIN32 /* O_BINARY is windows-specific flag */ #define O_BINARY 0 diff --git a/ext4_utils/setup_fs.c b/ext4_utils/setup_fs.c index 56c563fa..802412d5 100644 --- a/ext4_utils/setup_fs.c +++ b/ext4_utils/setup_fs.c @@ -1,9 +1,10 @@ #include #include #include -#include #include #include +#include + #include #include diff --git a/ext4_utils/wipe.c b/ext4_utils/wipe.c index 5766632e..a519d743 100644 --- a/ext4_utils/wipe.c +++ b/ext4_utils/wipe.c @@ -14,8 +14,9 @@ * limitations under the License. */ -#include "ext4_utils.h" -#include "wipe.h" +#include "ext4_utils/wipe.h" + +#include "ext4_utils/ext4_utils.h" #if WIPE_IS_SUPPORTED diff --git a/tests/fstest/Android.mk b/tests/fstest/Android.mk index 9be7ae4e..7b769b06 100644 --- a/tests/fstest/Android.mk +++ b/tests/fstest/Android.mk @@ -18,9 +18,8 @@ include $(CLEAR_VARS) LOCAL_MODULE_TAGS := tests LOCAL_MODULE := recovery_test LOCAL_SRC_FILES := recovery_test.cpp -LOCAL_SHARED_LIBRARIES += libcutils libutils liblog liblogwrap +LOCAL_SHARED_LIBRARIES += libcutils libutils liblog liblogwrap libext4_utils LOCAL_STATIC_LIBRARIES += libtestUtil libfs_mgr LOCAL_C_INCLUDES += system/extras/tests/include \ - system/extras/ext4_utils \ system/core/logwrapper/include include $(BUILD_NATIVE_TEST) diff --git a/tests/fstest/recovery_test.cpp b/tests/fstest/recovery_test.cpp index 02c7e8fd..fab9a0fc 100644 --- a/tests/fstest/recovery_test.cpp +++ b/tests/fstest/recovery_test.cpp @@ -29,8 +29,8 @@ #include #include "cutils/properties.h" -#include "ext4.h" -#include "ext4_utils.h" +#include +#include #define LOG_TAG "fsRecoveryTest" #include diff --git a/verity/Android.mk b/verity/Android.mk index 1a7351f0..ef5f08ef 100644 --- a/verity/Android.mk +++ b/verity/Android.mk @@ -8,7 +8,7 @@ LOCAL_SRC_FILES := verify_boot_signature.c LOCAL_MODULE_CLASS := EXECUTABLES LOCAL_MODULE_TAGS := optional LOCAL_SHARED_LIBRARIES := libcrypto -LOCAL_C_INCLUDES += external/openssl/include system/extras/ext4_utils system/core/mkbootimg +LOCAL_C_INCLUDES += external/openssl/include system/core/mkbootimg include $(BUILD_HOST_EXECUTABLE) endif # HOST_OS == linux -- 2.11.0