Vagrantfile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ################################################################################
  2. #
  3. # Vagrantfile
  4. #
  5. ################################################################################
  6. # Buildroot version to use
  7. RELEASE='2020.11'
  8. ### Change here for more memory/cores ###
  9. VM_MEMORY=2048
  10. VM_CORES=1
  11. Vagrant.configure('2') do |config|
  12. config.vm.box = 'ubuntu/bionic64'
  13. config.vm.provider :vmware_fusion do |v, override|
  14. v.vmx['memsize'] = VM_MEMORY
  15. v.vmx['numvcpus'] = VM_CORES
  16. end
  17. config.vm.provider :virtualbox do |v, override|
  18. v.memory = VM_MEMORY
  19. v.cpus = VM_CORES
  20. required_plugins = %w( vagrant-vbguest )
  21. required_plugins.each do |plugin|
  22. system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
  23. end
  24. end
  25. config.vm.provision 'shell' do |s|
  26. s.inline = 'echo Setting up machine name'
  27. config.vm.provider :vmware_fusion do |v, override|
  28. v.vmx['displayname'] = "Buildroot #{RELEASE}"
  29. end
  30. config.vm.provider :virtualbox do |v, override|
  31. v.name = "Buildroot #{RELEASE}"
  32. end
  33. end
  34. config.vm.provision 'shell', privileged: true, inline:
  35. "sed -i 's|deb http://us.archive.ubuntu.com/ubuntu/|deb mirror://mirrors.ubuntu.com/mirrors.txt|g' /etc/apt/sources.list
  36. dpkg --add-architecture i386
  37. apt-get -q update
  38. apt-get purge -q -y snapd lxcfs lxd ubuntu-core-launcher snap-confine
  39. apt-get -q -y install build-essential libncurses5-dev \
  40. git bzr cvs mercurial subversion libc6:i386 unzip bc
  41. apt-get -q -y autoremove
  42. apt-get -q -y clean
  43. update-locale LC_ALL=C"
  44. config.vm.provision 'shell', privileged: false, inline:
  45. "echo 'Downloading and extracting buildroot #{RELEASE}'
  46. wget -q -c http://buildroot.org/downloads/buildroot-#{RELEASE}.tar.gz
  47. tar axf buildroot-#{RELEASE}.tar.gz"
  48. end