Matt Johnson | 3b566bb | 2016-01-11 12:16:46 -0800 | [diff] [blame] | 1 | # Fix grub-pc on Virtualbox with Ubuntu |
| 2 | export DEBIAN_FRONTEND=noninteractive |
| 3 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 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 | # Install build tools |
Ed Warnicke | eeee9e2 | 2016-02-02 17:47:17 -0800 | [diff] [blame] | 13 | apt-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 Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 14 | |
| 15 | # Install other stuff |
| 16 | # apt-get install -y qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils |
| 17 | |
| 18 | # Install uio |
| 19 | apt-get install -y linux-image-extra-`uname -r` |
| 20 | |
| 21 | # Install jdk and maven |
| 22 | apt-get install -y openjdk-7-jdk |
| 23 | # $$$ comment out for the moment |
| 24 | # apt-get install -y --force-yes maven3 |
| 25 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 26 | # Setup for hugepages using upstart so it persists across reboots |
| 27 | echo "vm.nr_hugepages=1024" >> /etc/sysctl.d/20-hugepages.conf |
| 28 | sysctl --system |
| 29 | |
| 30 | cat << EOF > /etc/init/hugepages.conf |
| 31 | start on runlevel [2345] |
| 32 | |
| 33 | task |
| 34 | |
| 35 | script |
| 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 |
| 40 | end script |
| 41 | EOF |
| 42 | |
| 43 | # Make sure we run that hugepages.conf right now |
| 44 | start hugepages |
| 45 | |
| 46 | # Setup the vpp code |
| 47 | cd ~vagrant/ |
Keith Burns (alagalah) | f5a857d | 2016-01-31 20:53:46 +0100 | [diff] [blame] | 48 | |
Ed Warnicke | eeee9e2 | 2016-02-02 17:47:17 -0800 | [diff] [blame] | 49 | sudo -u vagrant mkdir -p git/vpp |
| 50 | cp /vagrant/README.moved git/vpp/ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 51 | |
Dave Wallace | d255ee1 | 2016-02-03 22:34:04 -0500 | [diff] [blame] | 52 | # 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. |
| 57 | for 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 |
| 62 | done |
| 63 | |
Ed Warnicke | eeee9e2 | 2016-02-02 17:47:17 -0800 | [diff] [blame] | 64 | cd /vpp/ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 65 | |
| 66 | # Initial vpp build |
| 67 | if [ -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 Warnicke | b463ec8 | 2015-12-22 20:04:54 -0700 | [diff] [blame] | 75 | # Install debian packages |
| 76 | dpkg -i *.deb |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 77 | |
Ed Warnicke | b463ec8 | 2015-12-22 20:04:54 -0700 | [diff] [blame] | 78 | # Start vpp |
| 79 | start vpp |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 80 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 81 | cd ~vagrant/ |
| 82 | cat /vagrant/README |
| 83 | |
| 84 | fi |