mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-11 01:30:30 +03:00
Merge branch 'master' into 'master'
makebuildserver: support running VirtualBox in a VM For debian.jenkins.net, our test environment is a kvm instance that does not expose the hardware virtualization instructions. So this auto-detects whether the current machine, virtual or not, supports the hardware virtualization. If not, it uses VirtualBox's software emulator, which should run everywhere, even in a kvm instance. See merge request !108
This commit is contained in:
commit
fc0746712d
2 changed files with 18 additions and 2 deletions
|
|
@ -338,6 +338,20 @@ if type(config['baseboxurl']) in (list, tuple) or config['baseboxurl'][0] in ('(
|
||||||
else:
|
else:
|
||||||
baseboxurl = '"{0}"'.format(config['baseboxurl'])
|
baseboxurl = '"{0}"'.format(config['baseboxurl'])
|
||||||
|
|
||||||
|
# use VirtualBox software virtualization if hardware is not available,
|
||||||
|
# like if this is being run in kvm or some other VM platform, like
|
||||||
|
# http://jenkins.debian.net, the values are 'on' or 'off'
|
||||||
|
hwvirtex = 'off'
|
||||||
|
if sys.platform.startswith('darwin'):
|
||||||
|
# all < 10 year old Macs work, and OSX servers as VM host are very
|
||||||
|
# rare, but this could also be auto-detected if someone codes it
|
||||||
|
hwvirtex = 'on'
|
||||||
|
elif os.path.exists('/proc/cpuinfo'):
|
||||||
|
with open('/proc/cpuinfo') as f:
|
||||||
|
contents = f.read()
|
||||||
|
if 'vmx' in contents or 'svm' in contents:
|
||||||
|
hwvirtex = 'on'
|
||||||
|
|
||||||
# Generate an appropriate Vagrantfile for the buildserver, based on our
|
# Generate an appropriate Vagrantfile for the buildserver, based on our
|
||||||
# settings...
|
# settings...
|
||||||
vagrantfile = """
|
vagrantfile = """
|
||||||
|
|
@ -356,15 +370,17 @@ Vagrant.configure("2") do |config|
|
||||||
config.vm.provider "virtualbox" do |v|
|
config.vm.provider "virtualbox" do |v|
|
||||||
v.customize ["modifyvm", :id, "--memory", "{2}"]
|
v.customize ["modifyvm", :id, "--memory", "{2}"]
|
||||||
v.customize ["modifyvm", :id, "--cpus", "{3}"]
|
v.customize ["modifyvm", :id, "--cpus", "{3}"]
|
||||||
|
v.customize ["modifyvm", :id, "--hwvirtex", "{4}"]
|
||||||
end
|
end
|
||||||
|
|
||||||
config.vm.boot_timeout = {4}
|
config.vm.boot_timeout = {5}
|
||||||
|
|
||||||
config.vm.provision :shell, :path => "fixpaths.sh"
|
config.vm.provision :shell, :path => "fixpaths.sh"
|
||||||
""".format(config['basebox'],
|
""".format(config['basebox'],
|
||||||
baseboxurl,
|
baseboxurl,
|
||||||
config['memory'],
|
config['memory'],
|
||||||
config.get('cpus', 1),
|
config.get('cpus', 1),
|
||||||
|
hwvirtex,
|
||||||
config['boot_timeout'])
|
config['boot_timeout'])
|
||||||
if 'aptproxy' in config and config['aptproxy']:
|
if 'aptproxy' in config and config['aptproxy']:
|
||||||
vagrantfile += """
|
vagrantfile += """
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,5 @@
|
||||||
description-file = README.md
|
description-file = README.md
|
||||||
|
|
||||||
[aliases]
|
[aliases]
|
||||||
release = register sdist --sign upload
|
release = register sdist upload --sign
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue