mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 15:32:30 +03:00
buildserver: only auto-detect KVM in ./makebuildserver
Having a second, different KVM auto-detect routine in Vagrantfile will only confuse things. This also removes the direct call to the systemd utility.
This commit is contained in:
parent
1b09ab5a79
commit
764b99acd6
1 changed files with 9 additions and 10 deletions
19
buildserver/Vagrantfile
vendored
19
buildserver/Vagrantfile
vendored
|
@ -15,8 +15,15 @@ Vagrant.configure("2") do |config|
|
||||||
config.vm.box = configfile['basebox']
|
config.vm.box = configfile['basebox']
|
||||||
config.vm.box_url = configfile['baseboxurl']
|
config.vm.box_url = configfile['baseboxurl']
|
||||||
|
|
||||||
# TODO detect if jessie64.box is libvirt, or `vagrant mutate jessie64 libvirt`
|
if not configfile.has_key? "vm_provider" or configfile["vm_provider"] == "virtualbox"
|
||||||
if `systemd-detect-virt`.include? "qemu" or configfile["vm_provider"] == "libvirt"
|
# default to VirtualBox if not set
|
||||||
|
config.vm.provider "virtualbox" do |v|
|
||||||
|
v.customize ["modifyvm", :id, "--memory", configfile['memory']]
|
||||||
|
v.customize ["modifyvm", :id, "--cpus", configfile['cpus']]
|
||||||
|
v.customize ["modifyvm", :id, "--hwvirtex", configfile['hwvirtex']]
|
||||||
|
end
|
||||||
|
synced_folder_type = 'virtualbox'
|
||||||
|
elsif configfile["vm_provider"] == "libvirt"
|
||||||
# use KVM/QEMU if this is running in KVM/QEMU
|
# use KVM/QEMU if this is running in KVM/QEMU
|
||||||
config.vm.provider :libvirt do |libvirt|
|
config.vm.provider :libvirt do |libvirt|
|
||||||
libvirt.driver = "kvm"
|
libvirt.driver = "kvm"
|
||||||
|
@ -27,14 +34,6 @@ Vagrant.configure("2") do |config|
|
||||||
end
|
end
|
||||||
config.vm.synced_folder './', '/vagrant', type: '9p'
|
config.vm.synced_folder './', '/vagrant', type: '9p'
|
||||||
synced_folder_type = '9p'
|
synced_folder_type = '9p'
|
||||||
elsif not configfile.has_key? "vm_provider" or configfile["vm_provider"] == "virtualbox"
|
|
||||||
# default to VirtualBox if not set
|
|
||||||
config.vm.provider "virtualbox" do |v|
|
|
||||||
v.customize ["modifyvm", :id, "--memory", configfile['memory']]
|
|
||||||
v.customize ["modifyvm", :id, "--cpus", configfile['cpus']]
|
|
||||||
v.customize ["modifyvm", :id, "--hwvirtex", configfile['hwvirtex']]
|
|
||||||
end
|
|
||||||
synced_folder_type = 'virtualbox'
|
|
||||||
else
|
else
|
||||||
abort("No supported VM Provider found, set vm_provider in Vagrantfile.yaml!")
|
abort("No supported VM Provider found, set vm_provider in Vagrantfile.yaml!")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue