Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaudill committed Aug 15, 2023
1 parent 406d2fa commit eb6d3ba
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,6 @@ jobs:
cd /usr/local/src
git clone https://github.com/vasi/squashfuse.git
cd squashfuse
# checkout the last commit that we support. FIXME: find a more
# permanent solution (#1696).
git checkout 4465c39
./autogen.sh
./configure --prefix=/usr/local
make
Expand Down
13 changes: 12 additions & 1 deletion bin/ch_fuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void sq_mount(const char *img_path, char *mountpt)
sq.mountpt = mountpt;
T_ (sq.chan = malloc(sizeof(sqfs_ll_chan)));

sq.ll = sqfs_ll_open(img_path, 0);
sq.ll = sqfs_ll_open_(img_path, 0);
Te (sq.ll != NULL, "can't open SquashFS: %s; try ch-run -vv?", img_path);

// sqfs_ll_mount() is squirrely for a couple reasons:
Expand Down Expand Up @@ -255,3 +255,14 @@ void sq_mount(const char *img_path, char *mountpt)
sleep(1);
}
}

/* Explain yourself here. */
sqfs_ll *sqfs_ll_open_(const char *path, size_t offset)
{
#if HAVE_NEW_SQUASHFUSE
return sqfs_ll_open(path, offset, NULL);
#else
return sqfs_ll_open(path, offset);
#endif

}
2 changes: 2 additions & 0 deletions bin/ch_fuse.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* Copyright © Triad National Security, LLC, and others. */

#define _GNU_SOURCE
#include <squashfuse/ll.h>

/** Function prototypes **/

void sq_fork(struct container *c);
sqfs_ll *sqfs_ll_open_(const char *path, size_t offset);
13 changes: 13 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,19 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
[AC_MSG_RESULT([no])
AC_MSG_ERROR([asprintf(3) not found; please report this bug])])

# COMMENT GOES HERE
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#define _GNU_SOURCE
#include <squashfuse/ll.h>
int main(void) {
void* foo = sqfs_ll_open("foo", 0);
printf("%p\n", foo);
}
]])],
[AC_DEFINE([HAVE_NEW_SQUASHFUSE], [0], [blah])],
[AC_DEFINE([HAVE_NEW_SQUASHFUSE], [1], [blah])])

# argp_parse(3), which is included with glibc but not other libc’s, e.g. musl.
AC_MSG_CHECKING([for argp_parse in libc])
AC_LINK_IFELSE([AC_LANG_SOURCE([[
Expand Down

0 comments on commit eb6d3ba

Please sign in to comment.