mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-22 00:00:03 +03:00
Make fuse3 support optional and document.
The experimental fuse3 support is not complete yet, and fuse3 is new and still difficult to install on some platforms. Make it optional at compile time, and default to off. Signed-off-by: Justin Husted <sigstop@gmail.com>
This commit is contained in:
parent
1f7098c222
commit
a00998c4cd
30
INSTALL
30
INSTALL
@ -1,3 +1,4 @@
|
||||
-- Getting started --
|
||||
|
||||
Dependencies:
|
||||
|
||||
@ -20,3 +21,32 @@ On debian, you can install these with
|
||||
uuid-dev zlib1g-dev valgrind
|
||||
|
||||
Then, just make && make install
|
||||
|
||||
|
||||
-- Experimental features --
|
||||
|
||||
Experimental fuse support is currently disabled by default. Fuse support is at
|
||||
an early stage and may corrupt your filesystem, so it should only be used for
|
||||
testing. To enable, you'll also need to add:
|
||||
|
||||
* libfuse3
|
||||
|
||||
On debian:
|
||||
apt install -y libfuse3-dev
|
||||
|
||||
Then, make using the BCACHEFS_FUSE environment variable:
|
||||
|
||||
BCACHEFS_FUSE=1 make &&
|
||||
|
||||
|
||||
-- Tests --
|
||||
|
||||
Some tests are available to validate the "bcachefs" binary. The tests depend
|
||||
on python3 pytest.
|
||||
|
||||
On debian:
|
||||
apt install -u python3-pytest
|
||||
|
||||
Then, you can run the tests via:
|
||||
|
||||
make check
|
||||
|
6
Makefile
6
Makefile
@ -38,7 +38,11 @@ ifdef D
|
||||
CFLAGS+=-DCONFIG_BCACHEFS_DEBUG=y
|
||||
endif
|
||||
|
||||
PKGCONFIG_LIBS="blkid uuid liburcu libsodium zlib liblz4 libzstd fuse3"
|
||||
PKGCONFIG_LIBS="blkid uuid liburcu libsodium zlib liblz4 libzstd"
|
||||
ifdef BCACHEFS_FUSE
|
||||
PKGCONFIG_LIBS+="fuse3"
|
||||
CFLAGS+=-DBCACHEFS_FUSE
|
||||
endif
|
||||
|
||||
PKGCONFIG_CFLAGS:=$(shell $(PKG_CONFIG) --cflags $(PKGCONFIG_LIBS))
|
||||
ifeq (,$(PKGCONFIG_CFLAGS))
|
||||
|
@ -203,8 +203,10 @@ int main(int argc, char *argv[])
|
||||
if (!strcmp(cmd, "setattr"))
|
||||
return cmd_setattr(argc, argv);
|
||||
|
||||
#ifdef BCACHEFS_FUSE
|
||||
if (!strcmp(cmd, "fusemount"))
|
||||
return cmd_fusemount(argc, argv);
|
||||
#endif
|
||||
|
||||
if (!strcmp(cmd, "--help")) {
|
||||
usage();
|
||||
|
@ -1,3 +1,5 @@
|
||||
#ifdef BCACHEFS_FUSE
|
||||
|
||||
#include <errno.h>
|
||||
#include <float.h>
|
||||
#include <getopt.h>
|
||||
@ -1262,3 +1264,5 @@ out:
|
||||
|
||||
return ret ? 1 : 0;
|
||||
}
|
||||
|
||||
#endif /* BCACHEFS_FUSE */
|
||||
|
@ -2,9 +2,13 @@
|
||||
#
|
||||
# Tests of the fuse mount functionality.
|
||||
|
||||
import pytest
|
||||
import os
|
||||
import util
|
||||
|
||||
pytestmark = pytest.mark.skipif(
|
||||
not util.have_fuse(), reason="bcachefs not built with fuse support.")
|
||||
|
||||
def test_mount(bfuse):
|
||||
bfuse.mount()
|
||||
bfuse.unmount()
|
||||
|
@ -4,6 +4,7 @@ import os
|
||||
import pytest
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
@ -208,3 +209,7 @@ class BFuse(threading.Thread):
|
||||
assert self.returncode == 0
|
||||
assert len(self.stdout) > 0
|
||||
assert len(self.stderr) == 0
|
||||
|
||||
def have_fuse():
|
||||
res = run(BCH_PATH, 'fusemount', valgrind=False)
|
||||
return "Please supply a mountpoint." in res.stdout
|
||||
|
Loading…
Reference in New Issue
Block a user