Initial commit of vpp code.
[vpp.git] / build-root / vagrant / bootstrap.ubuntu1404.sh
1 # Standard update + upgrade dance
2 apt-get update
3 apt-get upgrade -y
4
5 # Fix the silly notion that /bin/sh should point to dash by pointing it to bash
6
7 sudo update-alternatives --install /bin/sh sh /bin/bash 100
8
9 # Install build tools
10 apt-get install -y build-essential autoconf automake bison libssl-dev ccache libtool git dkms debhelper
11
12 # Install other stuff
13 # apt-get install -y qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
14
15 # Install uio
16 apt-get install -y linux-image-extra-`uname -r`
17
18 # Install jdk and maven
19 apt-get install -y openjdk-7-jdk
20 # $$$ comment out for the moment
21 # apt-get install -y --force-yes maven3
22
23 # Install debian packaging tools
24 apt-get install -y debhelper dkms
25
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/
48 sudo -u vagrant mkdir git
49 cd git/
50
51 # You will need to alter this line to reflect reality.
52 sudo -H -u vagrant git clone /vpp
53 cd vpp/
54
55 # Initial vpp build
56 if [ -d build-root ]; then
57   # Bootstrap vpp
58   cd build-root/
59   sudo -H -u vagrant ./bootstrap.sh
60
61   # Build vpp
62   sudo -H -u vagrant make PLATFORM=vpp TAG=vpp_debug install-deb
63
64   # Stick the dpdk module in the canonical place
65   cp ./install-vpp_debug-native/dpdk/kmod/igb_uio.ko /lib/modules/`uname -r`/kernel/drivers/uio/
66   depmod
67
68   # Load igb_uio into the kernel
69   modprobe igb_uio
70
71   # Make sure igb_uio loads at boot time
72   # Make sure uio loads at boot time
73   echo  igb_uio >> /lib/modprobe.d/igb_uio.conf
74   cd ~vagrant/
75   cat /vagrant/README
76
77 fi