Skip to content

Commit 4472ea4

Browse files
authored
Merge pull request #302 from yuchen0cc/main
untar: support pax xattr header
2 parents bdae9ba + 867c76a commit 4472ea4

24 files changed

+115
-3330
lines changed

CMake/Finde2fs.cmake

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
if(NOT ORIGIN_EXT2FS)
2+
message("Add and build standalone libext2fs")
3+
include(FetchContent)
4+
FetchContent_Declare(
5+
e2fsprogs
6+
GIT_REPOSITORY https://github.com/data-accelerator/e2fsprogs.git
7+
GIT_TAG f8664ddfd662b1664104e0bbd5ac202a6e3b1da6
8+
)
9+
FetchContent_GetProperties(e2fsprogs)
10+
11+
if(NOT TARGET libext2fs_build)
12+
if (NOT e2fsprogs_POPULATED)
13+
FetchContent_Populate(e2fsprogs)
14+
endif()
15+
set(LIBEXT2FS_INSTALL_DIR ${e2fsprogs_SOURCE_DIR}/build/libext2fs CACHE STRING "")
16+
17+
add_custom_command(
18+
OUTPUT ${LIBEXT2FS_INSTALL_DIR}/lib
19+
WORKING_DIRECTORY ${e2fsprogs_SOURCE_DIR}
20+
COMMAND chmod 755 build.sh && ./build.sh
21+
)
22+
add_custom_target(libext2fs_build DEPENDS ${LIBEXT2FS_INSTALL_DIR}/lib)
23+
endif()
24+
25+
set(E2FS_FOUND yes)
26+
set(E2FS_LIBRARY ${LIBEXT2FS_INSTALL_DIR}/lib/libext2fs.so)
27+
set(E2FS_LIBRARIES ${E2FS_LIBRARY})
28+
set(E2FS_INCLUDE_DIR ${LIBEXT2FS_INSTALL_DIR}/include)
29+
set(E2FS_INCLUDE_DIRS ${E2FS_INCLUDE_DIR})
30+
31+
if(NOT TARGET libext2fs)
32+
add_library(libext2fs UNKNOWN IMPORTED)
33+
endif()
34+
add_dependencies(libext2fs libext2fs_build)
35+
36+
else()
37+
find_path(E2FS_INCLUDE_DIRS ext2fs/ext2fs.h)
38+
find_library(E2FS_LIBRARIES ext2fs)
39+
endif()
40+
41+
find_package_handle_standard_args(e2fs DEFAULT_MSG E2FS_LIBRARIES E2FS_INCLUDE_DIRS)
42+
43+
mark_as_advanced(E2FS_INCLUDE_DIRS E2FS_LIBRARIES)

CMake/Findext2fs.cmake

Lines changed: 0 additions & 21 deletions
This file was deleted.

CMake/Findphoton.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
include(FetchContent)
22
set(FETCHCONTENT_QUIET false)
3+
set(PHOTON_ENABLE_EXTFS ON)
34

45
FetchContent_Declare(
56
photon
67
GIT_REPOSITORY https://github.com/alibaba/PhotonLibOS.git
7-
GIT_TAG v0.6.13
8+
GIT_TAG v0.6.14
89
)
910

1011
if(BUILD_TESTING)
@@ -21,4 +22,8 @@ if (BUILD_CURL_FROM_SOURCE)
2122
add_dependencies(photon_obj CURL::libcurl OpenSSL::SSL OpenSSL::Crypto)
2223
endif()
2324

25+
if(NOT ORIGIN_EXT2FS)
26+
add_dependencies(photon_obj libext2fs)
27+
endif()
28+
2429
set(PHOTON_INCLUDE_DIR ${photon_SOURCE_DIR}/include/)

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ set(CMAKE_CXX_STANDARD 14)
4040
set(CMAKE_CXX_STANDARD_REQUIRED on)
4141
set(ENABLE_MIMIC_VDSO off)
4242
option(BUILD_CURL_FROM_SOURCE "Compile static libcurl" off)
43+
option(ORIGIN_EXT2FS "Use original libext2fs" off)
4344
find_package(photon REQUIRED)
4445
find_package(tcmu REQUIRED)
4546
find_package(yamlcpp)

src/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ install(TARGETS overlaybd-tcmu DESTINATION /opt/overlaybd/bin)
5656
install(FILES example_config/overlaybd-tcmu.service DESTINATION /opt/overlaybd/)
5757
install(FILES example_config/overlaybd.json DESTINATION /etc/overlaybd/)
5858
install(FILES example_config/cred.json DESTINATION /opt/overlaybd/)
59+
if (NOT ORIGIN_EXT2FS)
60+
install(DIRECTORY ${LIBEXT2FS_INSTALL_DIR}/lib DESTINATION /opt/overlaybd/ USE_SOURCE_PERMISSIONS)
61+
endif()
5962

6063
add_subdirectory(tools)
6164
if (BUILD_TESTING)
6265
add_subdirectory(test)
63-
endif ()
66+
endif ()

src/overlaybd/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ add_subdirectory(lsmt)
33
add_subdirectory(zfile)
44
add_subdirectory(cache)
55
add_subdirectory(tar)
6-
add_subdirectory(extfs)
76
add_subdirectory(gzip)
87
add_subdirectory(gzindex)
98
add_subdirectory(stream_convertor)
@@ -19,7 +18,6 @@ target_link_libraries(overlaybd_lib INTERFACE
1918
zfile_lib
2019
cache_lib
2120
tar_lib
22-
extfs_lib
2321
gzip_lib
2422
gzindex_lib
2523
)

src/overlaybd/extfs/CMakeLists.txt

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/overlaybd/extfs/buffer_file.h

Lines changed: 0 additions & 215 deletions
This file was deleted.

0 commit comments

Comments
 (0)