Build OVS with DPDK

Change-Id: I4f8657eeef418ee90fcb6a399541da1911c2ab27
Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
This commit is contained in:
Guo Ruijing 2016-05-18 14:48:31 +08:00
parent 5d3bd1e203
commit b15c57083b
1 changed files with 64 additions and 32 deletions

View File

@ -1,39 +1,71 @@
#!/bin/bash #!/bin/bash
DPDK_VER=2.1.0 OVS_COMMIT=cd4764fdd8ce0aa0063525dad0e67f20b3bcf6e9
BUILD_HOME=`pwd`/tmp
export RTE_TARGET=x86_64-native-linuxapp-gcc BUILD_HOME=`pwd`
export RTE_SDK=${BUILD_HOME}/dpdk-${DPDK_VER} sudo apt-get update -y
export DPDK_BUILD=${RTE_SDK}/${RTE_TARGET} sudo apt-get build-dep openvswitch -y
sudo apt-get -y install devscripts dpkg-dev git wget
OVS_COMMIT=121daded51b9798fe3722824b27a05c16806cbd1
URL_OVS=https://github.com/openvswitch/ovs.git
URL_DPDK=http://dpdk.org/browse/dpdk/snapshot/dpdk-${DPDK_VER}.tar.gz
mkdir -p ${BUILD_HOME}
cd ${BUILD_HOME}
wget ${URL_DPDK}
tar -xzvf dpdk-${DPDK_VER}.tar.gz
cd dpdk-${DPDK_VER}
sed -i -e 's/CONFIG_RTE_LIBRTE_VHOST=n/CONFIG_RTE_LIBRTE_VHOST=y/' \
-e 's/CONFIG_RTE_BUILD_COMBINE_LIBS=n/CONFIG_RTE_BUILD_COMBINE_LIBS=y/' \
-e 's/CONFIG_RTE_PKTMBUF_HEADROOM=128/CONFIG_RTE_PKTMBUF_HEADROOM=256/' \
config/common_linuxapp
make install T=${RTE_TARGET}
cd ${BUILD_HOME} cd ${BUILD_HOME}
git clone ${URL_OVS} openvswitch wget https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc
cd openvswitch wget https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0.orig.tar.gz
git checkout ${OVS_COMMIT} -b development wget https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.debian.tar.xz
dpkg-source -x dpdk_2.2.0-0ubuntu8.dsc
export DEB_BUILD_OPTIONS='parallel=8 nocheck' # copy from debian/control
sed -i "s/2.4.90/2.4.90.dpdk/g" debian/changelog sudo apt-get install -y debhelper \
sed -i "s/DATAPATH_CONFIGURE_OPTS.*=.*//" debian/rules dh-python \
sed -i "2iDATAPATH_CONFIGURE_OPTS='--with-dpdk=$DPDK_BUILD'" debian/rules dh-systemd \
sed -i "s/DATAPATH_CONFIGURE_OPTS.*=.*//" debian/rules.modules doxygen \
sed -i "2iDATAPATH_CONFIGURE_OPTS='--with-dpdk=$DPDK_BUILD'" debian/rules.modules graphviz \
debian/rules build inkscape \
fakeroot debian/rules binary libcap-dev \
libpcap-dev \
libxen-dev \
libxenstore3.0 \
python \
python-sphinx \
texlive-fonts-recommended \
texlive-latex-extra
cp ${BUILD_HOME}/*.deb /deb cd dpdk-2.2.0; rm -rf debian/patches/; debian/rules build; fakeroot debian/rules binary
cd ${BUILD_HOME}; sudo dpkg -i *.deb
cd ${BUILD_HOME}
wget https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0.orig.tar.gz
wget https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.dsc
wget https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.debian.tar.xz
dpkg-source -x openvswitch-dpdk_2.4.0-0ubuntu1.dsc
# copy from debian/control
sudo apt-get intall -y autoconf \
automake \
bzip2 \
debhelper \
dh-autoreconf \
dh-systemd \
graphviz \
libdpdk-dev \
libfuse-dev \
libssl-dev \
libtool \
openssl \
procps \
python-all \
python-qt4 \
python-twisted-conch \
python-zopeinterface
git clone https://github.com/openvswitch/ovs.git
cd ovs; git checkout ${OVS_COMMIT}
cd ${BUILD_HOME}; tar czvf ovs.tar.gz ovs
rm -rf openvswitch-dpdk-2.5.0*
cd openvswitch-dpdk-2.4.0; uupdate -v 2.5.0 ../ovs.tar.gz
cd ../openvswitch-dpdk-2.5.0
sed -i "s/include\/rte_config.h/include\/dpdk\/rte_config.h/" acinclude.m4
sed -i 's/DPDK_INCLUDE=.*/DPDK_INCLUDE=$RTE_SDK\/include\/dpdk/' acinclude.m4
autoreconf --install
rm -rf debian/patches/ .git;
debian/rules build; fakeroot debian/rules binary