Browse Source

Add build home and move to ubuntu

Change-Id: I35723d79269dce2a6afbb97ac81bbe093c9575a6
Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Guo Ruijing 3 years ago
parent
commit
5d3bd1e203
4 changed files with 20 additions and 13 deletions
  1. 6
    4
      ovs_build/build-ovs-dpdk.sh
  2. 6
    4
      ovs_build/build-ovs-nsh-dpdk.sh
  3. 5
    2
      ovs_build/build-ovs-nsh.sh
  4. 3
    3
      pre_build_hook

+ 6
- 4
ovs_build/build-ovs-dpdk.sh View File

@@ -1,16 +1,18 @@
1 1
 #!/bin/bash
2 2
 
3 3
 DPDK_VER=2.1.0
4
+BUILD_HOME=`pwd`/tmp
4 5
 
5 6
 export RTE_TARGET=x86_64-native-linuxapp-gcc
6
-export RTE_SDK=/dpdk-${DPDK_VER}
7
+export RTE_SDK=${BUILD_HOME}/dpdk-${DPDK_VER}
7 8
 export DPDK_BUILD=${RTE_SDK}/${RTE_TARGET}
8 9
 
9 10
 OVS_COMMIT=121daded51b9798fe3722824b27a05c16806cbd1
10 11
 URL_OVS=https://github.com/openvswitch/ovs.git
11 12
 URL_DPDK=http://dpdk.org/browse/dpdk/snapshot/dpdk-${DPDK_VER}.tar.gz
12 13
 
13
-cd /
14
+mkdir -p ${BUILD_HOME}
15
+cd ${BUILD_HOME}
14 16
 wget ${URL_DPDK}
15 17
 tar -xzvf dpdk-${DPDK_VER}.tar.gz
16 18
 cd dpdk-${DPDK_VER}
@@ -20,7 +22,7 @@ sed -i -e 's/CONFIG_RTE_LIBRTE_VHOST=n/CONFIG_RTE_LIBRTE_VHOST=y/' \
20 22
        config/common_linuxapp
21 23
 make install T=${RTE_TARGET}
22 24
 
23
-cd /
25
+cd ${BUILD_HOME}
24 26
 git clone ${URL_OVS} openvswitch
25 27
 cd openvswitch
26 28
 git checkout ${OVS_COMMIT} -b development
@@ -34,4 +36,4 @@ sed -i "2iDATAPATH_CONFIGURE_OPTS='--with-dpdk=$DPDK_BUILD'" debian/rules.module
34 36
 debian/rules build
35 37
 fakeroot debian/rules binary
36 38
 
37
-cp /*.deb /build
39
+cp ${BUILD_HOME}/*.deb /deb

+ 6
- 4
ovs_build/build-ovs-nsh-dpdk.sh View File

@@ -1,9 +1,10 @@
1 1
 #!/bin/bash
2 2
 
3 3
 DPDK_VER=2.1.0
4
+BUILD_HOME=`pwd`/tmp
4 5
 
5 6
 export RTE_TARGET=x86_64-native-linuxapp-gcc
6
-export RTE_SDK=/dpdk-${DPDK_VER}
7
+export RTE_SDK=${BUILD_HOME}/dpdk-${DPDK_VER}
7 8
 export DPDK_BUILD=${RTE_SDK}/${RTE_TARGET}
8 9
 
9 10
 OVS_COMMIT=121daded51b9798fe3722824b27a05c16806cbd1
@@ -11,7 +12,8 @@ PATCHES="060679 060680 060681 060682 060683 060684 060685"
11 12
 URL_OVS=https://github.com/openvswitch/ovs.git
12 13
 URL_DPDK=http://dpdk.org/browse/dpdk/snapshot/dpdk-${DPDK_VER}.tar.gz
13 14
 
14
-cd /
15
+mkdir -p ${BUILD_HOME}
16
+cd ${BUILD_HOME}
15 17
 wget ${URL_DPDK}
16 18
 tar -xzvf dpdk-${DPDK_VER}.tar.gz
17 19
 cd dpdk-${DPDK_VER}
@@ -21,7 +23,7 @@ sed -i -e 's/CONFIG_RTE_LIBRTE_VHOST=n/CONFIG_RTE_LIBRTE_VHOST=y/' \
21 23
        config/common_linuxapp
22 24
 make install T=${RTE_TARGET}
23 25
 
24
-cd /
26
+cd ${BUILD_HOME}
25 27
 git clone ${URL_OVS} openvswitch
26 28
 cd openvswitch
27 29
 git checkout ${OVS_COMMIT} -b development
@@ -38,4 +40,4 @@ sed -i "2iDATAPATH_CONFIGURE_OPTS='--with-dpdk=$DPDK_BUILD'" debian/rules.module
38 40
 debian/rules build
39 41
 fakeroot debian/rules binary
40 42
 
41
-cp /*.deb /build
43
+cp ${BUILD_HOME}/*.deb /deb

+ 5
- 2
ovs_build/build-ovs-nsh.sh View File

@@ -1,10 +1,13 @@
1 1
 #!/bin/bash
2 2
 
3
+BUILD_HOME=`pwd`/tmp
4
+
3 5
 OVS_COMMIT=121daded51b9798fe3722824b27a05c16806cbd1
4 6
 PATCHES="060679 060680 060681 060682 060683 060684 060685"
5 7
 URL_OVS=https://github.com/openvswitch/ovs.git
6 8
 
7
-cd /
9
+mkdir -p ${BUILD_HOME}
10
+cd ${BUILD_HOME}
8 11
 git clone ${URL_OVS} openvswitch
9 12
 cd openvswitch
10 13
 git checkout ${OVS_COMMIT} -b development
@@ -17,4 +20,4 @@ export DEB_BUILD_OPTIONS='parallel=8 nocheck'
17 20
 sed -i "s/2.4.90/2.4.90.nsh/g" debian/changelog
18 21
 debian/rules build
19 22
 fakeroot debian/rules binary
20
-cp /*.deb /build
23
+cp ${BUILD_HOME}/*.deb /deb

+ 3
- 3
pre_build_hook View File

@@ -22,9 +22,9 @@ function build_pkg {
22 22
       popd
23 23
       cd ${DIR}/ovs_build
24 24
       sudo docker build -t ovs_build .
25
-      sudo docker run -v ${DIR}/repositories/ubuntu/ovs-nsh:/build -t  ovs_build /ovs_build/build-ovs-nsh.sh
26
-      sudo docker run -v ${DIR}/repositories/ubuntu/ovs-dpdk:/build -t  ovs_build /ovs_build/build-ovs-dpdk.sh
27
-      sudo docker run -v ${DIR}/repositories/ubuntu/ovs-nsh-dpdk:/build -t  ovs_build /ovs_build/build-ovs-nsh-dpdk.sh
25
+      sudo docker run -v ${DIR}/repositories/ubuntu/:/deb -t  ovs_build /ovs_build/build-ovs-nsh.sh
26
+      sudo docker run -v ${DIR}/repositories/ubuntu/:/deb -t  ovs_build /ovs_build/build-ovs-dpdk.sh
27
+      sudo docker run -v ${DIR}/repositories/ubuntu/:/deb -t  ovs_build /ovs_build/build-ovs-nsh-dpdk.sh
28 28
       ;;
29 29
     *) echo "Not supported system"; exit 1;;
30 30
   esac

Loading…
Cancel
Save