Skip to content

Commit

Permalink
fix: nfs mount on ubuntu 22.04 failing (#1937)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sn0wCrack authored Jan 22, 2024
1 parent d14da1f commit f5cbc8c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/homestead.rb
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,20 @@ def self.configure(config, settings)

if folder['type'] == 'nfs'
mount_opts = folder['mount_options'] ? folder['mount_options'] : ['actimeo=1', 'nolock']

# Ubuntu 22.04 does not support NFS UDP, so we need to ensure it is disabled
nfs_options = {nfs_udp: false}
elsif folder['type'] == 'smb'
mount_opts = folder['mount_options'] ? folder['mount_options'] : ['vers=3.02', 'mfsymlinks']

smb_creds = {smb_host: folder['smb_host'], smb_username: folder['smb_username'], smb_password: folder['smb_password']}
end

# For b/w compatibility keep separate 'mount_opts', but merge with options
options = (folder['options'] || {}).merge({ mount_options: mount_opts }).merge(smb_creds || {})
options = (folder['options'] || {})
.merge({ mount_options: mount_opts })
.merge(smb_creds || {})
.merge(nfs_options || {})

# Double-splat (**) operator only works with symbol keys, so convert
options.keys.each{|k| options[k.to_sym] = options.delete(k) }
Expand Down

0 comments on commit f5cbc8c

Please sign in to comment.