Skip to content

Commit 06b88aa

Browse files
author
Gardner Bickford
committed
Adding vagrant file for build
1 parent 7305bf3 commit 06b88aa

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*~
2+
.vagrant
23
*.app
34
*.cache
45
*.dylib

Vagrantfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
5+
# configures the configuration version (we support older styles for
6+
# backwards compatibility). Please don't change it unless you know what
7+
# you're doing.
8+
Vagrant.configure(2) do |config|
9+
# The most common configuration options are documented and commented below.
10+
# For a complete reference, please see the online documentation at
11+
# https://docs.vagrantup.com.
12+
13+
# Every Vagrant development environment requires a box. You can search for
14+
# boxes at https://atlas.hashicorp.com/search.
15+
config.vm.box = "ubuntu/precise64"
16+
config.vm.host_name = "buildvlc"
17+
18+
config.vm.provider "virtualbox" do |v|
19+
v.memory = 2048
20+
v.cpus = 4
21+
end
22+
23+
# Poorman's apt package caching. This accelerates repeated provisioning.
24+
# From https://gist.github.com/millisami/3798773
25+
def local_cache(box_name)
26+
cache_dir = File.join(File.expand_path('~/.vagrant.d'), 'cache', 'apt', box_name)
27+
partial_dir = File.join(cache_dir, 'partial')
28+
FileUtils.mkdir_p(partial_dir) unless File.exists? partial_dir
29+
cache_dir
30+
end
31+
32+
cache_dir = local_cache(config.vm.box)
33+
config.vm.synced_folder cache_dir, "/var/cache/apt/archives/"
34+
35+
# config.vm.synced_folder "assets", "/vagrant/assets", owner: "www-data", group: "www-data"
36+
#
37+
# config.vm.network "forwarded_port", guest: 80, host: 8777
38+
#
39+
config.vm.provision :shell,
40+
privileged: true,
41+
path: "vagrant.sh"
42+
end

vagrant.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
export DEBIAN_FRONTEND=noninteractive
4+
export MER_ROOT=/srv/mer
5+
6+
if [ ! -e /etc/firstrun ]; then
7+
touch /etc/firstrun
8+
apt-get update && apt-get upgrade -y
9+
apt-get install aria2 curl wget vim htop -y
10+
fi
11+
12+
if [ ! -e $MER_ROOT ]; then
13+
mkdir -p $MER_ROOT/sdks/sdk
14+
aria2c --dir=/tmp -x 5 --check-certificate=false https://img.merproject.org/images/mer-sdk/mer-i486-latest-sdk-rolling-chroot-armv7hl-sb2.tar.bz2
15+
cd $MER_ROOT/sdks/sdk
16+
sudo tar --numeric-owner -p -xjf /tmp/mer-i486-latest-sdk-rolling-chroot-armv7hl-sb2.tar.bz2
17+
fi
18+
19+
if ! grep MER_ROOT /home/vagrant/.bashrc; then
20+
echo "export MER_ROOT=$MER_ROOT" >> /home/vagrant/.bashrc
21+
echo 'alias sdk=$MER_ROOT/sdks/sdk/mer-sdk-chroot' >> /home/vagrant/.bashrc
22+
echo "echo ." >> /home/vagrant/.bashrc
23+
echo 'echo To enter the SDK environment please type: sdk' >> /home/vagrant/.bashrc
24+
fi
25+
26+
cat << 'EOF' > /home/vagrant/.mersdk.profile
27+
PS1="MerSDK $PS1"
28+
if [ -d /etc/bash_completion.d ]; then
29+
for i in /etc/bash_completion.d/*;
30+
do
31+
. $i
32+
done
33+
fi
34+
EOF
35+
36+

0 commit comments

Comments
 (0)