Skip to content

Commit

Permalink
travis: Make it possible to build against a dpdk branch.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
david-marchand authored and igsilya committed Jun 19, 2019
1 parent 7639e06 commit 3925b3e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .travis/linux-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ..
}
Expand All @@ -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 $*"
Expand Down

0 comments on commit 3925b3e

Please sign in to comment.