[HaikuPorts-devs] FUSE on Haiku

Ingo Weinhold ingo_weinhold at gmx.de
Sat Jun 16 08:05:41 PDT 2012

On 2012-06-16 at 05:33:06 [+0200], Mark Watts <miraiwarren at gmail.com> wrote:
> I'm looking for FUSE on Haiku, but haven't found it. I had heard something
> about userlandfs and found this:
> http://cgit.haiku-os.org/haiku/tree/src/add-ons/kernel/file_systems/userlandfs
> .

Yes, the FUSE support is in subdirectory server/fuse.

> If this userlandfs provides FUSE capability, I would like to enable it. Is
> it available by compiling Haiku?

Yes. You must build Haiku with the UserlandFS optional package enabled (e.g. 
add "AddOptionalHaikuImagePackages UserlandFS ;" to your UserBuildConfig). The 
package cannot be added afterwards. The FUSE interface is included. The FUSE 
headers are installed in /boot/develop/headers/userlandfs/fuse.

To build the client file system you'll have to link against 
libuserlandfs_fuse.so (instead of the usual FUSE library). Moreover it is 
necessary to enable the POSIX error mapper, since the FUSE interface requires 
POSIX compatible (i.e. non-negative) error codes. You do that by defining the 
macro B_USE_POSITIVE_POSIX_ERRORS -- e.g. by adding it to the CPPFLAGS (not 
sure, maybe also to CFLAGS) before invoking configure (assuming the build 
system is autotools based) -- and link against libposix_error_mapper.a -- e.g. 
add to LIBS environment variable (as -lposix_error_mapper).

To use the file system, copy/move the client FS executable to the usual add-ons 
directory for userlandfs. IIRC that's /boot/home/config/add-ons/userlandfs/. 
Mount with "mount -t userlandfs -p <name-of-client-FS> ...". You can pass 
arguments to the client FS by adding them to the argument of the -p option 
after the client FS name (as one string, like: -p "foofs arg1 arg2"). To get 
debug output run the userlandfs server manually in a terminal before mounting 
("userlandfs_server <name-of-client-FS>"). You'll also have to do that, if the 
client FS requires input like the password for sshfs.

Please note that the FUSE interface is highly experimental and not particularly 
well tested. I played a bit with sshfs back when I wrote it. It seemed to work, 
but got confused pretty soon. So be careful. Since it hasn't been touched for 3 
years, the FUSE interface won't be up to date anymore either. Patches to 
improve the situation are very welcome.

> What configuration options?

If you mean supported FUSE parameters, then I'm afraid none.

CU, Ingo

More information about the haikuports-devs mailing list