Skip to content

Commit

Permalink
Merge pull request #226 from alexlarsson/drop-composefs-from-json
Browse files Browse the repository at this point in the history
Drop composefs-from-json
  • Loading branch information
cgwalters authored Oct 26, 2023
2 parents 6fc12fc + da3df11 commit 5908900
Show file tree
Hide file tree
Showing 28 changed files with 19 additions and 1,152 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,3 @@ Mount options:
- `upperdir`: Specify an upperdir for the overlayfs filesystem.
- `workdir`: Specify an upperdir for the overlayfs filesystem.
- `idmap`: Specify a path to a user namespace that is used as an idmap.

## Experimental user space tools

The directory `tools/` contains some experimental user space tools for working with composefs images.

- `composefs-from-json`: convert from a [CRFS](https://github.com/google/crfs) metadata file to the binary blob.
3 changes: 1 addition & 2 deletions composefs.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ License: GPL-3.0-or-later AND LGPL-2.0-or-later AND Apache-2.0
URL: https://github.com/containers/composefs
Source0: https://github.com/containers/composefs/releases/download/v%{version}/%{name}-%{version}.tar.xz

BuildRequires: gcc automake libtool openssl-devel yajl-devel pandoc fuse3-devel
BuildRequires: gcc automake libtool openssl-devel pandoc fuse3-devel
Requires: %{name}-libs = %{version}-%{release}

%description
Expand Down Expand Up @@ -39,7 +39,6 @@ Library files for %{name}.
%configure \
--disable-static \
--enable-man \
--with-yajl \
--with-fuse
%make_build

Expand Down
38 changes: 0 additions & 38 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -185,44 +185,6 @@ CC_CHECK_FLAGS_APPEND([WARN_CFLAGS], [CFLAGS], [\
])])
AC_SUBST(WARN_CFLAGS)

AC_ARG_WITH(seccomp,
AS_HELP_STRING([--with-seccomp], [Build with seccomp support [default=auto]]),
, with_seccomp=auto)
if test "x$with_seccomp" != "xno"; then
old_LIBS=$LIBS
AC_SEARCH_LIBS(seccomp_rule_add, [seccomp], [have_libseccomp=yes], [have_libseccomp=no])
LIBS=$old_LIBS
if test $have_libseccomp = yes; then
AC_DEFINE(HAVE_LIBSECCOMP, 1, [Define if libseccomp is available])
LIBS_SECCOMP=$ac_cv_search_seccomp_rule_add
AC_SUBST([LIBS_SECCOMP])
elif test "x$with_seccomp" == "xyes"; then
AC_MSG_ERROR([seccomp was requested but it could not be found])
fi
else
have_libseccomp=no
fi
AM_CONDITIONAL([USE_SECCOMP],[test "$have_libseccomp" = "yes"])

AC_ARG_WITH(yajl,
AS_HELP_STRING([--with-yajl], [Build with yajl support [default=auto]]),
, with_yajl=auto)
if test "x$with_yajl" != "xno"; then
old_LIBS=$LIBS
AC_SEARCH_LIBS(yajl_tree_get, [yajl], [have_libyajl=yes], [have_libyajl=no])
LIBS=$old_LIBS
if test $have_libyajl = yes; then
AC_DEFINE(HAVE_LIBYAJL, 1, [Define if libyajl is available])
LIBS_YAJL=$ac_cv_search_yajl_tree_get
AC_SUBST([LIBS_YAJL])
elif test "x$with_yajl" == "xyes"; then
AC_MSG_ERROR([yajl was requested but it could not be found])
fi
else
have_libyajl=no
fi
AM_CONDITIONAL([USE_YAJL],[test "$have_libyajl" = "yes"])

AC_ARG_WITH(fuse,
AS_HELP_STRING([--with-fuse], [Build fuse support [default=auto]]),
, with_fuse=auto)
Expand Down
2 changes: 1 addition & 1 deletion hacking/installdeps.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
set -xeuo pipefail
export DEBIAN_FRONTEND=noninteractive
apt-get install -y automake libtool autoconf autotools-dev git make gcc libyajl-dev libssl-dev libfsverity-dev pkg-config libfuse3-dev python3 libcap2-bin
apt-get install -y automake libtool autoconf autotools-dev git make gcc libssl-dev libfsverity-dev pkg-config libfuse3-dev python3 libcap2-bin
8 changes: 4 additions & 4 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
TEST_ASSETS_SMALL = \
config.json.gz config-with-hard-link.json.gz special.json
config.dump.gz config-with-hard-link.dump.gz special.dump

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

if ENABLE_VALGRIND
VALGRIND_PREFIX=libtool --mode=execute ${VALGRIND} --quiet --leak-check=yes --error-exitcode=42
Expand All @@ -17,7 +17,7 @@ EXTRA_DIST = \
test-random-fuse.sh \
test-checksums.sh \
integration.sh \
$(patsubst %,assets/%,${TEST_ASSETS_SMALL}) $(patsubst %,assets/%.sha256_erofs,${TEST_ASSETS_SMALL})
$(patsubst %,assets/%,${TEST_ASSETS_SMALL}) $(patsubst %,assets/%.sha256,${TEST_ASSETS_SMALL})

check-checksums:
VALGRIND_PREFIX="${VALGRIND_PREFIX}" $(srcdir)/test-checksums.sh "$(builddir)/../tools/" "$(srcdir)/assets" "${TEST_ASSETS}"
Expand Down
Binary file added tests/assets/config-with-hard-link.dump.gz
Binary file not shown.
Binary file removed tests/assets/config-with-hard-link.json.gz
Binary file not shown.
Binary file added tests/assets/config.dump.gz
Binary file not shown.
File renamed without changes.
Binary file removed tests/assets/config.json.gz
Binary file not shown.
Binary file added tests/assets/cs9-x86_64-developer.dump.gz
Binary file not shown.
Binary file removed tests/assets/cs9-x86_64-developer.json.gz
Binary file not shown.
Binary file added tests/assets/cs9-x86_64-minimal.dump.gz
Binary file not shown.
Binary file removed tests/assets/cs9-x86_64-minimal.json.gz
Binary file not shown.
Binary file added tests/assets/f36-x86_64-silverblue.dump.gz
Binary file not shown.
Binary file removed tests/assets/f36-x86_64-silverblue.json.gz
Binary file not shown.
10 changes: 10 additions & 0 deletions tests/assets/special.dump

Large diffs are not rendered by default.

File renamed without changes.
139 changes: 0 additions & 139 deletions tests/assets/special.json

This file was deleted.

6 changes: 3 additions & 3 deletions tests/test-checksums.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ for format in erofs ; do
if [ ! -f $ASSET_DIR/$file ] ; then
continue;
fi
echo Verifying $file with $format
EXPECTED_SHA=$(cat $ASSET_DIR/$file.sha256_${format});
echo Verifying $file
EXPECTED_SHA=$(cat $ASSET_DIR/$file.sha256);
if [[ $file == *.gz ]] ; then
CAT=zcat
else
CAT=cat
fi

$CAT $ASSET_DIR/$file | ${VALGRIND_PREFIX} ${BINDIR}/composefs-from-json --format=$format --out=$tmpfile -
$CAT $ASSET_DIR/$file | ${VALGRIND_PREFIX} ${BINDIR}/mkcomposefs --from-file - $tmpfile
SHA=$(sha256sum $tmpfile | awk "{print \$1}")

# Run fsck.erofs to make sure we're not generating anything weird
Expand Down
7 changes: 0 additions & 7 deletions tools/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ bin_PROGRAMS = mkcomposefs composefs-info
sbin_PROGRAMS = mount.composefs
noinst_PROGRAMS = composefs-dump

if USE_YAJL
noinst_PROGRAMS += composefs-from-json
endif

if USE_FUSE3
noinst_PROGRAMS += composefs-fuse
endif
Expand All @@ -20,9 +16,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_info_SOURCES = composefs-info.c ../libcomposefs/hash.c
composefs_info_CFLAGS = $(AM_CFLAGS) $(COMPOSEFS_HASH_CFLAGS)
composefs_info_LDADD = ../libcomposefs/libcomposefs.la
Expand Down
Loading

0 comments on commit 5908900

Please sign in to comment.