From ab7a1d5d7587ee27e648e071ab573963a44cf454 Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Fri, 21 Sep 2018 00:17:56 +0000 Subject: [PATCH] Vagrant configuration for bootstrap debian/ubuntu images --- tools/qemu-debian-img/.gitignore | 3 +++ tools/qemu-debian-img/Vagrantfile | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tools/qemu-debian-img/.gitignore create mode 100644 tools/qemu-debian-img/Vagrantfile diff --git a/tools/qemu-debian-img/.gitignore b/tools/qemu-debian-img/.gitignore new file mode 100644 index 0000000..9dabb3e --- /dev/null +++ b/tools/qemu-debian-img/.gitignore @@ -0,0 +1,3 @@ +*.img +*.log +vmlinuz* diff --git a/tools/qemu-debian-img/Vagrantfile b/tools/qemu-debian-img/Vagrantfile new file mode 100644 index 0000000..67844d5 --- /dev/null +++ b/tools/qemu-debian-img/Vagrantfile @@ -0,0 +1,17 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.vm.box = "ubuntu/bionic64" + + config.vm.provision "shell", inline: <<-SHELL + apt-get update + apt-get install -y debootstrap qemu golang + mkdir qemu-debian-img && cd qemu-debian-img + cp /vagrant/main.go ./ + GOBIN=/usr/bin go get ./ + qemu-debian-img generate --repository="http://archive.ubuntu.com/ubuntu" --release="bionic" bionic.img + cp bionic.img /vagrant/ + cp /boot/vmlinuz-* /vagrant/vmlinuz-bionic + SHELL +end