Skip to content

Commit

Permalink
switch to using fuse3 instead of fuse2
Browse files Browse the repository at this point in the history
  • Loading branch information
jstaf committed Jan 14, 2024
1 parent a7a5e3d commit db572c8
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ test: onedriver onedriver-launcher dmel.fa
# will literally purge everything: all built artifacts, all logs, all tests,
# all files tests depend on, all auth tokens... EVERYTHING
clean:
fusermount -uz mount/ || true
fusermount3 -uz mount/ || true
rm -f *.db *.rpm *.deb *.dsc *.changes *.build* *.upload *.xz filelist.txt .commit
rm -f *.log *.fa *.gz *.test vgcore.* onedriver onedriver-headless onedriver-launcher .auth_tokens.json
rm -rf util-linux-*/ onedriver-*/ vendor/ build/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ mkdir mount
ls -l mount

# unmount the filesystem
fusermount -uz mount
fusermount3 -uz mount
# you can also just "ctrl-c" onedriver to unmount it
```

Expand Down Expand Up @@ -231,7 +231,7 @@ filesystem" indicates that your computer is currently offline.)

If the filesystem appears to hang or "freeze" indefinitely, its possible the
fileystem has crashed. To resolve this, just restart the program by unmounting
and remounting things via the GUI or by running `fusermount -uz $MOUNTPOINT` on
and remounting things via the GUI or by running `fusermount3 -uz $MOUNTPOINT` on
the command-line.

If you really want to go back to a clean slate, onedriver can be completely
Expand Down
2 changes: 1 addition & 1 deletion cmd/onedriver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func main() {
})
if err != nil {
log.Fatal().Err(err).Msgf("Mount failed. Is the mountpoint already in use? "+
"(Try running \"fusermount -uz %s\")\n", mountpoint)
"(Try running \"fusermount3 -uz %s\")\n", mountpoint)
}

// setup signal handler for graceful unmount on signals like sigint
Expand Down
4 changes: 2 additions & 2 deletions fs/offline/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestMain(m *testing.M) {

// attempt to unmount regardless of what happens (in case previous tests
// failed and didn't clean themselves up)
exec.Command("fusermount", "-uz", mountLoc).Run()
exec.Command("fusermount3", "-uz", mountLoc).Run()
os.Mkdir(mountLoc, 0755)

auth = graph.Authenticate(graph.AuthConfig{}, ".auth_tokens.json", false)
Expand Down Expand Up @@ -76,7 +76,7 @@ func TestMain(m *testing.M) {

if server.Unmount() != nil {
log.Error().Msg("Failed to unmount test fuse server, attempting lazy unmount")
exec.Command("fusermount", "-zu", "mount").Run()
exec.Command("fusermount3", "-zu", "mount").Run()
}
fmt.Println("Successfully unmounted fuse server!")
os.Exit(code)
Expand Down
4 changes: 2 additions & 2 deletions fs/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestMain(m *testing.M) {
os.Chdir("..")
// attempt to unmount regardless of what happens (in case previous tests
// failed and didn't clean themselves up)
exec.Command("fusermount", "-uz", mountLoc).Run()
exec.Command("fusermount3", "-uz", mountLoc).Run()
os.Mkdir(mountLoc, 0755)
// wipe all cached data from previous tests
os.RemoveAll(testDBLoc)
Expand Down Expand Up @@ -116,7 +116,7 @@ func TestMain(m *testing.M) {
// unmount
if server.Unmount() != nil {
log.Error().Msg("Failed to unmount test fuse server, attempting lazy unmount")
exec.Command("fusermount", "-zu", "mount").Run()
exec.Command("fusermount3", "-zu", "mount").Run()
}
fmt.Println("Successfully unmounted fuse server!")
os.Exit(code)
Expand Down
2 changes: 1 addition & 1 deletion fs/signal_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func UnmountHandler(signal <-chan os.Signal, server *fuse.Server) {
err := server.Unmount()
if err != nil {
log.Error().Err(err).Msg("Failed to unmount filesystem cleanly! " +
"Run \"fusermount -uz /MOUNTPOINT/GOES/HERE\" to unmount.")
"Run \"fusermount3 -uz /MOUNTPOINT/GOES/HERE\" to unmount.")
}

os.Exit(128)
Expand Down
2 changes: 1 addition & 1 deletion onedriver.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ BuildRequires: git
BuildRequires: gcc
BuildRequires: pkg-config
BuildRequires: webkit2gtk3-devel
Requires: fuse
Requires: fuse3

%description
Onedriver is a native Linux filesystem for Microsoft Onedrive. Files and
Expand Down
5 changes: 2 additions & 3 deletions pkg/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ Source: onedriver
Section: utils
Priority: optional
Maintainer: Jeff Stafford <jeff.stafford@protonmail.com>
Build-Depends:
golang (>= 1.15), gcc, pkg-config, libwebkit2gtk-4.0-dev, git, debhelper
Build-Depends: golang (>= 1.15), gcc, pkg-config, libwebkit2gtk-4.0-dev, git, debhelper
Standards-Version: 4.4.1
Homepage: https://github.com/jstaf/onedriver
#Vcs-Browser: https://github.com/jstaf/onedriver
#Vcs-Git: https://github.com/jstaf/onedriver.git

Package: onedriver
Architecture: any
Depends: libwebkit2gtk-4.0-37, fuse
Depends: libwebkit2gtk-4.0-37, fuse3
Suggests: systemd
Description:
A native Linux filesystem for Microsoft Onedrive Onedriver is a native Linux
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/onedriver.1
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ It's possible that there may be a deadlock or segfault that I haven't caught in
my tests. If this happens, the onedriver filesystem and subsequent ops may hang
indefinitely (ops will hang while the kernel waits for the dead onedriver
process to respond). When this happens, you can cleanly unmount the filesystem
with: \fBfusermount -uz $MOUNTPOINT\fR
with: \fBfusermount3 -uz $MOUNTPOINT\fR


In the event that you want to reset onedriver completely (wipe all local state)
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/onedriver@.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Description=onedriver

[Service]
ExecStart=/usr/bin/onedriver %f
ExecStopPost=/usr/bin/fusermount -uz /%I
ExecStopPost=/usr/bin/fusermount3 -uz /%I
Restart=on-abnormal
RestartSec=3
RestartForceExitStatus=2
Expand Down

0 comments on commit db572c8

Please sign in to comment.