Skip to content

Commit

Permalink
untar: support pax xattr header
Browse files Browse the repository at this point in the history
remove overlaybd/extfs and use photon/extfs instead.

Signed-off-by: yuchen.cc <yuchen.cc@alibaba-inc.com>
  • Loading branch information
yuchen0cc committed Dec 15, 2023
1 parent bdae9ba commit 867c76a
Show file tree
Hide file tree
Showing 24 changed files with 115 additions and 3,330 deletions.
43 changes: 43 additions & 0 deletions CMake/Finde2fs.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
if(NOT ORIGIN_EXT2FS)
message("Add and build standalone libext2fs")
include(FetchContent)
FetchContent_Declare(
e2fsprogs
GIT_REPOSITORY https://github.com/data-accelerator/e2fsprogs.git
GIT_TAG f8664ddfd662b1664104e0bbd5ac202a6e3b1da6
)
FetchContent_GetProperties(e2fsprogs)

if(NOT TARGET libext2fs_build)
if (NOT e2fsprogs_POPULATED)
FetchContent_Populate(e2fsprogs)
endif()
set(LIBEXT2FS_INSTALL_DIR ${e2fsprogs_SOURCE_DIR}/build/libext2fs CACHE STRING "")

add_custom_command(
OUTPUT ${LIBEXT2FS_INSTALL_DIR}/lib
WORKING_DIRECTORY ${e2fsprogs_SOURCE_DIR}
COMMAND chmod 755 build.sh && ./build.sh
)
add_custom_target(libext2fs_build DEPENDS ${LIBEXT2FS_INSTALL_DIR}/lib)
endif()

set(E2FS_FOUND yes)
set(E2FS_LIBRARY ${LIBEXT2FS_INSTALL_DIR}/lib/libext2fs.so)
set(E2FS_LIBRARIES ${E2FS_LIBRARY})
set(E2FS_INCLUDE_DIR ${LIBEXT2FS_INSTALL_DIR}/include)
set(E2FS_INCLUDE_DIRS ${E2FS_INCLUDE_DIR})

if(NOT TARGET libext2fs)
add_library(libext2fs UNKNOWN IMPORTED)
endif()
add_dependencies(libext2fs libext2fs_build)

else()
find_path(E2FS_INCLUDE_DIRS ext2fs/ext2fs.h)
find_library(E2FS_LIBRARIES ext2fs)
endif()

find_package_handle_standard_args(e2fs DEFAULT_MSG E2FS_LIBRARIES E2FS_INCLUDE_DIRS)

mark_as_advanced(E2FS_INCLUDE_DIRS E2FS_LIBRARIES)
21 changes: 0 additions & 21 deletions CMake/Findext2fs.cmake

This file was deleted.

7 changes: 6 additions & 1 deletion CMake/Findphoton.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
include(FetchContent)
set(FETCHCONTENT_QUIET false)
set(PHOTON_ENABLE_EXTFS ON)

FetchContent_Declare(
photon
GIT_REPOSITORY https://github.com/alibaba/PhotonLibOS.git
GIT_TAG v0.6.13
GIT_TAG v0.6.14
)

if(BUILD_TESTING)
Expand All @@ -21,4 +22,8 @@ if (BUILD_CURL_FROM_SOURCE)
add_dependencies(photon_obj CURL::libcurl OpenSSL::SSL OpenSSL::Crypto)
endif()

if(NOT ORIGIN_EXT2FS)
add_dependencies(photon_obj libext2fs)
endif()

set(PHOTON_INCLUDE_DIR ${photon_SOURCE_DIR}/include/)
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED on)
set(ENABLE_MIMIC_VDSO off)
option(BUILD_CURL_FROM_SOURCE "Compile static libcurl" off)
option(ORIGIN_EXT2FS "Use original libext2fs" off)
find_package(photon REQUIRED)
find_package(tcmu REQUIRED)
find_package(yamlcpp)
Expand Down
5 changes: 4 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ install(TARGETS overlaybd-tcmu DESTINATION /opt/overlaybd/bin)
install(FILES example_config/overlaybd-tcmu.service DESTINATION /opt/overlaybd/)
install(FILES example_config/overlaybd.json DESTINATION /etc/overlaybd/)
install(FILES example_config/cred.json DESTINATION /opt/overlaybd/)
if (NOT ORIGIN_EXT2FS)
install(DIRECTORY ${LIBEXT2FS_INSTALL_DIR}/lib DESTINATION /opt/overlaybd/ USE_SOURCE_PERMISSIONS)
endif()

add_subdirectory(tools)
if (BUILD_TESTING)
add_subdirectory(test)
endif ()
endif ()
2 changes: 0 additions & 2 deletions src/overlaybd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ add_subdirectory(lsmt)
add_subdirectory(zfile)
add_subdirectory(cache)
add_subdirectory(tar)
add_subdirectory(extfs)
add_subdirectory(gzip)
add_subdirectory(gzindex)
add_subdirectory(stream_convertor)
Expand All @@ -19,7 +18,6 @@ target_link_libraries(overlaybd_lib INTERFACE
zfile_lib
cache_lib
tar_lib
extfs_lib
gzip_lib
gzindex_lib
)
20 changes: 0 additions & 20 deletions src/overlaybd/extfs/CMakeLists.txt

This file was deleted.

215 changes: 0 additions & 215 deletions src/overlaybd/extfs/buffer_file.h

This file was deleted.

0 comments on commit 867c76a

Please sign in to comment.