Changes to Centos bootstrap to remove ~/git/vpp if it exists before attempting clone
[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 # Load the uio kernel module
15 modprobe uio_pci_generic
16
17 echo uio_pci_generic >> /etc/modules-load.d/uio_pci_generic.conf
18
19 # Setup for hugepages using upstart so it persists across reboots
20 sysctl -w vm.nr_hugepages=1024
21 echo "vm.nr_hugepages=1024" >> /etc/sysctl.conf
22 mkdir -p /mnt/huge
23 echo "hugetlbfs       /mnt/huge  hugetlbfs       defaults        0 0" >> /etc/fstab
24 mount /mnt/huge
25
26 # Setup the vpp code
27 cd ~vagrant/
28 sudo -u vagrant mkdir git
29 cd git/
30
31 # Check if git exists and remove it before attempting clone, else clone ineffective when "reload --provision"
32 [ -d vpp ] && rm -rf vpp
33 sudo -H -u vagrant git clone /vpp
34 cd vpp
35
36 # Initial vpp build
37 if [ -d build-root ]; then
38   # Bootstrap vpp
39   cd build-root/
40   sudo -H -u vagrant ./bootstrap.sh
41
42   # Build vpp
43   sudo -H -u vagrant make PLATFORM=vpp TAG=vpp_debug install-packages
44   cd ~vagrant/
45   cat /vagrant/README
46 fi