summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext4_utils/Android.mk31
-rw-r--r--ext4_utils/allocate.c7
-rw-r--r--ext4_utils/allocate.h2
-rw-r--r--ext4_utils/contents.c15
-rw-r--r--ext4_utils/contents.h2
-rw-r--r--ext4_utils/crc16.c2
-rw-r--r--ext4_utils/ext2simg.c16
-rw-r--r--ext4_utils/ext4_crypt.cpp9
-rw-r--r--ext4_utils/ext4_crypt_init_extensions.cpp20
-rw-r--r--ext4_utils/ext4_sb.c2
-rw-r--r--ext4_utils/ext4_utils.c22
-rw-r--r--ext4_utils/ext4fixup.c17
-rw-r--r--ext4_utils/ext4fixup_main.c3
-rw-r--r--ext4_utils/extent.c7
-rw-r--r--ext4_utils/extent.h6
-rw-r--r--ext4_utils/include/ext4_utils/ext4.h (renamed from ext4_utils/ext4.h)0
-rw-r--r--ext4_utils/include/ext4_utils/ext4_crypt.h (renamed from ext4_utils/ext4_crypt.h)5
-rw-r--r--ext4_utils/include/ext4_utils/ext4_crypt_init_extensions.h (renamed from ext4_utils/ext4_crypt_init_extensions.h)5
-rw-r--r--ext4_utils/include/ext4_utils/ext4_extents.h (renamed from ext4_utils/ext4_extents.h)2
-rw-r--r--ext4_utils/include/ext4_utils/ext4_kernel_headers.h (renamed from ext4_utils/ext4_kernel_headers.h)8
-rw-r--r--ext4_utils/include/ext4_utils/ext4_sb.h (renamed from ext4_utils/ext4_sb.h)2
-rw-r--r--ext4_utils/include/ext4_utils/ext4_utils.h (renamed from ext4_utils/ext4_utils.h)0
-rw-r--r--ext4_utils/include/ext4_utils/jbd2.h (renamed from ext4_utils/jbd2.h)0
-rw-r--r--ext4_utils/include/ext4_utils/key_control.h (renamed from ext4_utils/key_control.h)5
-rw-r--r--ext4_utils/include/ext4_utils/make_ext4fs.h (renamed from ext4_utils/make_ext4fs.h)0
-rw-r--r--ext4_utils/include/ext4_utils/wipe.h (renamed from ext4_utils/wipe.h)2
-rw-r--r--ext4_utils/include/ext4_utils/xattr.h (renamed from ext4_utils/xattr.h)0
-rw-r--r--ext4_utils/indirect.c10
-rw-r--r--ext4_utils/indirect.h5
-rw-r--r--ext4_utils/key_control.cpp2
-rw-r--r--ext4_utils/make_ext4fs.c19
-rw-r--r--ext4_utils/make_ext4fs_main.c4
-rw-r--r--ext4_utils/setup_fs.c3
-rw-r--r--ext4_utils/wipe.c5
-rw-r--r--libfec/Android.mk1
-rw-r--r--libfec/fec_open.cpp3
-rw-r--r--tests/fstest/Android.mk3
-rw-r--r--tests/fstest/recovery_test.cpp4
-rw-r--r--verity/Android.mk2
39 files changed, 156 insertions, 95 deletions
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 <sparse/sparse.h>
-
#include <stdio.h>
#include <stdlib.h>
+#include <sparse/sparse.h>
+
+#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 <sys/stat.h>
#include <string.h>
#include <stdio.h>
+#include "allocate.h"
+#include "ext4_utils/ext4_utils.h"
+#include "ext4_utils/make_ext4fs.h"
+#include "extent.h"
+#include "indirect.h"
+
#ifdef __ANDROID__
#include <linux/capability.h>
#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 <sys/types.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/mman.h>
#include <fcntl.h>
#include <libgen.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#include <unistd.h>
#include <sparse/sparse.h>
-#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 <asm/ioctl.h>
#include <dirent.h>
#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-
#include <fcntl.h>
-#include <asm/ioctl.h>
+#include <string.h>
#include <sys/syscall.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <unistd.h>
#include <android-base/logging.h>
#include <cutils/properties.h>
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 <android-base/logging.h>
-
-#include <string>
-#include <vector>
+#include "ext4_utils/ext4_crypt_init_extensions.h"
#include <dirent.h>
#include <errno.h>
@@ -30,15 +22,21 @@
#include <sys/stat.h>
#include <unistd.h>
+#include <string>
+#include <vector>
+
#include <android-base/file.h>
+#include <android-base/logging.h>
#include <android-base/stringprintf.h>
-
#include <cutils/klog.h>
#include <cutils/properties.h>
#include <cutils/sockets.h>
#include <logwrap/logwrap.h>
-#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 <errno.h>
-#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 <fcntl.h>
+#include <inttypes.h>
+#include <stddef.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include <sparse/sparse.h>
+
#include "allocate.h"
-#include "indirect.h"
#include "extent.h"
+#include "indirect.h"
#include "sha1.h"
-#include <sparse/sparse.h>
#ifdef REAL_UUID
#include <uuid.h>
#endif
-#include <fcntl.h>
-#include <inttypes.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <stddef.h>
-#include <string.h>
-
#ifdef _WIN32
#include <winsock2.h>
#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 <sparse/sparse.h>
+#define _LARGEFILE64_SOURCE
-#include <sys/types.h>
+#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <fcntl.h>
#include <unistd.h>
+#include <sparse/sparse.h>
+
+#include "allocate.h"
+#include "ext4_utils/ext4_extents.h"
+#include "ext4_utils/ext4_utils.h"
+#include "ext4_utils/make_ext4fs.h"
+
#ifndef _WIN32
#include <sys/mman.h>
#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 <unistd.h>
#include <libgen.h>
#include <stdio.h>
#include <stdlib.h>
+#include <unistd.h>
+
#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 <sparse/sparse.h>
-
#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
+#include <sparse/sparse.h>
+
+#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
index 974fb2d1..974fb2d1 100644
--- a/ext4_utils/ext4.h
+++ b/ext4_utils/include/ext4_utils/ext4.h
diff --git a/ext4_utils/ext4_crypt.h b/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 <sys/cdefs.h>
#include <stdbool.h>
#include <cutils/multiuser.h>
@@ -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
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 <sys/cdefs.h>
#include <stdbool.h>
#include <cutils/multiuser.h>
@@ -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
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
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
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
index 0fbbdd31..0fbbdd31 100644
--- a/ext4_utils/ext4_utils.h
+++ b/ext4_utils/include/ext4_utils/ext4_utils.h
diff --git a/ext4_utils/jbd2.h b/ext4_utils/include/ext4_utils/jbd2.h
index bac58c2e..bac58c2e 100644
--- a/ext4_utils/jbd2.h
+++ b/ext4_utils/include/ext4_utils/jbd2.h
diff --git a/ext4_utils/key_control.h b/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 <sys/cdefs.h>
#include <sys/types.h>
@@ -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
index 4498e628..4498e628 100644
--- a/ext4_utils/make_ext4fs.h
+++ b/ext4_utils/include/ext4_utils/make_ext4fs.h
diff --git a/ext4_utils/wipe.h b/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
index 0f323fdc..0f323fdc 100644
--- a/ext4_utils/xattr.h
+++ b/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 <stdio.h>
+#include <stdlib.h>
#include <sparse/sparse.h>
-#include <stdlib.h>
-#include <stdio.h>
+#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 <stdarg.h>
#include <unistd.h>
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 <sparse/sparse.h>
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
#include <assert.h>
#include <dirent.h>
@@ -30,9 +28,16 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <unistd.h>
+
+#include <sparse/sparse.h>
+
+#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 <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <sys/reboot.h>
#include <sys/wait.h>
+#include <unistd.h>
+
#include <cutils/android_reboot.h>
#include <cutils/partition_utils.h>
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/libfec/Android.mk b/libfec/Android.mk
index b92dd4e7..283019c0 100644
--- a/libfec/Android.mk
+++ b/libfec/Android.mk
@@ -7,7 +7,6 @@ common_cflags := -Wall -Werror -O3
common_c_includes := \
$(LOCAL_PATH)/include \
external/fec \
- system/extras/ext4_utils \
system/extras/squashfs_utils
common_src_files := \
diff --git a/libfec/fec_open.cpp b/libfec/fec_open.cpp
index caec3704..45e0c263 100644
--- a/libfec/fec_open.cpp
+++ b/libfec/fec_open.cpp
@@ -18,9 +18,10 @@
#include <sys/ioctl.h>
#include <sys/stat.h>
+#include <ext4_utils/ext4_sb.h>
+
extern "C" {
#include <squashfs_utils.h>
- #include <ext4_sb.h>
}
#if defined(__linux__)
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 <unistd.h>
#include "cutils/properties.h"
-#include "ext4.h"
-#include "ext4_utils.h"
+#include <ext4_utils/ext4.h>
+#include <ext4_utils/ext4_utils.h>
#define LOG_TAG "fsRecoveryTest"
#include <utils/Log.h>
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