blob: 64209987e4a433502babc2f8359aeb8ca3899dfe [file] [log] [blame]
Carmelo Casconed6615072017-12-15 00:53:43 -08001#!/bin/bash
2set -xe
3
Carmelo Casconebcb055e2019-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 Casconebcb055e2019-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 Cascone7c82bcf2019-02-08 22:57:18 -080018export BMV2_INSTALL=/usr/local
Carmelo Casconeb7e618d2018-01-12 18:31:33 -080019EOF
Carmelo Casconed6615072017-12-15 00:53:43 -080020
21# Build and install P4 tools
Carmelo Casconeb7e618d2018-01-12 18:31:33 -080022bash /vagrant/install-p4-tools.sh
Carmelo Cascone95e5afd2018-07-17 14:45:23 +020023# We'll delete bmv2 sources later...
24cp ~/p4tools/bmv2/tools/veth_setup.sh ~/veth_setup.sh
25cp ~/p4tools/bmv2/tools/veth_teardown.sh ~/veth_teardown.sh
Carmelo Casconed6615072017-12-15 00:53:43 -080026
27# Mininet
Carmelo Cascone95e5afd2018-07-17 14:45:23 +020028git clone git://github.com/mininet/mininet
Carmelo Cascone57defd32018-05-11 14:34:01 -070029sudo ~/mininet/util/install.sh -nv
Andrea Campanella4f9085e2018-05-29 12:04:16 +020030
Charles Chan84431b92018-08-16 20:30:09 -070031# Trellis - checkout routing repo
Andrea Campanella4f9085e2018-05-29 12:04:16 +020032git clone https://github.com/opennetworkinglab/routing.git
33
Charles Chan84431b92018-08-16 20:30:09 -070034# Trellis - install Quagga
35git clone -b onos-1.11 https://gerrit.opencord.org/quagga
36cd quagga
37./bootstrap.sh
38./configure --enable-fpm --sbindir=/usr/lib/quagga enable_user=root enable_group=root
39make
40sudo make install
41cd ..
42sudo ldconfig
43
44# Trellis - modify apparmor for the DHCP to run properly
45sudo /etc/init.d/apparmor stop
46sudo ln -s /etc/apparmor.d/usr.sbin.dhcpd /etc/apparmor.d/disable/
47sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.dhcpd
48sudo sed -i '30i /var/lib/dhcp{,3}/dhcpclient* lrw,' /etc/apparmor.d/sbin.dhclient
49sudo /etc/init.d/apparmor start
50
Carmelo Cascone95e5afd2018-07-17 14:45:23 +020051# fabric-p4test
52git clone https://github.com/opennetworkinglab/fabric-p4test.git
53
Andrea Campanella4f9085e2018-05-29 12:04:16 +020054# Set Python path for bmv2 in fabric.p4
Carmelo Casconebcb055e2019-01-08 14:33:18 -080055echo 'export PYTHONPATH=$PYTHONPATH:$ONOS_ROOT/tools/dev/mininet' >> ~/.bashrc
Carmelo Cascone95e5afd2018-07-17 14:45:23 +020056
57# FIXME: for some reason protobuf python bindings are not properly installed
58cd ~/p4tools/protobuf/python
59sudo pip install .