Skip to content

Commit

Permalink
guest: upload fuse module loading for FreeBSD
Browse files Browse the repository at this point in the history
Newer FreeBSD calls it "fusefs", not just "fuse".

Fixes #124
  • Loading branch information
dustymabe committed Jun 20, 2022
1 parent dba8c30 commit cc887ad
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/vagrant-sshfs/cap/guest/freebsd/sshfs_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@ module Cap
class SSHFSClient
def self.sshfs_install(machine)
machine.communicate.sudo("pkg install -y fusefs-sshfs")
machine.communicate.sudo("kldload fuse")
# older FreeBSD used fuse, newer uses fusefs
# https://github.com/dustymabe/vagrant-sshfs/issues/124
machine.communicate.sudo("kldload fuse || kldload fusefs")
end

def self.sshfs_installed(machine)
installed = machine.communicate.test("pkg info fusefs-sshfs")
if installed
# fuse may not get loaded at boot, so check if it's loaded otherwise force load it
machine.communicate.sudo("kldstat -m fuse || kldload fuse")
# fuse may not get loaded at boot, so check if it's loaded
# If not loaded then force load it
loaded = machine.communicate.test("kldstat -m fuse || kldstat -m fusefs")
if not loaded
# older FreeBSD used fuse, newer uses fusefs
# https://github.com/dustymabe/vagrant-sshfs/issues/124
machine.communicate.sudo("kldload fuse || kldload fusefs")
end
end

installed
Expand Down

0 comments on commit cc887ad

Please sign in to comment.