3 # vim: ts=4 sw=4 sts=4 et tw=72 :
7 # RH Install build tools
8 echo "---> Installing RH build tools $(date +'%Y%m%dT%H%M%S')"
9 RH_TOOLS_PKGS="@development redhat-lsb glibc-static \
10 java-1.8.0-openjdk-devel yum-utils openssl-devel apr-devel indent rpm"
11 yum install -y ${RH_TOOLS_PKGS}
13 # Memory leakage checks
14 yum install -y valgrind
16 # RH Install Python dependencies
17 ###REMOVED mysql-devel
18 echo "---> Installing RH Python dependencies $(date +'%Y%m%dT%H%M%S')"
19 RH_PYTHON_PKGS="python-devel python-virtualenv python-setuptools \
20 python-pip kernel-devel epel-rpm-macros"
21 pip install --upgrade pip
22 yum install -y ${RH_PYTHON_PKGS}
25 # RH Install Documentation packages
26 ###Removed python-pyparsing
27 echo "---> Installing RH documentation packages $(date +'%Y%m%dT%H%M%S')"
28 RH_DOC_PKGS="doxygen graphviz python-jinja2 asciidoc \
29 dblatex source-highlight python-sphinx libxml2 libffi-devel python-cffi"
30 yum install -y install ${RH_DOC_PKGS}
32 # RH Install GCC packages
33 echo "---> Installing RH GCC packages $(date +'%Y%m%dT%H%M%S')"
34 RH_GCC_PKGS="cpp gcc c++ cmake make"
35 yum install -y ${RH_GCC_PKGS}
37 # RH Install components to build Ganglia modules
38 echo "---> Installing RH components $(date +'%Y%m%dT%H%M%S')"
39 RH_GANGLIA_MODS="libconfuse-devel ganglia-devel mock"
40 yum install -y --enablerepo=epel ${RH_GANGLIA_MODS}
42 # RH Install module for VPP project
43 echo uio_pci_generic >> /etc/modules
45 # RH Install VPP packages to shorten build times
46 echo "---> Installing VPP dependencies $(date +'%Y%m%dT%H%M%S')"
47 RH_VPP_PKGS="curl autoconf automake bison ccache dkms git libtool \
48 libconfuse-dev git-review cscope"
49 yum install -y ${RH_VPP_PKGS}
51 yum groupinstall "Development Tools"
52 # RH Install TLDK dependencies
53 RH_TLKD_PKGS="libpcap-devel libcap-devel scapy"
54 yum install -y ${RH_TLKD_PKGS}
56 # RH Install Puppet packages
57 PUPPET_PKGS="libxml2-devel libxslt-devel ruby-devel zlib-devel"
58 yum install -y ${PUPPET_PKGS}
60 # RH Install debuginfo packages
61 #echo "---> Installing debug packages $(date +'%Y%m%dT%H%M%S')"
62 #RH_DEBUG_PKGS="glibc openssl-libs zlib"
63 #debuginfo-install -y ${RH_DEBUG_PKGS}
65 # # RH Packer builds happen from the centos flavor images
66 # PACKERDIR=$(mktemp -d)
67 # # disable double quote checking
68 # # shellcheck disable=SC2086
70 # wget https://releases.hashicorp.com/packer/0.10.1/packer_0.10.1_linux_amd64.zip
71 # unzip packer_0.10.1_linux_amd64.zip -d /usr/local/bin/
72 # # rename packer to avoid conflicts with cracklib
73 # mv /usr/local/bin/packer /usr/local/bin/packer.io
75 # # cleanup from the installation
76 # # disable double quote checking
77 # # shellcheck disable=SC2086
79 # # cleanup from previous install process
80 # if [ -d /tmp/packer ]
88 # DEB add Toolchain repo
89 sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
91 #Configuring thirdparty Nexus repo
92 echo "deb [trusted=yes] https://nexus.fd.io/content/repositories/thirdparty ./" > /etc/apt/sources.list.d/FD.io.thirdparty.list
94 # DEB Install PPA packages
95 echo "---> Adding '$1' PPA $(date +'%Y%m%dT%H%M%S')"
96 dpkg -l software-properties-common > /dev/null 2>&1 || software-properties-common
98 listfile=$(perl -e "print(q{$1} =~ m{^ppa:(.+)/ppa})")-ppa-${CODENAME}.list
99 if [ ! -f /etc/apt/sources.list.d/${listfile} ]
101 do_retry sudo apt-add-repository -y $1
107 echo "---> Installing cloud packages $(date +'%Y%m%dT%H%M%S')"
108 CLOUD_PKGS="cloud-initramfs-dyn-netconf cloud-initramfs-growroot \
109 cloud-initramfs-rescuevol"
110 apt install -y ${CLOUD_PKGS}
112 # DEB Install Python dependencies
113 echo "---> Installing Python dependencies $(date +'%Y%m%dT%H%M%S')"
114 PYTHON_PKGS="python-all python-dev python-virtualenv python-setuptools \
115 python-pip libssl-dev libmysqlclient-dev python2.7 libffi-dev \
117 apt install -y ${PYTHON_PKGS}
119 # Memory leakage checks
120 apt install -y valgrind
122 # DEB Install Documentation packages
123 echo "---> Installing documentation packages $(date +'%Y%m%dT%H%M%S')"
124 DOC_PKGS="doxygen graphviz python-pyparsing python-jinja2 asciidoc \
125 dblatex source-highlight"
126 apt install -y ${DOC_PKGS}
128 # DEB Install the correct version of toolchain packages
129 echo "---> Installing latest toolchain packages from PPA $(date +'%Y%m%dT%H%M%S')"
131 #Retry to prevent timeout failure
132 #echo "---> Updating package index $(date +'%Y%m%dT%H%M%S')"
133 #do_retry sudo apt-get update
134 #echo "<--- Updating package index $(date +'%Y%m%dT%H%M%S')"
135 #echo "<--- Adding '$1' PPA $(date +'%Y%m%dT%H%M%S')"
137 # DEB Install GCC packages
138 echo "---> Installing GCC-5 packages $(date +'%Y%m%dT%H%M%S')"
139 GCC_PKGS="cpp gcc g++ cmake lcov gcc-multilib"
140 apt install -y ${GCC_PKGS}
142 # DEB Install VPP packages to shorten build times
143 echo "---> Installing VPP DEB_DEPENDS packages $(date +'%Y%m%dT%H%M%S')"
144 VPP_PKGS="curl build-essential autoconf automake bison libssl-dev ccache \
145 dkms git libtool libganglia1-dev libapr1-dev dh-systemd \
146 libconfuse-dev git-review exuberant-ctags cscope indent pkg-config emacs"
147 apt install -y ${VPP_PKGS}
149 # DEB Install CSIT packages
150 CSIT_PKGS="libxml2 libxml2-dev libxslt-dev zlib1g-dev bc unzip"
151 apt install -y ${CSIT_PKGS}
153 # DEB Install latest kernel and uio
154 echo "---> Installing kernel image and header packages $(date +'%Y%m%dT%H%M%S')"
155 DEB_PKGS="linux-image-extra-virtual linux-headers-virtual linux-headers-`uname -r`"
156 apt install -y ${DEB_PKGS}
158 # DEB Install deb_dpdk packages to shorten build times
159 ###REMOVED sphinx-rtd-theme
160 echo "---> Installing deb_dpdk packages $(date +'%Y%m%dT%H%M%S')"
161 DEB_DPDK_PKGS="google-mock lsb-release dpkg-dev debian-xcontrol devscripts \
162 pristine-tar dh-python python-sphinx libpcap0.8-dev libstdc++5 \
163 python-scapy inkscape libxen-dev libxenstore3.0 python-sphinx-rtd-theme \
164 python3 python3-sphinx python3-sphinx-rtd-theme libnuma-dev \
166 apt install -y ${DEB_DPDK_PKGS}
168 sudo apt install -y libcap-dev libpcap-dev
170 TEXLIVE_PKGS="texlive-fonts-recommended tex-common texlive-base \
171 texlive-binaries texlive-pictures texlive-latex-recommended \
172 preview-latex-style texlive-latex-extra"
173 apt install -y ${TEXLIVE_PKGS}
174 echo "<--- Installing deb_dpdk packages $(date +'%Y%m%dT%H%M%S')"
176 # DEB Manipulation tools, edits debugger, and LSB
177 echo "---> Installing tools packages $(date +'%Y%m%dT%H%M%S')"
178 TOOL_PKGS="iproute2 ethtool vlan bridge-utils vim gdb lsb-release gdbserver"
179 apt install -y ${TOOL_PKGS}
181 # DEB Updating CA certificates
182 echo "---> Forcing CA certificate update $(date +'%Y%m%dT%H%M%S')"
183 sudo update-ca-certificates -f > /dev/null 2>&1
184 echo "<--- Forcing CA certificate update $(date +'%Y%m%dT%H%M%S')"
189 # Creating a function to install packages. openSUSE doesn't read the
190 # packages variables as expected.
191 function install_pkgs ()
194 zypper -n install "$pkgs"
198 # Update to latest available packages and security bug-fixes
201 # Replacing cloud.cfg, it's not supported by cloud-init
202 cp /etc/cloud/cloud.cfg.orig /etc/cloud/cloud.cfg
204 # Install openSUSE Development tool packages
205 echo "--->Installing Development tool packages $(date +'%Y%m%dT%H%M%S')"
206 ODTL="java-1_8_0-openjdk-devel indent pkg-config lcov cscope libtool ctags \
207 bison libxml2-tools libxslt-devel python-virtualenv libopenssl-devel"
210 # Install openSUSE Development resources and libraries
211 echo "--->Installing DEV resources & libraries $(date +'%Y%m%dT%H%M%S')"
212 ODRL="kernel-devel libffi-devel libconfuse-devel libapr1 libapr1-devel \
213 libexpat-devel pcre-devel libxml2-devel ruby-devel zlib-devel \
214 glibc-devel-static libstdc++6 libclang llvm-clang check-devel"
217 # Install openSUSE Packaging utilities and resources
218 echo "--->Installing PKG utilities & resources $(date +'%Y%m%dT%H%M%S')"
219 OPP="yum-utils rpm-build"
222 # Install openSUSE Python resources and libraries
223 echo "--->Installing Python resources & libraries $(date +'%Y%m%dT%H%M%S')"
224 OPRL="python-devel python-setuptools python-pip python-wheel python-mock \
225 python3-devel python3-pip python-rpm-macros shadow libnuma-devel"
228 # Install openSUSE Documentation packages
229 echo "---> Installing Documentation packages $(date +'%Y%m%dT%H%M%S')"
230 ODP="doxygen graphviz asciidoc dblatex source-highlight python-sphinx \
231 libxml2 python-jinja2 python-cffi python-pyparsing \
232 python-sphinx_rtd_theme"
235 # Install openSUSE Compliation packages
236 echo "--->Installing Compliation packages $(date +'%Y%m%dT%H%M%S')"
237 OCP="cpp gcc gcc-c++ cmake make gcc6 libstdc++-devel ruby-devel"
240 # Install openSUSE Debugging tool packages
241 echo "--->Installing Debugging tool packages $(date +'%Y%m%dT%H%M%S')"
242 ODTP="valgrind rrdtool rrdtool-devel autoconf automake ccache chrpath"
245 # Install openSUSE Misc tool packages
246 echo "--->Installing Misc tool packages $(date +'%Y%m%dT%H%M%S')"
247 OMTP="openssl emacs curl git git-review unzip devscripts \
248 iproute2 ethtool vlan bridge-utils vim gdb gdbserver \
249 lsb-release distribution-release"
252 # Install openSUSE TLDK dependencies
253 OTD="libpcap-devel libcap-devel"
254 install_pkgs "${OTD}"
255 zypper -n install -t pattern devel_basis
257 # Leap 42.3 does not have a recent NASM version and VPP requires NASM 2.12
258 # minimum so installing from TW repo
260 https://download.opensuse.org/tumbleweed/repo/oss/suse/x86_64/nasm-2.13.01-2.2.x86_64.rpm
265 echo 'Configure keep alive to prevent timeout during testing'
266 local SSH_CFG=/etc/ssh/ssh_config
267 echo "TCPKeepAlive true" | sudo tee -a ${SSH_CFG} >/dev/null 2>&1
268 echo "ServerAliveCountMax 30" | sudo tee -a ${SSH_CFG} >/dev/null 2>&1
269 echo "ServerAliveInterval 10" | sudo tee -a ${SSH_CFG} >/dev/null 2>&1
271 # Following installs hashicorp's packer binary which is required for
272 # ci-management-{verify,merge}-packer jobs
275 wget https://releases.hashicorp.com/packer/0.12.2/packer_0.12.2_linux_amd64.zip
276 unzip packer_0.12.2_linux_amd64.zip -d /usr/local/bin/
277 # note: rename to packer.io to avoid conflict with cracklib packer
278 mv /usr/local/bin/packer /usr/local/bin/packer.io
280 # Install packagecloud.io
282 apt-get install ruby-dev
284 gem install package_cloud
287 echo "---> Detecting OS"
288 ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
291 fedora|centos|redhat)
292 echo "---> RH type system detected"
296 echo "---> Ubuntu system detected"
300 echo "---> openSuSE system detected"
304 echo "---> Unknown operating system"
308 # execute steps for all systems