Skip to content

Commit

Permalink
CMake: Add sload_f2fs tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Biswa96 committed Nov 18, 2023
1 parent bff6beb commit ee0e62f
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ jobs:
/usr/local/bin/adb --version
/usr/local/bin/fastboot --version
/usr/local/bin/make_f2fs -V
/usr/local/bin/sload_f2fs -V
macos:
strategy:
Expand Down Expand Up @@ -182,3 +183,4 @@ jobs:
/usr/local/bin/adb --version
/usr/local/bin/fastboot --version
/usr/local/bin/make_f2fs -V
/usr/local/bin/sload_f2fs -V
52 changes: 47 additions & 5 deletions vendor/CMakeLists.f2fstools.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
# CMakeLists.f2fstools.txt: CMake file for f2fs-tools directory

set(f2fs_tools_defaults
-DF2FS_MAJOR_VERSION=1
-DF2FS_MINOR_VERSION=16
-DF2FS_TOOLS_VERSION="1.16.0"
-DF2FS_TOOLS_DATE="2023-04-11"
-DWITH_ANDROID)

add_library(libf2fs STATIC
f2fs-tools/lib/libf2fs.c
f2fs-tools/mkfs/f2fs_format.c
Expand All @@ -9,11 +16,7 @@ add_library(libf2fs STATIC
f2fs-tools/lib/nls_utf8.c)

target_compile_definitions(libf2fs PUBLIC
-DF2FS_MAJOR_VERSION=1
-DF2FS_MINOR_VERSION=16
-DF2FS_TOOLS_VERSION="1.16.0"
-DF2FS_TOOLS_DATE="2023-04-11"
-DWITH_ANDROID
${f2fs_tools_defaults}
-DWITH_BLKDISCARD)

target_include_directories(libf2fs PUBLIC
Expand All @@ -29,3 +32,42 @@ add_executable(make_f2fs

target_link_libraries(make_f2fs PRIVATE
libf2fs libsparse z)

set(fsck_main_src_files
f2fs-tools/fsck/dir.c
f2fs-tools/fsck/dict.c
f2fs-tools/fsck/mkquota.c
f2fs-tools/fsck/quotaio.c
f2fs-tools/fsck/quotaio_tree.c
f2fs-tools/fsck/quotaio_v2.c
f2fs-tools/fsck/node.c
f2fs-tools/fsck/segment.c
f2fs-tools/fsck/xattr.c
f2fs-tools/fsck/main.c
f2fs-tools/fsck/mount.c
f2fs-tools/lib/libf2fs.c
f2fs-tools/lib/libf2fs_io.c
f2fs-tools/lib/libf2fs_zoned.c
f2fs-tools/lib/nls_utf8.c
f2fs-tools/fsck/dump.c)

add_executable(sload_f2fs
${fsck_main_src_files}
f2fs-tools/fsck/fsck.c
f2fs-tools/fsck/sload.c
f2fs-tools/fsck/compress.c)

target_compile_definitions(sload_f2fs PRIVATE
${f2fs_tools_defaults}
-DWITH_SLOAD)

target_include_directories(sload_f2fs PRIVATE
f2fs-tools/include
selinux/libselinux/include
core/libsparse/include
core/libcutils/include)

target_link_libraries(sload_f2fs PRIVATE
libsparse libselinux libcutils z
PkgConfig::libpcre2-8
PkgConfig::liblz4)
1 change: 1 addition & 0 deletions vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ install(TARGETS
lpmake
lpunpack
make_f2fs
sload_f2fs
simg2img
e2fsdroid
ext2simg
Expand Down

0 comments on commit ee0e62f

Please sign in to comment.