Add libvirt support for Vagrantfile (#3971)
This commit is contained in:
parent
baa6968fc4
commit
d538d5c44d
68
config/templates/Vagrantfile
vendored
68
config/templates/Vagrantfile
vendored
@ -13,41 +13,57 @@ ln -sf /vagrant/userpatches /home/vagrant/armbian/userpatches
|
||||
SCRIPT
|
||||
|
||||
Vagrant.configure(2) do |config|
|
||||
config.vm.define "Armbian Builder" do |builder|
|
||||
# We should use a box that is compatible with Virtualbox and Libvirt
|
||||
builder.vm.box = "generic/ubuntu2204"
|
||||
builder.vm.box_version = ">= 4.0.2"
|
||||
|
||||
# What box should we base this build on?
|
||||
config.vm.box = "ubuntu/focal64"
|
||||
config.vm.box_version = ">= 20180719.0.0"
|
||||
# provisioning: install dependencies, download the repository copy
|
||||
builder.vm.provision "shell", inline: $provisioning_script
|
||||
|
||||
# Default images are not big enough to build Armbian.
|
||||
config.vagrant.plugins = "vagrant-disksize"
|
||||
config.disksize.size = "40GB"
|
||||
# forward terminal type for better compatibility with Dialog - disabled on Ubuntu by default
|
||||
builder.ssh.forward_env = ["TERM"]
|
||||
|
||||
# provisioning: install dependencies, download the repository copy
|
||||
config.vm.provision "shell", inline: $provisioning_script
|
||||
builder.vm.hostname = "armbian-builder"
|
||||
|
||||
# forward terminal type for better compatibility with Dialog - disabled on Ubuntu by default
|
||||
config.ssh.forward_env = ["TERM"]
|
||||
# SSH password auth is disabled by default, uncomment to enable and set the password
|
||||
#config.ssh.password = "armbian"
|
||||
|
||||
# default user name is "ubuntu", please do not change it
|
||||
builder.vm.provider "virtualbox" do |vb|
|
||||
vb.name = "Armbian Builder"
|
||||
|
||||
# SSH password auth is disabled by default, uncomment to enable and set the password
|
||||
#config.ssh.password = "armbian"
|
||||
# Default images are not big enough to build Armbian.
|
||||
#config.vagrant.plugins = "vagrant-disksize"
|
||||
#config.disksize.size = "40GB"
|
||||
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
vb.name = "Armbian Builder"
|
||||
# uncomment this to enable the VirtualBox GUI
|
||||
#vb.gui = true
|
||||
|
||||
# uncomment this to enable the VirtualBox GUI
|
||||
#vb.gui = true
|
||||
# Tweak these to fit your needs.
|
||||
#vb.memory = "8192"
|
||||
#vb.cpus = "4"
|
||||
end
|
||||
|
||||
# Tweak these to fit your needs.
|
||||
#vb.memory = "8192"
|
||||
#vb.cpus = "4"
|
||||
end
|
||||
builder.vm.provider "libvirt" do |libvirt|
|
||||
# Some specifics libvirt options
|
||||
libvirt.driver = "kvm"
|
||||
libvirt.uri = "qemu:///system"
|
||||
libvirt.default_prefix = ""
|
||||
|
||||
case File.basename(Dir.getwd)
|
||||
when "templates"
|
||||
config.vm.synced_folder "../..", "/vagrant"
|
||||
when "userpatches"
|
||||
config.vm.synced_folder "..", "/vagrant"
|
||||
# Default images are not big enough to build Armbian.
|
||||
libvirt.storage_pool_name = "default"
|
||||
libvirt.storage :file, :size => "40G"
|
||||
|
||||
# Tweak these to fit your needs.
|
||||
libvirt.memory = "8192"
|
||||
libvirt.cpus = "4"
|
||||
end
|
||||
|
||||
case File.basename(Dir.getwd)
|
||||
when "templates"
|
||||
builder.vm.synced_folder "../..", "/vagrant", type: "sshfs"
|
||||
when "userpatches"
|
||||
builder.vm.synced_folder "..", "/vagrant", type: "sshfs"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user