-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
61 lines (51 loc) · 1.33 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# -*- mode: ruby -*-
# vi: set ft=ruby :
OPENWRT_CONFIG='wndr3700.config'
VM_MEMORY=4096
VM_CORES=8
$script = <<-SCRIPT
git config --global color.ui auto
git clone git://git.openwrt.org/openwrt.git openwrt
cd openwrt
cp /vagrant/feeds.conf .
./scripts/feeds update -a
./scripts/feeds install -a -p custom
./scripts/feeds install -a
cp /vagrant/#{OPENWRT_CONFIG} ./.config
yes "" | make oldconfig 2>/dev/null
echo "See 'http://wiki.openwrt.org/doc/howto/build' for build information"
SCRIPT
Vagrant.configure('2') do |config|
config.vm.box = 'hashicorp/precise64'
config.vm.provider :virtualbox do |v, override|
v.customize ['modifyvm', :id, '--memory', VM_MEMORY]
v.customize ['modifyvm', :id, '--cpus', VM_CORES]
end
config.vm.provider :vmware_fusion do |v, override|
v.vmx['numvcpus'] = VM_CORES
v.vmx['memsize'] = VM_MEMORY
end
config.vm.provision 'shell', inline: 'sudo apt-get update'
%w(
autopoint
bash-completion
build-essential
bzr
cvs
flex
gawk
git-core
libncurses5-dev
libssl-dev
libxml-parser-perl
mercurial
quilt
subversion
unzip
xsltproc
zlib1g-dev
).join(' ').tap do |packages|
config.vm.provision 'shell', inline: "sudo apt-get -q -y install #{packages}"
end
config.vm.provision 'shell', privileged: false, inline: $script
end