diff --git a/Makefile.am b/Makefile.am index 67c17cd..56063d2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -84,6 +84,7 @@ squashfuse_ll_CPPFLAGS = $(ZLIB_CPPFLAGS) $(XZ_CPPFLAGS) $(LZO_CPPFLAGS) \ $(LZ4_CPPFLAGS) $(ZSTD_CPPFLAGS) $(FUSE_CPPFLAGS) squashfuse_ll_LDADD = libsquashfuse_ll_convenience.la $(COMPRESSION_LIBS) $(FUSE_LIBS) +dist_man_MANS += squashfuse_ll.1 pkgconfig_DATA += squashfuse_ll.pc pkginclude_HEADERS += ll.h endif diff --git a/fuseprivate.c b/fuseprivate.c index b9a1018..39657ef 100644 --- a/fuseprivate.c +++ b/fuseprivate.c @@ -64,23 +64,36 @@ void sqfs_usage(char *progname, bool fuse_usage, bool ll_usage) { fprintf(stderr, "Usage: %s [options] ARCHIVE MOUNTPOINT\n", progname ? progname : PACKAGE_NAME); fprintf(stderr, "\n%s options:\n", progname); - fprintf(stderr, " -o offset offset into ARCHIVE to mount\n"); - fprintf(stderr, " -o timeout idle seconds for automatic unmount\n"); + fprintf(stderr, " -o offset=N offset N bytes into ARCHIVE to mount\n"); if (ll_usage) { - fprintf(stderr, " -o uid=N set file owner\n"); - fprintf(stderr, " -o gid=N set file group\n"); + fprintf(stderr, " -o timeout=N idle N seconds for automatic unmount\n"); + fprintf(stderr, " -o uid=N set file owner to uid N\n"); + fprintf(stderr, " -o gid=N set file group to gid N\n"); } if (fuse_usage) { + if (ll_usage) { #if FUSE_USE_VERSION >= 30 - fprintf(stderr, "\nFUSE options:\n"); - fuse_cmdline_help(); + fprintf(stderr, "\nFUSE options:\n"); + fuse_cmdline_help(); #else - struct fuse_args args = FUSE_ARGS_INIT(0, NULL); - fuse_opt_add_arg(&args, ""); /* progname */ - fuse_opt_add_arg(&args, "-ho"); - fprintf(stderr, "\n"); - fuse_parse_cmdline(&args, NULL, NULL, NULL); + struct fuse_args args = FUSE_ARGS_INIT(0, NULL); + fuse_opt_add_arg(&args, ""); /* progname */ + fuse_opt_add_arg(&args, "-ho"); + fprintf(stderr, "\n"); + fuse_parse_cmdline(&args, NULL, NULL, NULL); #endif + } else { + /* Standard FUSE help includes confusing + * multi-threaded options so don't use it + */ + fprintf(stderr, "\nSelection of FUSE options:\n"); + fprintf(stderr," -h --help print help\n"); + fprintf(stderr," -V --version print version\n"); + fprintf(stderr," -d -o debug enable debug output (implies -f)\n"); + fprintf(stderr," -f foreground operation\n"); + fprintf(stderr," -o allow_other allow access by other users\n"); + fprintf(stderr," -o allow_root allow access by the superuser\n"); + } } exit(-2); } diff --git a/squashfuse.1 b/squashfuse.1 index 3af0e5b..6029a91 100644 --- a/squashfuse.1 +++ b/squashfuse.1 @@ -41,13 +41,25 @@ The filesystem can be unmounted using .Xr umount 8 or .Xr fusermount 8 . +The +.Nm +implementation is single-threaded. .Pp -A selection of FUSE options: +Options supported by the +.Xr fuse 8 +library are supported. +In addition the following option is supported: +.Bl -tag -width -indent +.It Fl o Cm offset=N +offset N bytes into archive to mount +.El +.Pp +Here is a selection of generally useful FUSE library options: .Bl -tag -width -indent -.It Fl V, -version -show FUSE version .It Fl h, -help print help +.It Fl V, -version +show FUSE version .It Fl d, o Cm debug enable debug output (implies .Fl f ) @@ -59,6 +71,7 @@ allow access by other users allow access by the superuser .El .Sh SEE ALSO +.Xr fuse 8 , .Xr fusermount 8 , .Xr mount 8 , .Xr umount 8 diff --git a/squashfuse_ll.1 b/squashfuse_ll.1 new file mode 100644 index 0000000..7b4ab0d --- /dev/null +++ b/squashfuse_ll.1 @@ -0,0 +1,62 @@ +.\"Copyright (c) 2012 Dave Vasilevsky +.\"All rights reserved. +.\" +.\"Redistribution and use in source and binary forms, with or without +.\"modification, are permitted provided that the following conditions +.\"are met: +.\"1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\"2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\"THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR +.\"IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\"OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\"IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, +.\"INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\"NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\"DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\"THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\"(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\"THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.Dd June 30, 2023 +.Dt squashfuse_ll 1 +.Os +.Sh NAME +.Nm squashfuse_ll +.Nd mount a SquashFS archive with low-level FUSE +.Sh SYNOPSIS +.Nm +.Op Fl o Ar options +.Ar archive +.Ar mountpoint +.Sh DESCRIPTION +.Nm +mounts the SquashFS filesystem using FUSE +.Ar archive +on the directory +.Ar mountpoint . +It is generally compatible with +.Xr squashfuse 1 +but it uses the higher performance low-level FUSE interface +and it supports multi-threading. +.Pp +See the +.Xr squashfuse 1 +man page for options. Note that some of the +.Xr fuse 8 +library options are only supported on high-level FUSE and so do not apply. +These additional options are also supported, including some that are normally +supported only in high-level FUSE: +.Bl -tag -width -indent +.It Fl o Cm timeout=N +idle N seconds for automatic unmount +.It Fl o Cm uid=N +set file owner to uid N +.It Fl o Cm gid=N +set file group to gid N +.El +.Sh SEE ALSO +.Xr squashfuse 1 , +.Xr fuse 8