-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: sekaiacg <[email protected]>
- Loading branch information
1 parent
c962911
commit e96c67d
Showing
25 changed files
with
403 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[submodule "src/pcre"] | ||
path = src/pcre | ||
url = https://android.googlesource.com/platform/external/pcre.git | ||
[submodule "src/logging"] | ||
path = src/logging | ||
url = https://android.googlesource.com/platform/system/logging.git | ||
[submodule "src/lz4"] | ||
path = src/lz4 | ||
url = https://android.googlesource.com/platform/external/lz4 | ||
[submodule "src/e2fsprogs"] | ||
path = src/e2fsprogs | ||
url = https://android.googlesource.com/platform/external/e2fsprogs.git | ||
[submodule "src/libbase"] | ||
path = src/libbase | ||
url = https://android.googlesource.com/platform/system/libbase | ||
[submodule "src/core"] | ||
path = src/core | ||
url = https://android.googlesource.com/platform/system/core.git | ||
[submodule "src/selinux"] | ||
path = src/selinux | ||
url = https://github.com/SELinuxProject/selinux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
cmake_minimum_required(VERSION 3.14.2) | ||
project(erofs-utils) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
# set global cflags and cxxflags | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -Wno-ignored-qualifiers -Wno-pointer-arith -Wno-unused-parameter -Wno-unused-function -DHAVE_FALLOCATE -DHAVE_LINUX_TYPES_H -DHAVE_LIBSELINUX -DHAVE_LIBUUID -DLZ4_ENABLED -DLZ4HC_ENABLED -DWITH_ANDROID ") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-ignored-qualifiers -Wno-pointer-arith -Wno-unused-parameter -Wno-unused-function -DHAVE_FALLOCATE -DHAVE_LINUX_TYPES_H -DHAVE_LIBSELINUX -DHAVE_LIBUUID -DLZ4_ENABLED -DLZ4HC_ENABLED -DWITH_ANDROID") | ||
|
||
set(CMAKE_EXE_LINKER_FLAGS "-static") | ||
|
||
set(SRC ${PROJECT_SOURCE_DIR}/src) | ||
|
||
# git clone submodule | ||
execute_process(COMMAND git submodule init) | ||
execute_process(COMMAND git submodule update) | ||
|
||
# thrid part library | ||
add_subdirectory(src/lz4/build/cmake) | ||
|
||
# start building | ||
add_subdirectory(src) | ||
add_subdirectory(erofs-tools) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include(mkfs.cmake) | ||
include(dump.cmake) | ||
#include(fuse.cmake) | ||
include(fsck.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
set(TARGET dump.erofs) | ||
|
||
file(GLOB SRCS "${PROJECT_SOURCE_DIR}/dump/*.c") | ||
add_executable(${TARGET} ${SRCS}) | ||
target_link_libraries(${TARGET} | ||
erofs | ||
cutils | ||
ext2_uuid | ||
log | ||
lz4_static | ||
selinux | ||
pcre | ||
base | ||
) | ||
include_directories( | ||
${PROJECT_SOURCE_DIR}/lib | ||
${PROJECT_SOURCE_DIR}/include | ||
${SRC}/selinux/libselinux/include | ||
${SRC}/e2fsprogs/lib/uuid | ||
${SRC}/core/libcutils/include | ||
) | ||
link_directories( | ||
${SRC} | ||
${SRC}/lz4/build/cmake | ||
${SRC}/pcre | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
set(TARGET fsck.erofs) | ||
|
||
file(GLOB SRCS "${PROJECT_SOURCE_DIR}/fsck/*.c") | ||
add_executable(${TARGET} ${SRCS}) | ||
target_link_libraries(${TARGET} | ||
erofs | ||
cutils | ||
ext2_uuid | ||
log | ||
lz4_static | ||
selinux | ||
pcre | ||
base | ||
) | ||
include_directories( | ||
${PROJECT_SOURCE_DIR}/lib | ||
${PROJECT_SOURCE_DIR}/include | ||
${SRC}/selinux/libselinux/include | ||
${SRC}/e2fsprogs/lib/uuid | ||
${SRC}/core/libcutils/include | ||
) | ||
link_directories( | ||
${SRC} | ||
${SRC}/lz4/build/cmake | ||
${SRC}/pcre | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
file(GLOB SRCS "${PROJECT_SOURCE_DIR}/fuse/*.c") | ||
add_executable(erofs.fuse ${SRCS}) | ||
target_link_libraries(erofs.fuse | ||
libbase | ||
libutils | ||
liblog | ||
) | ||
|
||
include_directories( | ||
${PROJECT_SOURCE_DIR}/lib | ||
${PROJECT_SOURCE_DIR}/include | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
set(TARGET mkfs.erofs) | ||
|
||
file(GLOB SRCS "${PROJECT_SOURCE_DIR}/mkfs/*.c") | ||
add_executable(${TARGET} ${SRCS}) | ||
target_link_libraries(${TARGET} | ||
erofs | ||
cutils | ||
ext2_uuid | ||
log | ||
lz4_static | ||
selinux | ||
pcre | ||
base | ||
) | ||
include_directories( | ||
${PROJECT_SOURCE_DIR}/lib | ||
${PROJECT_SOURCE_DIR}/include | ||
${SRC}/selinux/libselinux/include | ||
${SRC}/e2fsprogs/lib/uuid | ||
${SRC}/core/libcutils/include | ||
) | ||
link_directories( | ||
${SRC} | ||
${SRC}/lz4/build/cmake | ||
${SRC}/pcre | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#ifndef _SELINUX_ANDROID_H_ | ||
#define _SELINUX_ANDROID_H_ | ||
|
||
#include <stdbool.h> | ||
#include <sys/types.h> | ||
#include <unistd.h> | ||
|
||
#include <selinux/label.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
extern struct selabel_handle* selinux_android_file_context_handle(void); | ||
|
||
extern struct selabel_handle* selinux_android_prop_context_handle(void); | ||
|
||
extern struct selabel_handle* selinux_android_service_context_handle(void); | ||
|
||
extern void selinux_android_set_sehandle(const struct selabel_handle *hndl); | ||
|
||
extern int selinux_android_load_policy(void); | ||
|
||
extern int selinux_android_reload_policy(void); | ||
|
||
extern int selinux_android_setcon(const char *con); | ||
|
||
extern int selinux_android_setcontext(uid_t uid, | ||
bool isSystemServer, | ||
const char *seinfo, | ||
const char *name); | ||
|
||
extern int selinux_android_setfilecon(const char *pkgdir, | ||
const char *pkgname, | ||
const char *seinfo, | ||
uid_t uid); | ||
|
||
extern int selinux_log_callback(int type, const char *fmt, ...) | ||
__attribute__ ((format(printf, 2, 3))); | ||
|
||
#define SELINUX_ANDROID_RESTORECON_NOCHANGE 1 | ||
#define SELINUX_ANDROID_RESTORECON_VERBOSE 2 | ||
#define SELINUX_ANDROID_RESTORECON_RECURSE 4 | ||
#define SELINUX_ANDROID_RESTORECON_FORCE 8 | ||
#define SELINUX_ANDROID_RESTORECON_DATADATA 16 | ||
extern int selinux_android_restorecon(const char *file, unsigned int flags); | ||
|
||
extern int selinux_android_restorecon_pkgdir(const char *pkgdir, | ||
const char *seinfo, | ||
uid_t uid, | ||
unsigned int flags); | ||
|
||
extern int selinux_android_seapp_context_reload(void); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
include(libbase.cmake) | ||
include(libext2_uuid.cmake) | ||
include(liblog.cmake) | ||
include(libcutils.cmake) | ||
include(libselinux.cmake) | ||
include(liberofs.cmake) | ||
include(libpcre.cmake) |
Submodule e2fsprogs
added at
51fa8d
Submodule libbase
added at
25cba3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
set(TARGET base) | ||
|
||
add_library(${TARGET} STATIC | ||
${SRC}/libbase/abi_compatibility.cpp | ||
${SRC}/libbase/chrono_utils.cpp | ||
${SRC}/libbase/cmsg.cpp | ||
${SRC}/libbase/errors_unix.cpp | ||
${SRC}/libbase/file.cpp | ||
${SRC}/libbase/logging.cpp | ||
${SRC}/libbase/mapped_file.cpp | ||
${SRC}/libbase/parsebool.cpp | ||
${SRC}/libbase/parsenetaddress.cpp | ||
${SRC}/libbase/process.cpp | ||
${SRC}/libbase/properties.cpp | ||
${SRC}/libbase/stringprintf.cpp | ||
${SRC}/libbase/strings.cpp | ||
${SRC}/libbase/test_utils.cpp | ||
${SRC}/libbase/threads.cpp | ||
${SRC}/libbase/posix_strerror_r.cpp | ||
) | ||
|
||
target_include_directories(${TARGET} PUBLIC | ||
${SRC}/libbase/include | ||
${SRC}/core/include | ||
${SRC}/logging/liblog/include | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
set(TARGET cutils) | ||
|
||
add_library(${TARGET} STATIC | ||
${SRC}/core/libcutils/android_get_control_file.cpp | ||
${SRC}/core/libcutils/ashmem-host.cpp | ||
${SRC}/core/libcutils/canned_fs_config.cpp | ||
${SRC}/core/libcutils/config_utils.cpp | ||
${SRC}/core/libcutils/fs.cpp | ||
${SRC}/core/libcutils/fs_config.cpp | ||
${SRC}/core/libcutils/hashmap.cpp | ||
${SRC}/core/libcutils/iosched_policy.cpp | ||
${SRC}/core/libcutils/load_file.cpp | ||
${SRC}/core/libcutils/multiuser.cpp | ||
${SRC}/core/libcutils/native_handle.cpp | ||
${SRC}/core/libcutils/properties.cpp | ||
${SRC}/core/libcutils/record_stream.cpp | ||
${SRC}/core/libcutils/socket_inaddr_any_server_unix.cpp | ||
${SRC}/core/libcutils/socket_local_client_unix.cpp | ||
${SRC}/core/libcutils/socket_local_server_unix.cpp | ||
${SRC}/core/libcutils/socket_network_client_unix.cpp | ||
${SRC}/core/libcutils/sockets_unix.cpp | ||
${SRC}/core/libcutils/sockets.cpp | ||
${SRC}/core/libcutils/str_parms.cpp | ||
${SRC}/core/libcutils/strlcpy.c | ||
${SRC}/core/libcutils/trace-host.cpp | ||
${SRC}/core/libcutils/threads.cpp) | ||
|
||
target_compile_definitions(${TARGET} PRIVATE -D_GNU_SOURCE) | ||
|
||
target_include_directories(${TARGET} PUBLIC | ||
${SRC}/core/libutils/include | ||
${SRC}/core/libcutils/include | ||
${SRC}/logging/liblog/include | ||
${SRC}/libbase/include | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
set(TARGET erofs) | ||
|
||
file(GLOB SRCS "${PROJECT_SOURCE_DIR}/lib/*.c") | ||
|
||
add_library(${TARGET} STATIC | ||
${SRCS} | ||
) | ||
|
||
include_directories( | ||
${PROJECT_SOURCE_DIR}/lib | ||
${PROJECT_SOURCE_DIR}/include | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
set(TARGET ext2_uuid) | ||
|
||
add_library(${TARGET} STATIC | ||
${SRC}/e2fsprogs/lib/uuid/clear.c | ||
${SRC}/e2fsprogs/lib/uuid/compare.c | ||
${SRC}/e2fsprogs/lib/uuid/copy.c | ||
${SRC}/e2fsprogs/lib/uuid/gen_uuid.c | ||
${SRC}/e2fsprogs/lib/uuid/isnull.c | ||
${SRC}/e2fsprogs/lib/uuid/pack.c | ||
${SRC}/e2fsprogs/lib/uuid/parse.c | ||
${SRC}/e2fsprogs/lib/uuid/unpack.c | ||
${SRC}/e2fsprogs/lib/uuid/unparse.c | ||
${SRC}/e2fsprogs/lib/uuid/uuid_time.c | ||
) | ||
|
||
include_directories( | ||
${SRC}/e2fsprogs/lib | ||
${SRC}/core/libsparse/include | ||
${SRC}/e2fsprogs/lib | ||
${SRC}/e2fsprogs/misc | ||
${SRC}/e2fsprogs/lib/ext2fs | ||
${SRC}/selinux/libselinux/include | ||
${SRC}/core/libcutils/include | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
set(TARGET log) | ||
|
||
add_library(${TARGET} STATIC | ||
${SRC}/logging/liblog/log_event_list.cpp | ||
${SRC}/logging/liblog/log_event_write.cpp | ||
${SRC}/logging/liblog/logger_name.cpp | ||
${SRC}/logging/liblog/logger_read.cpp | ||
${SRC}/logging/liblog/logger_write.cpp | ||
${SRC}/logging/liblog/properties.cpp | ||
${SRC}/logging/liblog/logprint.cpp | ||
) | ||
|
||
target_compile_definitions(${TARGET} PRIVATE | ||
-DLIBLOG_LOG_TAG=1006 | ||
-D_XOPEN_SOURCE=700 | ||
-DFAKE_LOG_DEVICE=1 | ||
-DSNET_EVENT_LOG_TAG=1397638686 | ||
) | ||
|
||
target_include_directories(${TARGET} PUBLIC | ||
${SRC}/core/include | ||
${SRC}/logging/liblog/include | ||
${SRC}/core/libcutils/include | ||
${SRC}/libbase/include | ||
) |
Oops, something went wrong.