3 # Copyright (c) 2016-2017 Intel Corporation
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 INSTALL_OVS_BIN="/usr/src"
20 if [[ $EUID -ne 0 ]]; then
21 echo "Must be root to run $0"
27 echo "Install required libraries to run collectd..."
28 pkg=(git flex bison build-essential pkg-config automake autotools-dev libltdl-dev cmake qemu-kvm libvirt-bin bridge-utils numactl libnuma-dev libpcap-dev)
29 for i in "${pkg[@]}"; do
30 dpkg-query -W --showformat='${Status}\n' "${i}"|grep "install ok installed"
31 if [ "$?" -eq "1" ]; then
33 apt-get -y install "${i}";
43 if [ -n "${download_type}" ]; then
44 echo "Download ${download_type} zip"
46 # rm goes into calling code
48 if [ ! -e "${url##*/}" ]; then
57 if [[ $DPDK_VERSION != "" ]]; then
58 export DPDK_DIR=$INSTALL_OVS_BIN/dpdk-stable-$DPDK_VERSION
59 export RTE_TARGET=x86_64-native-linuxapp-gcc
60 export DPDK_BUILD=$DPDK_DIR/$RTE_TARGET
62 DPDK_DOWNLOAD="http://fast.dpdk.org/rel/dpdk-$DPDK_VERSION.tar.xz"
63 download_zip "${DPDK_DOWNLOAD}" "DPDK"
64 cd dpdk-stable-"$DPDK_VERSION"
65 make install -j T=$RTE_TARGET
73 if [[ $OVS_VERSION != "" ]]; then
74 rm -rf openswitch-"$OVS_VERSION"
75 OVS_DOWNLOAD="http://openvswitch.org/releases/openvswitch-$OVS_VERSION.tar.gz"
76 download_zip "${OVS_DOWNLOAD}" "OVS"
77 cd openvswitch-"$OVS_VERSION"
78 export OVS_DIR=/usr/src/openvswitch-$OVS_VERSION
80 if [[ $DPDK_VERSION != "" ]]; then
81 ./configure --with-dpdk="$DPDK_BUILD"
100 OVS_VERSION="${i#*=}"
103 DPDK_VERSION="${i#*=}"
106 export http_proxy="${i#*=}"
107 export https_proxy="${i#*=}"
110 echo "CommandLine options:"
111 echo "===================="
112 echo "1. ovs_dpdk install mode:"
113 echo "./ovs_install.sh --ovs=<2.7.0> --dpdk=<supported dpdk versoin for given ovs> -p=<proxy>"