Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
jacobsa-fuse
Commits
d66bad87
Commit
d66bad87
authored
Oct 16, 2016
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Plain Diff
Unexport osxfuse-related code.
parents
eadfaa07
8b5caee5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
56 deletions
+42
-56
mount_config.go
mount_config.go
+0
-43
mount_darwin.go
mount_darwin.go
+42
-13
No files found.
mount_config.go
View file @
d66bad87
...
...
@@ -135,14 +135,6 @@ type MountConfig struct {
// default name involving the string 'osxfuse' is used.
VolumeName
string
// OS X only.
//
// OSXFUSELocations sets where to look for OSXFUSE files. The arguments are
// all the possible locations. The previous locations are replaced.
//
// Without this option, OSXFUSELocationV3 and OSXFUSELocationV2 are used.
OSXFUSELocations
[]
OSXFUSEPaths
// Additional key=value options to pass unadulterated to the underlying mount
// command. See `man 8 mount`, the fuse documentation, etc. for
// system-specific information.
...
...
@@ -238,38 +230,3 @@ func (c *MountConfig) toOptionsString() string {
return
strings
.
Join
(
components
,
","
)
}
// OSXFUSEPaths describes the paths used by an installed OSXFUSE version.
// See OSXFUSELocationV3 for typical values.
type
OSXFUSEPaths
struct
{
// Prefix for the device file. At mount time, an incrementing number is
// suffixed until a free FUSE device is found.
DevicePrefix
string
// Path of the load helper, used to load the kernel extension if no device
// files are found.
Load
string
// Path of the mount helper, used for the actual mount operation.
Mount
string
// Environment variable used to pass the path to the executable calling the
// mount helper.
DaemonVar
string
}
// Default paths for OSXFUSE. See OSXFUSELocations.
var
(
OSXFUSELocationV3
=
OSXFUSEPaths
{
DevicePrefix
:
"/dev/osxfuse"
,
Load
:
"/Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse"
,
Mount
:
"/Library/Filesystems/osxfuse.fs/Contents/Resources/mount_osxfuse"
,
DaemonVar
:
"MOUNT_OSXFUSE_DAEMON_PATH"
,
}
OSXFUSELocationV2
=
OSXFUSEPaths
{
DevicePrefix
:
"/dev/osxfuse"
,
Load
:
"/Library/Filesystems/osxfusefs.fs/Support/load_osxfusefs"
,
Mount
:
"/Library/Filesystems/osxfusefs.fs/Support/mount_osxfusefs"
,
DaemonVar
:
"MOUNT_FUSEFS_DAEMON_PATH"
,
}
)
mount_darwin.go
View file @
d66bad87
...
...
@@ -17,11 +17,48 @@ var errNoAvail = errors.New("no available fuse devices")
var
errNotLoaded
=
errors
.
New
(
"osxfuse is not loaded"
)
// errOSXFUSENotFound is returned from Mount when the OSXFUSE installation is
// not detected.
//
// Make sure OSXFUSE is installed, or see OSXFUSELocations for customization.
// not detected. Make sure OSXFUSE is installed.
var
errOSXFUSENotFound
=
errors
.
New
(
"cannot locate OSXFUSE"
)
// osxfuseInstallation describes the paths used by an installed OSXFUSE
// version.
type
osxfuseInstallation
struct
{
// Prefix for the device file. At mount time, an incrementing number is
// suffixed until a free FUSE device is found.
DevicePrefix
string
// Path of the load helper, used to load the kernel extension if no device
// files are found.
Load
string
// Path of the mount helper, used for the actual mount operation.
Mount
string
// Environment variable used to pass the path to the executable calling the
// mount helper.
DaemonVar
string
}
var
(
osxfuseInstallations
=
[]
osxfuseInstallation
{
// v3
{
DevicePrefix
:
"/dev/osxfuse"
,
Load
:
"/Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse"
,
Mount
:
"/Library/Filesystems/osxfuse.fs/Contents/Resources/mount_osxfuse"
,
DaemonVar
:
"MOUNT_OSXFUSE_DAEMON_PATH"
,
},
// v2
{
DevicePrefix
:
"/dev/osxfuse"
,
Load
:
"/Library/Filesystems/osxfusefs.fs/Support/load_osxfusefs"
,
Mount
:
"/Library/Filesystems/osxfusefs.fs/Support/mount_osxfusefs"
,
DaemonVar
:
"MOUNT_FUSEFS_DAEMON_PATH"
,
},
}
)
func
loadOSXFUSE
(
bin
string
)
error
{
cmd
:=
exec
.
Command
(
bin
)
cmd
.
Dir
=
"/"
...
...
@@ -136,16 +173,8 @@ func mount(
dir
string
,
cfg
*
MountConfig
,
ready
chan
<-
error
)
(
dev
*
os
.
File
,
err
error
)
{
// get OSXFUSE locations
locations
:=
cfg
.
OSXFUSELocations
if
locations
==
nil
{
locations
=
[]
OSXFUSEPaths
{
OSXFUSELocationV3
,
OSXFUSELocationV2
,
}
}
for
_
,
loc
:=
range
locations
{
// Find the version of osxfuse installed on this machine.
for
_
,
loc
:=
range
osxfuseInstallations
{
if
_
,
err
:=
os
.
Stat
(
loc
.
Mount
);
os
.
IsNotExist
(
err
)
{
// try the other locations
continue
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment