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 |
Dave Barach | c23f7bc | 2016-01-28 09:36:05 -0500 | [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 |
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 | |
| 26 | # Install debian packaging tools |
| 27 | apt-get install -y debhelper dkms |
| 28 | |
| 29 | # Setup for hugepages using upstart so it persists across reboots |
| 30 | echo "vm.nr_hugepages=1024" >> /etc/sysctl.d/20-hugepages.conf |
| 31 | sysctl --system |
| 32 | |
| 33 | cat << EOF > /etc/init/hugepages.conf |
| 34 | start on runlevel [2345] |
| 35 | |
| 36 | task |
| 37 | |
| 38 | script |
| 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 |
| 43 | end script |
| 44 | EOF |
| 45 | |
| 46 | # Make sure we run that hugepages.conf right now |
| 47 | start hugepages |
| 48 | |
| 49 | # Setup the vpp code |
| 50 | cd ~vagrant/ |
Keith Burns (alagalah) | f5a857d | 2016-01-31 20:53:46 +0100 | [diff] [blame] | 51 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 52 | sudo -u vagrant mkdir git |
| 53 | cd git/ |
| 54 | |
Keith Burns (alagalah) | f5a857d | 2016-01-31 20:53:46 +0100 | [diff] [blame] | 55 | # Check if git exists and remove it before attempting clone, else clone ineffective when "reload --provision" |
| 56 | [ -d vpp ] && rm -rf vpp |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 57 | sudo -H -u vagrant git clone /vpp |
| 58 | cd vpp/ |
| 59 | |
| 60 | # Initial vpp build |
| 61 | if [ -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 Warnicke | b463ec8 | 2015-12-22 20:04:54 -0700 | [diff] [blame] | 69 | # Install debian packages |
| 70 | dpkg -i *.deb |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 71 | |
Ed Warnicke | b463ec8 | 2015-12-22 20:04:54 -0700 | [diff] [blame] | 72 | # Start vpp |
| 73 | start vpp |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 74 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 75 | cd ~vagrant/ |
| 76 | cat /vagrant/README |
| 77 | |
| 78 | fi |