ubuntu 16.04 build support. Supporting systemd with vpp.service files.
[vpp.git] / build-root / vagrant / bootstrap.ubuntu1604.sh
1 # Fix grub-pc on Virtualbox with Ubuntu
2 export DEBIAN_FRONTEND=noninteractive
3
4 # Standard update + upgrade dance
5 apt-get update
6 apt-get upgrade -y
7
8 # Fix the silly notion that /bin/sh should point to dash by pointing it to bash
9
10 sudo update-alternatives --install /bin/sh sh /bin/bash 100
11
12 cd /vpp
13 sudo -H -u vagrant make install-dep
14
15 # Install useful but non-mandatory tools
16 apt-get install -y emacs  git-review gdb gdbserver
17
18 sudo -H -u vagrant make bootstrap
19 sudo -H -u vagrant make pkg-deb
20 (cd build-root/;dpkg -i *.deb)
21
22 # Capture all the interface IPs, in case we need them later
23 ifconfig -a > ~vagrant/ifconfiga
24 chown vagrant:vagrant ~vagrant/ifconfiga
25
26 # Disable all ethernet interfaces other than the default route
27 # interface so VPP will use those interfaces.  The VPP auto-blacklist
28 # algorithm prevents the use of any physical interface contained in the
29 # routing table (i.e. "route --inet --inet6") preventing the theft of
30 # the management ethernet interface by VPP from the kernel.
31 for intf in $(ls /sys/class/net) ; do
32     if [ -d /sys/class/net/$intf/device ] && 
33         [ "$(route --inet --inet6 | grep default | grep $intf)" == "" ] ; then
34         ifconfig $intf down
35     fi
36 done
37
38 systemctl start vpp
39 cat /vagrant/README