Skip to content

Commit 528d634

Browse files
author
Hongzhen Luo
committed
Introduce tarerofs I/O API
Previously, erofs-utils was integrated into overlaybd by using the `mkfs.erofs` executable file. It's not optimial since raw data needs to be dumped first and output data needs to be write into overlaybd then. This commit introduces the I/O API in tarerofs, that the data stream of the: - output image - input tar file can be controlled by the I/O manager. This also adds block read/write cache support for IFile to improve the efficiency of making file system images. Signed-off-by: Hongzhen Luo <[email protected]>
1 parent 27b69e9 commit 528d634

7 files changed

Lines changed: 753 additions & 181 deletions

File tree

src/overlaybd/tar/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ target_include_directories(tar_lib PUBLIC
88
if(BUILD_TESTING)
99
add_subdirectory(test)
1010
endif()
11+
12+
add_subdirectory(erofs)
13+
target_link_libraries(tar_lib PRIVATE erofs_lib)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
include(FetchContent)
2+
3+
FetchContent_Declare(
4+
erofs-utils
5+
GIT_REPOSITORY https://gitee.com/anolis/erofs-utils.git
6+
GIT_TAG overlaybd-dev-2
7+
)
8+
9+
FetchContent_MakeAvailable(erofs-utils)
10+
11+
execute_process(
12+
COMMAND ./autogen.sh
13+
WORKING_DIRECTORY ${erofs-utils_SOURCE_DIR}
14+
)
15+
execute_process(
16+
COMMAND ./configure --disable-lz4 --without-liblzma
17+
WORKING_DIRECTORY ${erofs-utils_SOURCE_DIR}
18+
)
19+
execute_process(
20+
COMMAND make
21+
WORKING_DIRECTORY ${erofs-utils_SOURCE_DIR}
22+
)
23+
24+
set(EROFS_LIB_INCLUDE_DIR "${erofs-utils_SOURCE_DIR}/include/" CACHE PATH "erofs-utils include path.")
25+
set(EROFS_CONFIG_FILE "${erofs-utils_SOURCE_DIR}/config.h" CACHE PATH "erofs-utils config file.")
26+
set(EROFS_LIB_STATIC "${erofs-utils_SOURCE_DIR}/lib/.libs/liberofs.a" CACHE PATH "erofs-utils static lib.")
27+
28+
file(GLOB EROFS_SOURCE "*.cpp")
29+
30+
add_library(erofs_lib STATIC ${EROFS_SOURCE})
31+
32+
target_include_directories(erofs_lib PRIVATE
33+
${PHOTON_INCLUDE_DIR}
34+
)
35+
36+
target_include_directories(erofs_lib PRIVATE
37+
${EROFS_LIB_INCLUDE_DIR}
38+
)
39+
40+
target_link_libraries(erofs_lib PRIVATE uuid)
41+
42+
target_compile_options(erofs_lib PRIVATE "-include${EROFS_CONFIG_FILE}")
43+
target_link_libraries(erofs_lib PRIVATE ${EROFS_LIB_STATIC})

0 commit comments

Comments
 (0)