VPP-8: use jdk8 for VPP builds
[ci-management.git] / vagrant / basebuild / bootstrap.sh
1
2 ubuntu_systems() {
3
4     if [ "$(lsb_release -r | awk '{print $2}')" == "14.04" ]
5     then
6         # openjdk-8-jdk is not available in 14.04 repos by default
7         add-apt-repository ppa:openjdk-r/ppa
8     fi
9
10     # Standard update + upgrade dance
11     apt-get update
12     apt-get upgrade -y
13
14     # Fix the silly notion that /bin/sh should point to dash by pointing it to bash
15
16     sudo update-alternatives --install /bin/sh sh /bin/bash 100
17
18     # Install build tools
19     apt-get install -y build-essential autoconf automake bison libssl-dev ccache libtool git dkms debhelper libganglia1-dev libapr1-dev libconfuse-dev dh-systemd
20
21     # Install other stuff
22     apt-get install -y --force-yes bridge-utils vim gdb iproute2
23
24     # Install debian packaging tools
25     apt-get install -y debhelper dkms
26
27     # Install uio
28     apt-get install -y linux-image-extra-`uname -r`
29
30     # Install jdk and maven
31     apt-get install -y openjdk-8-jdk
32     # $$$ comment out for the moment
33     # apt-get install -y --force-yes maven3
34
35     # Load the uio kernel module
36     modprobe uio_pci_generic
37
38     # Make sure uio loads at boot time
39     echo uio_pci_generic >> /etc/modules
40
41     # Setup for hugepages using upstart so it persists across reboots
42     sysctl -w vm.nr_hugepages=1024
43     mkdir -p /mnt/huge
44     echo "hugetlbfs       /mnt/huge  hugetlbfs       defaults        0 0" >> /etc/fstab
45     mount /mnt/huge
46
47     # Install virtualenv for test execution
48     apt-get install -y --force-yes python-virtualenv python-pip python-dev python3-dev
49 }
50
51 rh_systems() {
52     # Install build tools
53     yum groupinstall 'Development Tools' -y
54     yum install openssl-devel -y
55     yum install glibc-static -y
56
57     # Install jdk and maven
58     yum install -y java-1.8.0-openjdk-devel
59
60     # Install python development
61     yum install -y python34-devel
62
63     # Install EPEL
64     yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
65
66     # Install components to build Ganglia modules
67     yum install -y apr-devel
68     yum install -y --enablerepo=epel libconfuse-devel
69     yum install -y --enablerepo=epel ganglia-devel
70     yum install -y --enablerepo=epel mock
71 }
72
73 echo "---> Attempting to detect OS"
74 # OS selector
75 if [ -f /usr/bin/yum ]
76 then
77     OS='RH'
78 else
79     OS='UBUNTU'
80 fi
81
82 case "$OS" in
83     RH)
84         echo "---> RH type system detected"
85         rh_systems
86     ;;
87     UBUNTU)
88         echo "---> Ubuntu system detected"
89         ubuntu_systems
90     ;;
91     *)
92         echo "---> Unknown operating system"
93     ;;
94 esac