Created
February 4, 2020 14:09
-
-
Save mkaczanowski/c77b03323d9f376e75c9e91063213b36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/eoan64" | |
config.disksize.size = '15GB' | |
config.vm.provision "shell", inline: <<-SHELL | |
apt-get update | |
apt-get install -y git golang qemu-user-static packer | |
rm -rf packer-builder-arm folder-to-upload *>/dev/null | |
git clone https://github.com/mkaczanowski/packer-builder-arm | |
cd packer-builder-arm | |
go mod download | |
go build | |
mkdir generated-images | |
mkdir ../folder-to-upload -p | |
for i in `seq 5`; do echo "test $i" > "../folder-to-upload/test_$i"; done | |
wget "https://gist.githubusercontent.com/mkaczanowski/1b6d827f99d0613b008340f9add63b19/raw/f1959156e39c92909183f5be847886c8d26c7d21/config" -O config.json | |
sudo packer build config.json | |
sudo losetup -D | |
sudo losetup -P /dev/loop8 generated-images/generated-raspbian.img | |
sudo mount /dev/loop8p2 /mnt/ | |
sudo cat /mnt/home/pi/target-folder/test_* | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment