Skip to content

Commit

Permalink
check osxfuse version. Fixes #202.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbenet committed Oct 31, 2014
1 parent b02dbc4 commit ca1bf26
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cmd/ipfs/mount_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ package main

import (
"fmt"
"runtime"
"strings"
"syscall"

"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/gonuts/flag"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/commander"
Expand Down Expand Up @@ -33,6 +36,9 @@ func init() {
}

func mountCmd(c *commander.Command, inp []string) error {
if err := osxFuseCheck(); err != nil {
return err
}

cc, err := setupCmdContext(c, true)
if err != nil {
Expand Down Expand Up @@ -92,3 +98,23 @@ func mountIpns(node *core.IpfsNode, nsdir, fsdir string) <-chan error {

return done
}

func osxFuseCheck() error {
// on OSX, check FUSE version.
if runtime.GOOS != "darwin" {
return nil
}

ov, err := syscall.Sysctl("osxfuse.version.number")
if err != nil {
return err
}

if strings.HasPrefix(ov, "2.7.") || strings.HasPrefix(ov, "2.8.") {
return nil
}

return fmt.Errorf("osxfuse version %s not supported.\n%s\n%s", ov,
"Older versions of osxfuse have kernel panic bugs; please upgrade!",
"https://github.com/jbenet/go-ipfs/issues/177")
}

0 comments on commit ca1bf26

Please sign in to comment.