Skip to content

Instantly share code, notes, and snippets.

@tuupola
Created December 8, 2018 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuupola/bf8d1479e00be84806f0daa53279b146 to your computer and use it in GitHub Desktop.
Save tuupola/bf8d1479e00be84806f0daa53279b146 to your computer and use it in GitHub Desktop.
Vagrant virtual machine for mender-convert
# -*- mode: ruby -*-
# vi: set ft=ruby :
# https://mender.io/
# https://github.com/mendersoftware/mender-convert
# https://github.com/sprotheroe/vagrant-disksize
# https://github.com/fgrehm/vagrant-cachier
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.network "private_network", ip: "192.168.50.58"
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
end
if Vagrant.has_plugin?("vagrant-disksize")
config.disksize.size = "20GB"
end
config.vm.provision "shell", name: "apt", inline: <<-SHELL
#locale-gen UTF-8
apt-get update
apt-get install -y golang
echo GOPATH=/home/vagrant/go >> /home/vagrant/.profile
apt-get install -y git
apt install -y kpartx
apt install -y bison
apt install -y flex
apt install -y mtools
echo "mtools_skip_check=1" >> /home/vagrant/.mtoolsrc
apt install -y parted
apt install -y mtd-utils
apt install -y e2fsprogs
apt install -y u-boot-tools
# apt install -y pigz
apt install -y device-tree-compiler
apt install -y autoconf
apt install -y autotools-dev
apt install -y libtool
apt install -y pkg-config
apt install -y python
SHELL
config.vm.provision "shell", name: "gnueabihf", inline: <<-SHELL
wget --quiet http://releases.linaro.org/components/toolchain/binaries/6.3-2017.05/arm-linux-gnueabihf/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz
tar -xvf gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz
mv gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf /usr/local/arm-linux-gnueabihf
echo PATH=$PATH:/usr/local/arm-linux-gnueabihf/bin >> /home/vagrant/.profile
SHELL
config.vm.provision "shell", name: "mender", privileged: false, inline: <<-SHELL
source /home/vagrant/.profile
go get github.com/mendersoftware/mender
cd $GOPATH/src/github.com/mendersoftware/mender
git checkout 1.7.0b1
env CGO_ENABLED=1 CC=arm-linux-gnueabihf-gcc GOOS=linux GOARCH=arm make build
SHELL
config.vm.provision "shell", name: "mender-artifact", inline: <<-SHELL
wget --quiet https://d1b0l86ne08fsf.cloudfront.net/mender-artifact/2.4.0b1/mender-artifact
mv mender-artifact /usr/local/bin
chmod a+x /usr/local/bin/mender-artifact
SHELL
config.vm.provision "shell", name: "mender-convert", privileged: false, inline: <<-SHELL
git clone https://github.com/mendersoftware/mender-convert.git
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment