blob: d6729073abf77495a1c3ce75147938d61ea6af01 [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
Ed Warnickeeeee9e22016-02-02 17:47:17 -080013apt-get install -y build-essential autoconf automake bison libssl-dev ccache libtool git dkms debhelper emacs libganglia1-dev libapr1-dev libconfuse-dev git-review
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
Ed Warnickecb9cada2015-12-08 15:45:58 -070026# Setup for hugepages using upstart so it persists across reboots
27echo "vm.nr_hugepages=1024" >> /etc/sysctl.d/20-hugepages.conf
28sysctl --system
29
30cat << EOF > /etc/init/hugepages.conf
31start on runlevel [2345]
32
33task
34
35script
36 mkdir -p /run/hugepages/kvm || true
37 rm -f /run/hugepages/kvm/* || true
38 rm -f /dev/shm/* || true
39 mount -t hugetlbfs nodev /run/hugepages/kvm
40end script
41EOF
42
43# Make sure we run that hugepages.conf right now
44start hugepages
45
46# Setup the vpp code
47cd ~vagrant/
Keith Burns (alagalah)f5a857d2016-01-31 20:53:46 +010048
Ed Warnickeeeee9e22016-02-02 17:47:17 -080049sudo -u vagrant mkdir -p git/vpp
50cp /vagrant/README.moved git/vpp/
Ed Warnickecb9cada2015-12-08 15:45:58 -070051
Dave Wallaced255ee12016-02-03 22:34:04 -050052# Disable all ethernet interfaces other than the default route
53# interface so VPP will use those interfaces. The VPP auto-blacklist
54# algorithm prevents the use of any physical interface contained in the
55# routing table (i.e. "route --inet --inet6") preventing the theft of
56# the management ethernet interface by VPP from the kernel.
57for intf in $(ls /sys/class/net) ; do
58 if [ -d /sys/class/net/$intf/device ] &&
59 [ "$(route --inet --inet6 | grep default | grep $intf)" == "" ] ; then
60 ifconfig $intf down
61 fi
62done
63
Ed Warnickeeeee9e22016-02-02 17:47:17 -080064cd /vpp/
Ed Warnickecb9cada2015-12-08 15:45:58 -070065
66# Initial vpp build
67if [ -d build-root ]; then
68 # Bootstrap vpp
69 cd build-root/
70 sudo -H -u vagrant ./bootstrap.sh
71
72 # Build vpp
73 sudo -H -u vagrant make PLATFORM=vpp TAG=vpp_debug install-deb
74
Ed Warnickeb463ec82015-12-22 20:04:54 -070075 # Install debian packages
76 dpkg -i *.deb
Ed Warnickecb9cada2015-12-08 15:45:58 -070077
Ed Warnickeb463ec82015-12-22 20:04:54 -070078 # Start vpp
79 start vpp
Ed Warnickecb9cada2015-12-08 15:45:58 -070080
Ed Warnickecb9cada2015-12-08 15:45:58 -070081 cd ~vagrant/
82 cat /vagrant/README
83
84fi