60c2456d1ca9565bee986f4a74e9ea5d1442edc2
[vpp.git] / build-root / vagrant / bootstrap.centos7.sh
1
2 # Standard update + upgrade dance
3 yum check-update
4 yum update -y
5
6 # Install build tools
7 yum groupinstall 'Development Tools' -y
8 yum install openssl-devel -y
9 yum install glibc-static -y
10
11 # Install jdk and maven
12 yum install -y java-1.8.0-openjdk-devel
13
14 # Install EPEL
15 yum install -y epel-release
16
17 # Install components to build Ganglia modules
18 yum install -y apr-devel
19 yum install -y --enablerepo=epel libconfuse-devel
20 yum install -y --enablerepo=epel ganglia-devel
21
22 # PCIutils
23 yum install -y pciutils
24
25 # Load the uio kernel module
26 modprobe uio_pci_generic
27
28 echo uio_pci_generic >> /etc/modules-load.d/uio_pci_generic.conf
29
30 # Setup for hugepages using upstart so it persists across reboots
31 sysctl -w vm.nr_hugepages=1024
32 echo "vm.nr_hugepages=1024" >> /etc/sysctl.conf
33 mkdir -p /mnt/huge
34 echo "hugetlbfs       /mnt/huge  hugetlbfs       defaults        0 0" >> /etc/fstab
35 mount /mnt/huge
36
37 # Setup the vpp code
38 cd ~vagrant/
39 sudo -u vagrant mkdir git
40 cd git/
41
42 # Check if git exists and remove it before attempting clone, else clone ineffective when "reload --provision"
43 [ -d vpp ] && rm -rf vpp
44 sudo -H -u vagrant git clone /vpp
45 cd vpp
46
47 # Initial vpp build
48 if [ -d build-root ]; then
49   # Bootstrap vpp
50   cd build-root/
51   sudo -H -u vagrant ./bootstrap.sh
52
53   # Build vpp
54   sudo -H -u vagrant make PLATFORM=vpp TAG=vpp_debug install-packages
55   cd ~vagrant/
56   cat /vagrant/README
57 fi