Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Dave Wallace | 1948161 | 2017-09-15 18:47:44 -0400 | [diff] [blame] | 3 | if [ -n "$1" ]; then |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 4 | VPP_DIR=$1 |
| 5 | else |
| 6 | VPP_DIR=`dirname $0`/../../ |
| 7 | fi |
| 8 | |
Dave Wallace | 1948161 | 2017-09-15 18:47:44 -0400 | [diff] [blame] | 9 | if [ -n "$2" ]; then |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 10 | SUDOCMD="sudo -H -u $2" |
| 11 | fi |
| 12 | |
| 13 | echo 'Building VCL test apps' |
| 14 | cd $VPP_DIR |
Dave Wallace | 4f6c3a9 | 2017-10-24 15:39:44 -0400 | [diff] [blame] | 15 | $SUDOCMD perl -pi -e 's/noinst_PROGRAMS/bin_PROGRAMS/g' $VPP_DIR/src/vcl.am |
Damjan Marion | 4a6cb83 | 2018-09-18 18:41:38 +0200 | [diff] [blame] | 16 | $SUDOCMD make install-ext-deps build-release |
Dave Wallace | 1948161 | 2017-09-15 18:47:44 -0400 | [diff] [blame] | 17 | sudo sysctl -p$VPP_DIR/src/vpp/conf/80-vpp.conf |
Dave Wallace | 3079a64 | 2017-09-06 01:59:43 -0400 | [diff] [blame] | 18 | sudo modprobe uio_pci_generic |
Dave Wallace | 1948161 | 2017-09-15 18:47:44 -0400 | [diff] [blame] | 19 | |
| 20 | if [ "$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 |
| 24 | fi |
| 25 | |