Browse Source

Build OVS with DPDK

Change-Id: I4f8657eeef418ee90fcb6a399541da1911c2ab27
Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Guo Ruijing 2 years ago
parent
commit
b15c57083b
1 changed files with 64 additions and 32 deletions
  1. 64
    32
      ovs_build/build-ovs-dpdk.sh

+ 64
- 32
ovs_build/build-ovs-dpdk.sh View File

@@ -1,39 +1,71 @@
1 1
 #!/bin/bash
2 2
 
3
-DPDK_VER=2.1.0
4
-BUILD_HOME=`pwd`/tmp
3
+OVS_COMMIT=cd4764fdd8ce0aa0063525dad0e67f20b3bcf6e9
5 4
 
6
-export RTE_TARGET=x86_64-native-linuxapp-gcc
7
-export RTE_SDK=${BUILD_HOME}/dpdk-${DPDK_VER}
8
-export DPDK_BUILD=${RTE_SDK}/${RTE_TARGET}
5
+BUILD_HOME=`pwd`
6
+sudo apt-get update -y
7
+sudo apt-get build-dep openvswitch -y
8
+sudo apt-get -y install devscripts dpkg-dev git wget
9 9
 
10
-OVS_COMMIT=121daded51b9798fe3722824b27a05c16806cbd1
11
-URL_OVS=https://github.com/openvswitch/ovs.git
12
-URL_DPDK=http://dpdk.org/browse/dpdk/snapshot/dpdk-${DPDK_VER}.tar.gz
13
-
14
-mkdir -p ${BUILD_HOME}
15 10
 cd ${BUILD_HOME}
16
-wget ${URL_DPDK}
17
-tar -xzvf dpdk-${DPDK_VER}.tar.gz
18
-cd dpdk-${DPDK_VER}
19
-sed -i -e 's/CONFIG_RTE_LIBRTE_VHOST=n/CONFIG_RTE_LIBRTE_VHOST=y/' \
20
-       -e 's/CONFIG_RTE_BUILD_COMBINE_LIBS=n/CONFIG_RTE_BUILD_COMBINE_LIBS=y/' \
21
-       -e 's/CONFIG_RTE_PKTMBUF_HEADROOM=128/CONFIG_RTE_PKTMBUF_HEADROOM=256/' \
22
-       config/common_linuxapp
23
-make install T=${RTE_TARGET}
11
+wget https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc
12
+wget https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0.orig.tar.gz
13
+wget https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.debian.tar.xz
14
+dpkg-source -x dpdk_2.2.0-0ubuntu8.dsc
15
+
16
+# copy from debian/control
17
+sudo apt-get install -y debhelper \
18
+               dh-python \
19
+               dh-systemd \
20
+               doxygen  \
21
+               graphviz  \
22
+               inkscape  \
23
+               libcap-dev  \
24
+               libpcap-dev  \
25
+               libxen-dev  \
26
+               libxenstore3.0  \
27
+               python  \
28
+               python-sphinx  \
29
+               texlive-fonts-recommended  \
30
+               texlive-latex-extra
31
+
32
+cd dpdk-2.2.0; rm -rf debian/patches/; debian/rules build; fakeroot debian/rules binary
33
+cd ${BUILD_HOME}; sudo dpkg -i *.deb
24 34
 
25 35
 cd ${BUILD_HOME}
26
-git clone ${URL_OVS} openvswitch
27
-cd openvswitch
28
-git checkout ${OVS_COMMIT} -b development
29
-
30
-export DEB_BUILD_OPTIONS='parallel=8 nocheck'
31
-sed -i "s/2.4.90/2.4.90.dpdk/g" debian/changelog
32
-sed -i "s/DATAPATH_CONFIGURE_OPTS.*=.*//" debian/rules
33
-sed -i "2iDATAPATH_CONFIGURE_OPTS='--with-dpdk=$DPDK_BUILD'" debian/rules
34
-sed -i "s/DATAPATH_CONFIGURE_OPTS.*=.*//" debian/rules.modules
35
-sed -i "2iDATAPATH_CONFIGURE_OPTS='--with-dpdk=$DPDK_BUILD'" debian/rules.modules
36
-debian/rules build
37
-fakeroot debian/rules binary
38
-
39
-cp ${BUILD_HOME}/*.deb /deb
36
+wget https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0.orig.tar.gz
37
+wget https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.dsc
38
+wget https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.debian.tar.xz
39
+dpkg-source -x  openvswitch-dpdk_2.4.0-0ubuntu1.dsc
40
+
41
+
42
+# copy from debian/control
43
+sudo apt-get intall -y autoconf \
44
+               automake \
45
+               bzip2 \
46
+               debhelper \
47
+               dh-autoreconf \
48
+               dh-systemd \
49
+               graphviz \
50
+               libdpdk-dev \
51
+               libfuse-dev \
52
+               libssl-dev \
53
+               libtool \
54
+               openssl \
55
+               procps \
56
+               python-all \
57
+               python-qt4 \
58
+               python-twisted-conch \
59
+               python-zopeinterface
60
+
61
+git clone https://github.com/openvswitch/ovs.git
62
+cd ovs; git checkout ${OVS_COMMIT}
63
+cd ${BUILD_HOME}; tar czvf ovs.tar.gz ovs
64
+rm -rf openvswitch-dpdk-2.5.0*
65
+cd openvswitch-dpdk-2.4.0; uupdate -v 2.5.0 ../ovs.tar.gz
66
+cd ../openvswitch-dpdk-2.5.0
67
+sed -i "s/include\/rte_config.h/include\/dpdk\/rte_config.h/" acinclude.m4
68
+sed -i 's/DPDK_INCLUDE=.*/DPDK_INCLUDE=$RTE_SDK\/include\/dpdk/'  acinclude.m4
69
+autoreconf --install
70
+rm -rf debian/patches/ .git;
71
+debian/rules build; fakeroot debian/rules binary

Loading…
Cancel
Save