示例#1
0
// GetPlatformSpecificMountOptionsForTest makes cross-platform tests work
func GetPlatformSpecificMountOptionsForTest() []fuse.MountOption {
	// For now, test with either kbfuse or OSXFUSE for now.
	// TODO: Consider mandate testing with kbfuse?
	return []fuse.MountOption{
		fuse.OSXFUSELocations(kbfusePath, fuse.OSXFUSELocationV3),
	}
}
示例#2
0
func getPlatformSpecificMountOptions(dir string, platformParams PlatformParams) ([]fuse.MountOption, error) {
	options := []fuse.MountOption{}

	var locationOption fuse.MountOption
	if platformParams.UseSystemFuse {
		// Only allow osxfuse 3.x.
		locationOption = fuse.OSXFUSELocations(fuse.OSXFUSELocationV3)
	} else {
		// Only allow kbfuse.
		locationOption = fuse.OSXFUSELocations(kbfusePath)
	}
	options = append(options, locationOption)

	// Volume name option is only used on OSX (ignored on other platforms).
	volName, err := volumeName(dir)
	if err != nil {
		return nil, err
	}

	options = append(options, fuse.VolumeName(volName))

	return options, nil
}
示例#3
0
func getPlatformSpecificMountOptions(dir string) ([]fuse.MountOption, error) {
	options := []fuse.MountOption{}

	// Add kbfuse support.
	kbfusePath := fuse.OSXFUSEPaths{
		DevicePrefix: "/dev/kbfuse",
		Load:         "/Library/Filesystems/kbfuse.fs/Contents/Resources/load_kbfuse",
		Mount:        "/Library/Filesystems/kbfuse.fs/Contents/Resources/mount_kbfuse",
		DaemonVar:    "MOUNT_KBFUSE_DAEMON_PATH",
	}
	// Allow both kbfuse and osxfuse 3.x locations by default.
	options = append(options, fuse.OSXFUSELocations(kbfusePath, fuse.OSXFUSELocationV3))

	// Volume name option is only used on OSX (ignored on other platforms).
	volName, err := volumeName(dir)
	if err != nil {
		return nil, err
	}

	options = append(options, fuse.VolumeName(volName))

	return options, nil
}