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

squashfuse using fuse-t #136

Closed
udance4ever opened this issue Aug 12, 2024 · 6 comments
Closed

squashfuse using fuse-t #136

udance4ever opened this issue Aug 12, 2024 · 6 comments

Comments

@udance4ever
Copy link

udance4ever commented Aug 12, 2024

hi! I can compile squashfuse no problem with macfuse installed.

I am wondering if it is possible to compile squashfuse using fuse-t which doesn't depend on kernel extensions?

https://github.com/macos-fuse-t/fuse-t

if I have fuse-t installed (but not macfuse), it doesn't get past configure as it cannot find FUSE.

@vasi
Copy link
Owner

vasi commented Aug 13, 2024

Hi, yes this is possible, I was just looking into it! It's a bit complicated, so I'll answer in two parts.

Easy version

Explanations of complications

  1. There's a serious bug in FUSE-T that prevents squashfuse's readdir method from working. A fix is in progress! The squashfuse master branch has a workaround (at the cost of slightly reduced efficiency), and FUSE-T has the bug fixed in the pre-release above.
  2. FUSE-T uses a different library name. That's why you need the soname flag. We should probably make squashfuse look for this specifically.
  3. FUSE-T's library uses rpath weirdly. That's why you need to pass LDFLAGS manually, so the resulting binaries can find the FUSE-T library. I should probably file a bug against FUSE-T for this.
  4. Building from git needs automake. It's traditional that a release tarball includes the configure script, but git itself doesn't. As the README explains, if you want to build from git you'll need to get autoconf/automake/libtool from eg: homebrew, and then run ./autogen.sh.
  5. FUSE-T and MacFUSE don't provide a way of switching between them. If you have both of them installed, you may have to put extra effort in to make configure specifically choose FUSE-T. I found the following worked: CPPFLAGS='-DFUSE_USE_VERSION=26' LDFLAGS='-Wl,-rpath,/usr/local/lib' ./configure --with-fuse-soname=fuse-t --with-fuse-include=/usr/local/include/fuse --with-fuse-lib=/usr/local/lib. Perhaps we could add a new configure flag to deal with this situation, though I'm not sure how common it is.

@udance4ever
Copy link
Author

thank you so much for the detailed explanations! helps me understand what’s going on :)

I gave this a shot:

user@host foo % squashfuse file.ext.squashfs  file.ext
fuse: mount failed with errro: -1

is there a log I can look at to see why it throws this error?

I don’t know if it’s also a function of being on macOS Sequoia beta - I already have macfuse installed in macOS Sonoma so I figure this is a beta, why not muck with it :)

@vasi
Copy link
Owner

vasi commented Aug 13, 2024

Hmm, I don't have a Sequoia install to test with unfortunately. Is it possible that file.ext does not exist, or is a file rather than a directory? You should invoke squashfuse like squashfuse somefile.squashfs somedir.

If that's not it, you can try running with the -d option to turn on debugging. But I'm not sure it will show anything interesting that early in the mount process.

@udance4ever
Copy link
Author

udance4ever commented Aug 13, 2024

hey good news - I got it to work! 🙌🏼

I ran it again with -d and for some reason instead of throwing an error, the process waited while I gave Terminal permission to access files (paraphrasing, I think that's what it was asking for - I've seen the dialog box before and this is a new install)

after mounting once, I dismounted and tried it again without the -d option and it just works like you would expect.

This is really super not to have to go into Startup Security Utility and not have to permit kernel extensions! 🙏🏼

so glad you got this working. this is definitely the way forward as I wouldn't be surprised if macOS just decides to give kernel extensions the boot any release now!

@vasi
Copy link
Owner

vasi commented Aug 13, 2024

Thanks for testing! I wish I understood better what made it work in the end—do you believe it was the permission dialog?

@udance4ever
Copy link
Author

yeah- I feel ya - always nicer when the world is more predictable! :)

I do think the permission dialog made a difference but I can't explain why running it the first time without the debug option outright failed (-1) and then when I ran it again with the debug flag, all the debug spewed out (looked normal) and the permission dialog box showed up and it just worked!

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

No branches or pull requests

2 participants