Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NFS Mount failing on Ubuntu 22.04 #1937

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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