From cc887ad6ddd6f99cf7deb0134890253f4129dcb5 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Mon, 20 Jun 2022 15:09:12 -0400 Subject: [PATCH] guest: upload fuse module loading for FreeBSD Newer FreeBSD calls it "fusefs", not just "fuse". Fixes https://github.com/dustymabe/vagrant-sshfs/issues/124 --- .../cap/guest/freebsd/sshfs_client.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_client.rb b/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_client.rb index bf0e0fa..a0637bc 100644 --- a/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_client.rb +++ b/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_client.rb @@ -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