blob: 17d3b10908c9965391fe96a7bf12835a44a7d27e [file] [log] [blame]
Carmelo Casconed6615072017-12-15 00:53:43 -08001#!/bin/bash
2set -xe
3
Carmelo Cascone68a0a002019-01-08 14:33:18 -08004ONOS_BRANCH=${1:-master}
5
Carmelo Casconed6615072017-12-15 00:53:43 -08006cp /etc/skel/.bashrc ~/
7cp /etc/skel/.profile ~/
8cp /etc/skel/.bash_logout ~/
9
10# ONOS
Carmelo Cascone68a0a002019-01-08 14:33:18 -080011git clone https://github.com/opennetworkinglab/onos.git --depth 1 -b ${ONOS_BRANCH}
Carmelo Casconec5569c22018-04-18 10:09:15 +090012tee -a ~/.bashrc <<EOF
Carmelo Casconeb7e618d2018-01-12 18:31:33 -080013
14# ONOS
15export ONOS_ROOT=~/onos
16source ~/onos/tools/dev/bash_profile
Carmelo Casconef11513d2018-01-16 00:31:14 -080017source ~/onos/tools/dev/p4vm/bm-commands.sh
Carmelo Casconeb7e618d2018-01-12 18:31:33 -080018EOF
Carmelo Casconed6615072017-12-15 00:53:43 -080019
20# Build and install P4 tools
Carmelo Casconeb7e618d2018-01-12 18:31:33 -080021bash /vagrant/install-p4-tools.sh
Carmelo Cascone95e5afd2018-07-17 14:45:23 +020022# We'll delete bmv2 sources later...
23cp ~/p4tools/bmv2/tools/veth_setup.sh ~/veth_setup.sh
24cp ~/p4tools/bmv2/tools/veth_teardown.sh ~/veth_teardown.sh
Carmelo Casconed6615072017-12-15 00:53:43 -080025
26# Mininet
Carmelo Cascone95e5afd2018-07-17 14:45:23 +020027git clone git://github.com/mininet/mininet
Carmelo Cascone57defd32018-05-11 14:34:01 -070028sudo ~/mininet/util/install.sh -nv
Andrea Campanella4f9085e2018-05-29 12:04:16 +020029
Charles Chan84431b92018-08-16 20:30:09 -070030# Trellis - checkout routing repo
Andrea Campanella4f9085e2018-05-29 12:04:16 +020031git clone https://github.com/opennetworkinglab/routing.git
32
Charles Chan84431b92018-08-16 20:30:09 -070033# Trellis - install Quagga
34git clone -b onos-1.11 https://gerrit.opencord.org/quagga
35cd quagga
36./bootstrap.sh
37./configure --enable-fpm --sbindir=/usr/lib/quagga enable_user=root enable_group=root
38make
39sudo make install
40cd ..
41sudo ldconfig
42
43# Trellis - modify apparmor for the DHCP to run properly
44sudo /etc/init.d/apparmor stop
45sudo ln -s /etc/apparmor.d/usr.sbin.dhcpd /etc/apparmor.d/disable/
46sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.dhcpd
47sudo sed -i '30i /var/lib/dhcp{,3}/dhcpclient* lrw,' /etc/apparmor.d/sbin.dhclient
48sudo /etc/init.d/apparmor start
49
Carmelo Cascone95e5afd2018-07-17 14:45:23 +020050# fabric-p4test
51git clone https://github.com/opennetworkinglab/fabric-p4test.git
52
Andrea Campanella4f9085e2018-05-29 12:04:16 +020053# Set Python path for bmv2 in fabric.p4
Carmelo Cascone68a0a002019-01-08 14:33:18 -080054echo 'export PYTHONPATH=$PYTHONPATH:$ONOS_ROOT/tools/dev/mininet' >> ~/.bashrc
Carmelo Cascone95e5afd2018-07-17 14:45:23 +020055
56# FIXME: for some reason protobuf python bindings are not properly installed
57cd ~/p4tools/protobuf/python
58sudo pip install .