diff options
author | David Marchand <david.marchand@redhat.com> | 2019-06-19 09:26:29 +0200 |
---|---|---|
committer | Ilya Maximets <i.maximets@samsung.com> | 2019-06-19 10:43:59 +0300 |
commit | 3925b3e9afbee28a49d04752125636fedc970d13 (patch) | |
tree | 9707ef08af0c0297f075d6849ce050e3885f2476 | |
parent | 7639e06680b9c0a5ba84c075ca019e0adfa52883 (diff) | |
download | openvswitch-3925b3e9afbee28a49d04752125636fedc970d13.tar.gz |
travis: Make it possible to build against a dpdk branch.
Rework the build script so that we can pass branches and tags.
With this, DPDK_VER can be passed as:
- a string starting with refs/ which is understood as a git reference.
This triggers a git clone on DPDK_GIT (default value points to
https://dpdk.org/git/dpdk) for a single branch pointing to this
reference (to save some disk),
- else, any other string which is understood as an official release.
This triggers a tarball download on dpdk.org.
Signed-off-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
-rwxr-xr-x | .travis/linux-build.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh index 3a5c4a2e7..9d84411c5 100755 --- a/.travis/linux-build.sh +++ b/.travis/linux-build.sh @@ -65,16 +65,16 @@ function install_kernel() function install_dpdk() { - if [ -n "$DPDK_GIT" ]; then - git clone $DPDK_GIT dpdk-$1 - cd dpdk-$1 - git checkout tags/v$1 + if [ "${1##refs/*/}" != "${1}" ]; then + DPDK_GIT=${DPDK_GIT:-https://dpdk.org/git/dpdk} + git clone --single-branch $DPDK_GIT dpdk-git -b "${1##refs/*/}" + cd dpdk-git + git log -1 --oneline else wget https://fast.dpdk.org/rel/dpdk-$1.tar.xz tar xvf dpdk-$1.tar.xz > /dev/null DIR_NAME=$(tar -tf dpdk-$1.tar.xz | head -1 | cut -f1 -d"/") - if [ $DIR_NAME != "dpdk-$1" ]; then mv $DIR_NAME dpdk-$1; fi - cd dpdk-$1 + cd $DIR_NAME fi make config CC=gcc T=$TARGET @@ -89,6 +89,7 @@ function install_dpdk() sed -i '/CONFIG_RTE_KNI_KMOD=y/s/=y/=n/' build/.config make -j4 CC=gcc EXTRA_CFLAGS='-fPIC' + EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/build" echo "Installed DPDK source in $(pwd)" cd .. } @@ -111,7 +112,6 @@ if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then # Disregard cast alignment errors until DPDK is fixed CFLAGS="$CFLAGS -Wno-cast-align" fi - EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/dpdk-$DPDK_VER/build" fi OPTS="$EXTRA_OPTS $*" |