Skip to content

Commit

Permalink
Add examples/ folder, move non-core bits there
Browse files Browse the repository at this point in the history
The core of composefs today is the `mount.composefs` and
`mkcomposefs` tools.

Let's move the other stuff into a separate subdirectory to make
this clearer.  These tools are not installed with `make install`
even before this.

In the future I'd like to more strongly decouple these examples
even more.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Jun 16, 2023
1 parent 58f326a commit 9f31696
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 26 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/Makefile
libcomposefs/Makefile
tools/Makefile
examples/Makefile
Makefile.in
aclocal.m4
autom4te.cache
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SUBDIRS=libcomposefs tools
SUBDIRS=libcomposefs tools examples

EXTRA_DIST=\
composefs.pc.in \
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ AC_CONFIG_FILES([
Makefile
libcomposefs/Makefile
tools/Makefile
examples/Makefile
composefs.spec
composefs.pc
])
Expand Down
1 change: 1 addition & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
composefs-from-json
28 changes: 28 additions & 0 deletions examples/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
noinst_PROGRAMS =

if USE_YAJL
noinst_PROGRAMS += composefs-from-json
endif

AM_CFLAGS = $(WARN_CFLAGS) -I$(top_srcdir)/

composefs_from_json_SOURCES = composefs-from-json.c read-file.c read-file.h
composefs_from_json_LDADD = ../libcomposefs/libcomposefs.la $(LIBS_YAJL) $(LIBCRYPTO_LIBS) $(LIBS_SECCOMP)

TEST_ASSETS_SMALL = \
config.json.gz config-with-hard-link.json.gz

TEST_ASSETS = ${TEST_ASSETS_SMALL} \
cs9-x86_64-developer.json.gz cs9-x86_64-minimal.json.gz \
f36-x86_64-silverblue.json.gz

if ENABLE_VALGRIND
WRITER_JSON_PREFIX=libtool --mode=execute ${VALGRIND} --quiet --leak-check=yes --error-exitcode=42
endif

EXTRA_DIST = test-checksums.sh $(patsubst %,test-assets/%,${TEST_ASSETS_SMALL}) $(patsubst %,test-assets/%.sha256_erofs,${TEST_ASSETS_SMALL})

check-checksums:
$(srcdir)/test-checksums.sh "${WRITER_JSON_PREFIX} $(builddir)/composefs-from-json" "$(srcdir)/test-assets" "${TEST_ASSETS}"

check: check-checksums
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions tools/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ dump
mkcomposefs
writer-json
mount.composefs
composefs-fuse
25 changes: 0 additions & 25 deletions tools/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ bin_PROGRAMS = mkcomposefs
sbin_PROGRAMS = mount.composefs
noinst_PROGRAMS =

if USE_YAJL
noinst_PROGRAMS += composefs-from-json
endif

if USE_FUSE3
noinst_PROGRAMS += composefs-fuse
endif
Expand All @@ -18,27 +14,6 @@ mkcomposefs_LDADD = ../libcomposefs/libcomposefs.la $(LIBCRYPTO_LIBS)
mount_composefs_SOURCES = mountcomposefs.c
mount_composefs_LDADD = ../libcomposefs/libcomposefs.la $(LIBCRYPTO_LIBS)

composefs_from_json_SOURCES = composefs-from-json.c read-file.c read-file.h
composefs_from_json_LDADD = ../libcomposefs/libcomposefs.la $(LIBS_YAJL) $(LIBCRYPTO_LIBS) $(LIBS_SECCOMP)

composefs_fuse_SOURCES = cfs-fuse.c
composefs_fuse_LDADD = ../libcomposefs/libcomposefs.la $(FUSE3_LIBS)
composefs_fuse_CFLAGS = $(FUSE3_CFLAGS)

TEST_ASSETS_SMALL = \
config.json.gz config-with-hard-link.json.gz

TEST_ASSETS = ${TEST_ASSETS_SMALL} \
cs9-x86_64-developer.json.gz cs9-x86_64-minimal.json.gz \
f36-x86_64-silverblue.json.gz

if ENABLE_VALGRIND
WRITER_JSON_PREFIX=libtool --mode=execute ${VALGRIND} --quiet --leak-check=yes --error-exitcode=42
endif

EXTRA_DIST = test-checksums.sh $(patsubst %,test-assets/%,${TEST_ASSETS_SMALL}) $(patsubst %,test-assets/%.sha256_erofs,${TEST_ASSETS_SMALL})

check-checksums:
$(srcdir)/test-checksums.sh "${WRITER_JSON_PREFIX} $(builddir)/composefs-from-json" "$(srcdir)/test-assets" "${TEST_ASSETS}"

check: check-checksums

0 comments on commit 9f31696

Please sign in to comment.