Filesystem in Userspace (FUSE) is a software interface for Unix and Unix-like computer operating systems that lets non-privileged users create their own file systems without editing kernel code, or it was supposed to be.
Actually this is not so true in Android, since only root user are allowed to use it. Nor relaxing permissions of /dev/fuse, nor setting the set ID bit of the libs and binaries makes any difference. Blame Google for this.
Unfortunately, libfuse2 doesn't come with a test suit, so the building steps bellow refers to the release build type. To test it, use some other program that uses it. Like CryFS and EncFS
As discussed here, some patches are necessary as a workaround to some pthread functions not available in the Android SDK. The strategy used was to use an atomic watch variable and check if it's set right before the so called cancellation points functions. This mimics as close as possible the pthread_cancel behavior.
These are the libs it depends upon:
libiconv.so
libdl.so
libc.so
All the steps above were executed from within termux using the latest stable version of libfuse v2. First download the patches, then run:
$ wget https://github.com/libfuse/libfuse/releases/download/fuse-2.9.9/fuse-2.9.9.tar.gz
$ tar xf fuse-2.9.9.tar.gz && cd fuse-2.9.9
$ patch lib/fuse.c ../fuse.c.patch
$ patch lib/fuse_loop_mt.c ../fuse_loop_mt.c.patch
$ MOUNT_FUSE_PATH=/data/data/com.termux/files/usr/bin UDEV_RULES_PATH=/data/data/com.termux/files/usr/etc/udev/rules.d INIT_D_PATH=/data/data/com.termux/files/usr/etc/init.d ./configure --prefix=/data/data/com.termux/files/usr/ --disable-example --disable-mtab
$ make -j8
$ make install-strip
So far, everything seems to be working as expected. This is the list of files added to the system when installed:
Package description
Filesystem in Userspace (FUSE) is a software interface for Unix and Unix-like computer operating systems that lets non-privileged users create their own file systems without editing kernel code, or it was supposed to be.
Actually this is not so true in Android, since only root user are allowed to use it. Nor relaxing permissions of /dev/fuse, nor setting the set ID bit of the libs and binaries makes any difference. Blame Google for this.
Here's the Ubuntu package page for reference: https://packages.ubuntu.com/focal/libfuse2
Link to home page and sources
Additional information
Unfortunately, libfuse2 doesn't come with a test suit, so the building steps bellow refers to the release build type. To test it, use some other program that uses it. Like CryFS and EncFS
As discussed here, some patches are necessary as a workaround to some pthread functions not available in the Android SDK. The strategy used was to use an atomic watch variable and check if it's set right before the so called cancellation points functions. This mimics as close as possible the pthread_cancel behavior.
These are the libs it depends upon:
All the steps above were executed from within termux using the latest stable version of libfuse v2. First download the patches, then run:
So far, everything seems to be working as expected. This is the list of files added to the system when installed:
Attachments
fuse.c.patch.txt fuse_loop_mt.c.patch.txt