Vagrantfile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ################################################################################
  2. #
  3. # Vagrantfile
  4. #
  5. ################################################################################
  6. # Buildroot version to use
  7. RELEASE='2024.02.12'
  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 = 'debian/bullseye64'
  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.provider :libvirt do |v, override|
  26. v.memory = VM_MEMORY
  27. v.cpus = VM_CORES
  28. end
  29. config.vm.provision 'shell' do |s|
  30. s.inline = 'echo Setting up machine name'
  31. config.vm.provider :vmware_fusion do |v, override|
  32. v.vmx['displayname'] = "Buildroot #{RELEASE}"
  33. end
  34. config.vm.provider :virtualbox do |v, override|
  35. v.name = "Buildroot #{RELEASE}"
  36. end
  37. end
  38. config.vm.provision 'shell', privileged: true, inline:
  39. "dpkg --add-architecture i386
  40. apt-get -q update
  41. apt-get -q -y install build-essential libncurses5-dev \
  42. git bzr cvs mercurial rsync subversion libc6:i386 unzip bc
  43. apt-get -q -y autoremove
  44. apt-get -q -y clean
  45. update-locale LC_ALL=C"
  46. config.vm.provision 'shell', privileged: false, inline:
  47. "echo 'Downloading and extracting buildroot #{RELEASE}'
  48. wget -q -c http://buildroot.org/downloads/buildroot-#{RELEASE}.tar.gz
  49. tar axf buildroot-#{RELEASE}.tar.gz"
  50. end