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 |
Matt Johnson | 3b566bb | 2016-01-11 12:16:46 -0800 | [diff] [blame] | 13 | apt-get install -y build-essential autoconf automake bison libssl-dev ccache libtool git dkms debhelper emacs |
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/ |
| 51 | sudo -u vagrant mkdir git |
| 52 | cd git/ |
| 53 | |
| 54 | # You will need to alter this line to reflect reality. |
| 55 | sudo -H -u vagrant git clone /vpp |
| 56 | cd vpp/ |
| 57 | |
| 58 | # Initial vpp build |
| 59 | if [ -d build-root ]; then |
| 60 | # Bootstrap vpp |
| 61 | cd build-root/ |
| 62 | sudo -H -u vagrant ./bootstrap.sh |
| 63 | |
| 64 | # Build vpp |
| 65 | sudo -H -u vagrant make PLATFORM=vpp TAG=vpp_debug install-deb |
| 66 | |
Ed Warnicke | b463ec8 | 2015-12-22 20:04:54 -0700 | [diff] [blame] | 67 | # Install debian packages |
| 68 | dpkg -i *.deb |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 69 | |
Ed Warnicke | b463ec8 | 2015-12-22 20:04:54 -0700 | [diff] [blame] | 70 | # Start vpp |
| 71 | start vpp |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 72 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 73 | cd ~vagrant/ |
| 74 | cat /vagrant/README |
| 75 | |
| 76 | fi |