blob: 2bad0f6e14f8cb69141749e479c9a0784899e68f [file] [log] [blame]
Tom Jonesc3b416c2024-01-18 14:51:44 +00001#!/usr/bin/env bash
Dave Wallace3079a642017-09-06 01:59:43 -04002
Dave Wallace19481612017-09-15 18:47:44 -04003if [ -n "$1" ]; then
Dave Wallace3079a642017-09-06 01:59:43 -04004 VPP_DIR=$1
5else
6 VPP_DIR=`dirname $0`/../../
7fi
8
Dave Wallace19481612017-09-15 18:47:44 -04009if [ -n "$2" ]; then
Dave Wallace3079a642017-09-06 01:59:43 -040010 SUDOCMD="sudo -H -u $2"
11fi
12
13echo 'Building VCL test apps'
14cd $VPP_DIR
Dave Wallace4f6c3a92017-10-24 15:39:44 -040015$SUDOCMD perl -pi -e 's/noinst_PROGRAMS/bin_PROGRAMS/g' $VPP_DIR/src/vcl.am
Damjan Marion4a6cb832018-09-18 18:41:38 +020016$SUDOCMD make install-ext-deps build-release
Dave Wallace19481612017-09-15 18:47:44 -040017sudo sysctl -p$VPP_DIR/src/vpp/conf/80-vpp.conf
Dave Wallace3079a642017-09-06 01:59:43 -040018sudo modprobe uio_pci_generic
Dave Wallace19481612017-09-15 18:47:44 -040019
20if [ "$2" = "vagrant" ] && [ -d "/home/vagrant" ] ; then
21 dot_bash_aliases="/home/$2/.bash_aliases"
22 echo "export WS_ROOT=$VPP_DIR" | $SUDOCMD tee $dot_bash_aliases
23 source $dot_bash_aliases
24fi
25