blob: 35865faf8afda83e2f5d811cd6ce5e9219dddaf2 [file] [log] [blame]
Matt Johnson3b566bb2016-01-11 12:16:46 -08001# Fix grub-pc on Virtualbox with Ubuntu
2export DEBIAN_FRONTEND=noninteractive
3
Ed Warnickecb9cada2015-12-08 15:45:58 -07004# Standard update + upgrade dance
5apt-get update
6apt-get upgrade -y
7
8# Fix the silly notion that /bin/sh should point to dash by pointing it to bash
9
10sudo update-alternatives --install /bin/sh sh /bin/bash 100
11
12# Install build tools
Dave Barachc23f7bc2016-01-28 09:36:05 -050013apt-get install -y build-essential autoconf automake bison libssl-dev ccache libtool git dkms debhelper emacs libganglia1-dev libapr1-dev libconfuse-dev
Ed Warnickecb9cada2015-12-08 15:45:58 -070014
15# Install other stuff
16# apt-get install -y qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
17
18# Install uio
19apt-get install -y linux-image-extra-`uname -r`
20
21# Install jdk and maven
22apt-get install -y openjdk-7-jdk
23# $$$ comment out for the moment
24# apt-get install -y --force-yes maven3
25
26# Install debian packaging tools
27apt-get install -y debhelper dkms
28
29# Setup for hugepages using upstart so it persists across reboots
30echo "vm.nr_hugepages=1024" >> /etc/sysctl.d/20-hugepages.conf
31sysctl --system
32
33cat << EOF > /etc/init/hugepages.conf
34start on runlevel [2345]
35
36task
37
38script
39 mkdir -p /run/hugepages/kvm || true
40 rm -f /run/hugepages/kvm/* || true
41 rm -f /dev/shm/* || true
42 mount -t hugetlbfs nodev /run/hugepages/kvm
43end script
44EOF
45
46# Make sure we run that hugepages.conf right now
47start hugepages
48
49# Setup the vpp code
50cd ~vagrant/
Keith Burns (alagalah)f5a857d2016-01-31 20:53:46 +010051
Ed Warnickecb9cada2015-12-08 15:45:58 -070052sudo -u vagrant mkdir git
53cd git/
54
Keith Burns (alagalah)f5a857d2016-01-31 20:53:46 +010055# Check if git exists and remove it before attempting clone, else clone ineffective when "reload --provision"
56[ -d vpp ] && rm -rf vpp
Ed Warnickecb9cada2015-12-08 15:45:58 -070057sudo -H -u vagrant git clone /vpp
58cd vpp/
59
60# Initial vpp build
61if [ -d build-root ]; then
62 # Bootstrap vpp
63 cd build-root/
64 sudo -H -u vagrant ./bootstrap.sh
65
66 # Build vpp
67 sudo -H -u vagrant make PLATFORM=vpp TAG=vpp_debug install-deb
68
Ed Warnickeb463ec82015-12-22 20:04:54 -070069 # Install debian packages
70 dpkg -i *.deb
Ed Warnickecb9cada2015-12-08 15:45:58 -070071
Ed Warnickeb463ec82015-12-22 20:04:54 -070072 # Start vpp
73 start vpp
Ed Warnickecb9cada2015-12-08 15:45:58 -070074
Ed Warnickecb9cada2015-12-08 15:45:58 -070075 cd ~vagrant/
76 cat /vagrant/README
77
78fi