forked from redhat-performance/docker-dpdk
-
Notifications
You must be signed in to change notification settings - Fork 9
/
build_dpdk.sh
executable file
·49 lines (42 loc) · 1.3 KB
/
build_dpdk.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
################################################################################
#
# build_dpdk.sh
#
# - Build DPDK and pktgen-dpdk for
#
# Usage: Adjust variables below before running, if necessary.
#
# MAINTAINER: [email protected]
#
#
################################################################################
################################################################################
# Define Global Variables and Functions
################################################################################
URL=http://www.dpdk.org/browse/dpdk/snapshot/dpdk-2.0.0.tar.gz
BASEDIR=/root
VERSION=2.0.0
PACKAGE=dpdk
DPDKROOT=$BASEDIR/$PACKAGE-$VERSION
CONFIG=x86_64-native-linuxapp-gcc
# Download/Build DPDK
cd $BASEDIR
curl $URL | tar xz
cd $DPDKROOT
make config T=$CONFIG
sed -ri 's,(PMD_PCAP=).*,\1y,' build/.config
make config T=$CONFIG install
# Download/Build pktgen-dpdk
URL=http://www.dpdk.org/browse/apps/pktgen-dpdk/snapshot/pktgen-dpdk-pktgen-2.8.5-2.tar.xz
BASEDIR=/root
VERSION=2.8.5-2
PACKAGE=pktgen
PKTGENROOT=$BASEDIR/$PACKAGE-$VERSION
cd $BASEDIR
curl $URL | tar xz
# Silence compiler info message
sed -i '/Wwrite-strings$/ s/$/ -Wno-unused-but-set-variable/' $DPDKROOT/mk/toolchain/gcc/rte.vars.mk
cd $PKTGENROOT
make
ln -s $PKTGENROOT/app/app/$CONFIG/pktgen /usr/bin