Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go-fuse currently not support macfuse 4.0.0 #379

Closed
chnliyong opened this issue Nov 27, 2020 · 9 comments
Closed

go-fuse currently not support macfuse 4.0.0 #379

chnliyong opened this issue Nov 27, 2020 · 9 comments

Comments

@chnliyong
Copy link

osxfuse changed its name to macfuse since version 4.0.0 released. Below paragraph is copied from changelog:

  • Drop support for deprecated "old style" mount process. Opening a /dev/macfuse device and passing the file descriptor to mount_macfuse is no longer supported ("old style"). mount_macfuse passes the file descriptor to the calling library over a socket ("new style", introduced in version 3.3.0).

In changlog of version 3.3.0, it states this:

  • Implement new style mount process

    When mounting a FUSE volume on Linux, fusermount opens the FUSE device and passes the file descriptor back to libfuse.

    However, on OS X libosxfuse used to be responsible for locating a free FUSE device, opening it, and then passing the file descriptor to mount_osxfuse. For this to work libosxfuse needs to be aware of low level implementation details like the number of registered FUSE devices.

    In order to decouple libosxfuse from the FUSE kernel extension the mount process has been revised to match FUSE on Linux. mount_osxfuse will locate a free FUSE device, open it, and then pass the file descriptor back to libosxfuse.

go-fuse currently seems to depend on this "old style".

@hanwen
Copy link
Owner

hanwen commented Dec 2, 2020

yes, you are probably right. I don't own an OSX machine, so support for OSXFUSE (or MacFUSE) is a bit a spotty.

I would welcome well tested changes to support FUSE on newer versions of OSX.

@llucps
Copy link

llucps commented Dec 12, 2020

I own a macOS machine and I use gocryptfs with OS X Fuse 3.2, so I'm really interested to make the new macFUSE 4 compatible with go-fuse.

How can I help? I'm not a developer but happy to test anything on my machine.

Thanks.

@hanwen
Copy link
Owner

hanwen commented Dec 12, 2020

Thanks for the offer. Let me see if I can find some example code of how to do the new style mounting on OSX.

@hanwen
Copy link
Owner

hanwen commented Dec 12, 2020

do you know of example code that exercises this new style mounting on OSX ?

the other fuse library has simply removed OSX wholesale, bazil/fuse@60eaf8f - it is fairly drastic, but the reasoning is sound. Apple has discontinued the mechanism that lets you build extensions to the kernel.

@llucps
Copy link

llucps commented Dec 12, 2020

Unfortunately I don't.. it seems macFuse source code is not being released anymore...

Someone asked how the new mount protocol works on version 4:

macfuse/macfuse#742

I'm afraid unless something changes.. will be difficult to get go-fuse to work with macFuse 4... :(

it's sad..

@midchildan
Copy link
Contributor

midchildan commented Dec 12, 2020

The userspace library for macFUSE, libfuse, is actually open source because it's forked off GPL'ed code. I did some digging, and here's what I found.

Relevant Commits
The "New Style" Mount

osxfuse/fuse@8afa4ea

Rebranding

This contains path changes and renaming of environment variables.
osxfuse/fuse@0eda6da
osxfuse/fuse@a62ee63

Interesting Parts of the Code Regarding the "New Style" Mount Process

Create a new socket pair
https://github.com/osxfuse/fuse/blob/c6a59bed40bb526c113f861ed49a78b5f224805a/lib/mount_darwin.c#L434

Pass one end of the socket to the mount program via the _FUSE_COMMFD environment variable
https://github.com/osxfuse/fuse/blob/master/lib/mount_darwin.c#L473-L475

Run the mount program:
https://github.com/osxfuse/fuse/blob/c6a59bed40bb526c113f861ed49a78b5f224805a/lib/mount_darwin.c#L488

Wait for the mount program to send the fuse device fd via the socket:
https://github.com/osxfuse/fuse/blob/c6a59bed40bb526c113f861ed49a78b5f224805a/lib/mount_darwin.c#L499
https://github.com/osxfuse/fuse/blob/c6a59bed40bb526c113f861ed49a78b5f224805a/lib/mount_darwin.c#L317

@llucps
Copy link

llucps commented Dec 12, 2020

Thank you @midchildan That's good news I hope! :)

@xsxnet
Copy link

xsxnet commented Mar 22, 2021

@hanwen This commit solved my problem. Would you consider tagging a new semantic version for it ?

@hanwen
Copy link
Owner

hanwen commented Mar 22, 2021

i tagged v2.1.0. HTH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants