Add void linux host support

This commit is contained in:
Aloz1 2018-07-12 08:40:33 +10:00
parent 1f99da7a11
commit 98f70d4d7a
3 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,19 @@
module VagrantPlugins
module HostVoid
module Cap
class NFS
def self.nfs_check_command(env)
"/usr/bin/sv status nfs-server"
end
def self.nfs_start_command(env)
"/usr/bin/sv up nfs-server "
end
def self.nfs_installed(env)
Kernel.system("/usr/bin/xbps-query nfs-utils", [:out, :err] => "/dev/null")
end
end
end
end
end

View File

@ -0,0 +1,22 @@
require 'pathname'
require 'vagrant'
module VagrantPlugins
module HostVoid
class Host < Vagrant.plugin("2", :host)
def detect?(env)
os_file = Pathname.new("/etc/os-release")
if os_file.exist?
file = os_file.open
while (line = file.gets) do
return true if line =~ /^ID="void"/
end
end
false
end
end
end
end

View File

@ -0,0 +1,30 @@
require "vagrant"
module VagrantPlugins
module HostVoid
class Plugin < Vagrant.plugin("2")
name "Void host"
description "Void linux host support."
host("void", "linux") do
require_relative "host"
Host
end
host_capability("void", "nfs_installed") do
require_relative "cap/nfs"
Cap::NFS
end
host_capability("void", "nfs_check_command") do
require_relative "cap/nfs"
Cap::NFS
end
host_capability("void", "nfs_start_command") do
require_relative "cap/nfs"
Cap::NFS
end
end
end
end