Skip to content

Instantly share code, notes, and snippets.

@evianzhow
Created August 5, 2016 13:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save evianzhow/140e47d864b94c1f0d4509da23242f70 to your computer and use it in GitHub Desktop.
Save evianzhow/140e47d864b94c1f0d4509da23242f70 to your computer and use it in GitHub Desktop.
Cross-compile Vagrant box for EdgeRouter
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
end
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
sudo apt-get install -y qemu-system
# See https://people.debian.org/~aurel32/qemu/mips/ for different archs
wget -nv https://people.debian.org/~aurel32/qemu/mips/vmlinux-3.2.0-4-5kc-malta
wget -nv https://people.debian.org/~aurel32/qemu/mips/debian_wheezy_mips_standard.qcow2
sudo chown vagrant:vagrant vmlinux-3.2.0-4-5kc-malta
sudo chown vagrant:vagrant debian_wheezy_mips_standard.qcow2
sudo sh -c 'echo "qemu-system-mips64 -M malta -kernel $HOME/vmlinux-3.2.0-4-5kc-malta -hda $HOME/debian_wheezy_mips_standard.qcow2 -append "root=/dev/sda1 console=ttyS0" -nographic\n" >> /etc/bash.bashrc'
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment