2015-11-18 23:51:35 +01:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# Vagrantfile
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
# Buildroot version to use
|
2022-05-29 21:31:48 +02:00
|
|
|
RELEASE='2022.02.2'
|
2015-11-18 23:51:35 +01:00
|
|
|
|
|
|
|
### Change here for more memory/cores ###
|
|
|
|
VM_MEMORY=2048
|
|
|
|
VM_CORES=1
|
|
|
|
|
|
|
|
Vagrant.configure('2') do |config|
|
2018-08-13 10:49:12 +02:00
|
|
|
config.vm.box = 'ubuntu/bionic64'
|
2015-11-18 23:51:35 +01:00
|
|
|
|
|
|
|
config.vm.provider :vmware_fusion do |v, override|
|
|
|
|
v.vmx['memsize'] = VM_MEMORY
|
|
|
|
v.vmx['numvcpus'] = VM_CORES
|
|
|
|
end
|
|
|
|
|
|
|
|
config.vm.provider :virtualbox do |v, override|
|
|
|
|
v.memory = VM_MEMORY
|
|
|
|
v.cpus = VM_CORES
|
|
|
|
|
|
|
|
required_plugins = %w( vagrant-vbguest )
|
|
|
|
required_plugins.each do |plugin|
|
|
|
|
system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
config.vm.provision 'shell' do |s|
|
|
|
|
s.inline = 'echo Setting up machine name'
|
|
|
|
|
|
|
|
config.vm.provider :vmware_fusion do |v, override|
|
|
|
|
v.vmx['displayname'] = "Buildroot #{RELEASE}"
|
|
|
|
end
|
|
|
|
|
|
|
|
config.vm.provider :virtualbox do |v, override|
|
|
|
|
v.name = "Buildroot #{RELEASE}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-02-26 16:08:49 +01:00
|
|
|
config.vm.provision 'shell', privileged: true, inline:
|
|
|
|
"sed -i 's|deb http://us.archive.ubuntu.com/ubuntu/|deb mirror://mirrors.ubuntu.com/mirrors.txt|g' /etc/apt/sources.list
|
|
|
|
dpkg --add-architecture i386
|
|
|
|
apt-get -q update
|
|
|
|
apt-get purge -q -y snapd lxcfs lxd ubuntu-core-launcher snap-confine
|
|
|
|
apt-get -q -y install build-essential libncurses5-dev \
|
2016-10-17 23:53:02 +02:00
|
|
|
git bzr cvs mercurial subversion libc6:i386 unzip bc
|
2017-02-26 16:08:49 +01:00
|
|
|
apt-get -q -y autoremove
|
|
|
|
apt-get -q -y clean
|
|
|
|
update-locale LC_ALL=C"
|
2015-11-18 23:51:35 +01:00
|
|
|
|
|
|
|
config.vm.provision 'shell', privileged: false, inline:
|
|
|
|
"echo 'Downloading and extracting buildroot #{RELEASE}'
|
|
|
|
wget -q -c http://buildroot.org/downloads/buildroot-#{RELEASE}.tar.gz
|
|
|
|
tar axf buildroot-#{RELEASE}.tar.gz"
|
2017-02-26 16:08:49 +01:00
|
|
|
|
2015-11-18 23:51:35 +01:00
|
|
|
end
|