Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

99.1. fuse-3.18.3

The Filesystem in Userspace library (libfuse 3) and the setuid fusermount3 mount helper

Version 3.18.3, release 1
Shelf filesystem — Filesystem utilities, FUSE, and network or encrypted filesystems
Phase 41_system (System), 78 of 1047 in build order
Licence LGPL-2.1-only AND GPL-2.0-only
Homepage https://github.com/libfuse/libfuse
Build time 0.1 SBU
Installed size 639.3 KiB in 19 files
Recipe ports/core/filesystem/fuse/kpkgbuild

About

FUSE lets an ordinary program serve a filesystem: the kernel passes each file operation on a FUSE mount to the process behind it, through /dev/fuse. This port is libfuse 3, the library such a program is written against, and fusermount3, the setuid helper that performs the mount and unmount for a user who may not call mount(2) themselves. sshfs, gocryptfs, fuse-overlayfs, gvfs, the document portal, rclone mount and restic mount all go through it; see setuid binaries.

Sources

Dependencies

Depends on: meson, ninja, eudev, liburing, numactl.

Required by (24): afflib, android-file-transfer, deja-dup, e2fsprogs, freerdp, fuse-overlayfs, gocryptfs, gvfs, ifuse, kio-fuse, libewf, libnbd, libvhdi, libvmdk, libvslvm, partclone, plasma-vault, qemu, rclone, restic, sshfs, veracrypt, wimlib, xdg-desktop-portal.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install fuse'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/filesystem/fuse.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/filesystem/fuse
echo 'bcd19582c5e30f7fe45dd86a5540e998590aa01903afc7ebcbeea6c8ac5421ee  fuse-3.18.3.tar.gz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/fuse
SRC=$SRC_ROOT/fuse-3.18.3
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf fuse-3.18.3.tar.gz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

meson setup build --buildtype=release \
	--prefix=/usr --sysconfdir=/etc --libdir=lib --libexecdir=/usr/lib \
	-Dinitscriptdir= \
	-Dudevrulesdir=/lib/udev/rules.d \
	-Denable-io-uring=true \
	-Dexamples=false \
	-Dtests=false
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
readelf -d "$PKG"/usr/lib/libfuse3.so.*.*.* | grep -q 'NEEDED.*\[liburing\.so'

rm -rf "$PKG/dev"

ln -s fusermount3 "$PKG/usr/bin/fusermount"

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/fuse, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf fuse-3.18.3-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/fuse, and runs the triggers its paths call for.

Contents

Installed programs: fusermount, fusermount3, mount.fuse3.

Installed libraries: libfuse3.so.

Installed directories: /usr/include/fuse3, /usr/share/licenses/fuse.

Short descriptions

fusermount3 mount and unmount FUSE filesystems
mount.fuse3 configuration and mount options for FUSE file systems
fuse3.pc Filesystem in Userspace

Notes

The io_uring transport is built only when meson finds both liburing and libnuma (from numactl) and a test program using IORING_SETUP_SQE128 links. When any of those fails, configure turns the transport off without an error, whatever -Denable-io-uring says. numactl is in depends for that libnuma, and the readelf -d … | grep -q 'NEEDED.*\[liburing\.so' line after the install stops the build when libfuse3.so does not link liburing, instead of shipping a library without the transport.

The install script, with upstream’s default useroot, makes fusermount3 owned by root and setuid, and creates a /dev/fuse device node under $PKG. build.sh removes $PKG/dev: the running system’s /dev is a devtmpfs the kernel fills, and the udev rule gives the node its mode. The setuid bit stays.

fusermount is a symbolic link to fusermount3, because some FUSE clients (restic’s among them) run the unversioned name.