NFVBENCH-196: New NFVbench image for generator part (nfvbench and TRex codes inside VM)
[nfvbench.git] / nfvbenchvm / dib / elements / nfvbenchvm / post-install.d / 02-testpmd-script
1 #!/bin/bash
2
3 if [ $DIB_DEV_IMAGE != "loopvm" ]; then
4     exit 0
5 fi
6
7 DPDK=dpdk-18.02
8 DPDK_UNTAR=dpdk-18.02
9
10 # pick up the kernel version for the target image
11 kernel_version=`ls -t /lib/modules | awk 'NR==1 {print}'`
12
13 mkdir dpdk
14 wget http://fast.dpdk.org/rel/$DPDK.tar.xz
15 tar xfJ $DPDK.tar.xz
16 cd $DPDK_UNTAR
17
18 export RTE_KERNELDIR=/lib/modules/$kernel_version/build
19 export ARCH=x86
20 make -j4 install T=x86_64-native-linuxapp-gcc
21
22 cp x86_64-native-linuxapp-gcc/app/testpmd ../dpdk
23 cp x86_64-native-linuxapp-gcc/kmod/igb_uio.ko ../dpdk
24 echo "set promisc all off" > /dpdk/testpmd_cmd.txt
25
26 cd ..
27 rm -f $DPDK.tar.xz
28 rm -rf $DPDK_UNTAR