Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | set -xe |
| 3 | |
Carmelo Cascone | bcb055e | 2019-01-08 14:33:18 -0800 | [diff] [blame] | 4 | ONOS_BRANCH=${1:-master} |
| 5 | |
Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 6 | cp /etc/skel/.bashrc ~/ |
| 7 | cp /etc/skel/.profile ~/ |
| 8 | cp /etc/skel/.bash_logout ~/ |
| 9 | |
| 10 | # ONOS |
Carmelo Cascone | 25243d6 | 2019-02-21 15:37:31 -0800 | [diff] [blame] | 11 | git clone https://github.com/opennetworkinglab/onos.git -b ${ONOS_BRANCH} |
Carmelo Cascone | c5569c2 | 2018-04-18 10:09:15 +0900 | [diff] [blame] | 12 | tee -a ~/.bashrc <<EOF |
Carmelo Cascone | b7e618d | 2018-01-12 18:31:33 -0800 | [diff] [blame] | 13 | |
| 14 | # ONOS |
| 15 | export ONOS_ROOT=~/onos |
| 16 | source ~/onos/tools/dev/bash_profile |
Carmelo Cascone | f11513d | 2018-01-16 00:31:14 -0800 | [diff] [blame] | 17 | source ~/onos/tools/dev/p4vm/bm-commands.sh |
Carmelo Cascone | 7c82bcf | 2019-02-08 22:57:18 -0800 | [diff] [blame] | 18 | export BMV2_INSTALL=/usr/local |
Carmelo Cascone | b7e618d | 2018-01-12 18:31:33 -0800 | [diff] [blame] | 19 | EOF |
Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 20 | |
| 21 | # Build and install P4 tools |
Carmelo Cascone | a4dc3c1 | 2019-02-12 17:30:00 -0800 | [diff] [blame] | 22 | DEBUG_FLAGS=true FAST_BUILD=true bash /vagrant/install-p4-tools.sh |
Carmelo Cascone | 95e5afd | 2018-07-17 14:45:23 +0200 | [diff] [blame] | 23 | # We'll delete bmv2 sources later... |
| 24 | cp ~/p4tools/bmv2/tools/veth_setup.sh ~/veth_setup.sh |
| 25 | cp ~/p4tools/bmv2/tools/veth_teardown.sh ~/veth_teardown.sh |
Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 26 | |
| 27 | # Mininet |
Carmelo Cascone | 95e5afd | 2018-07-17 14:45:23 +0200 | [diff] [blame] | 28 | git clone git://github.com/mininet/mininet |
Carmelo Cascone | 57defd3 | 2018-05-11 14:34:01 -0700 | [diff] [blame] | 29 | sudo ~/mininet/util/install.sh -nv |
Andrea Campanella | 4f9085e | 2018-05-29 12:04:16 +0200 | [diff] [blame] | 30 | |
Charles Chan | 84431b9 | 2018-08-16 20:30:09 -0700 | [diff] [blame] | 31 | # Trellis - checkout routing repo |
Andrea Campanella | 4f9085e | 2018-05-29 12:04:16 +0200 | [diff] [blame] | 32 | git clone https://github.com/opennetworkinglab/routing.git |
| 33 | |
Charles Chan | 84431b9 | 2018-08-16 20:30:09 -0700 | [diff] [blame] | 34 | # Trellis - install Quagga |
| 35 | git clone -b onos-1.11 https://gerrit.opencord.org/quagga |
| 36 | cd quagga |
| 37 | ./bootstrap.sh |
| 38 | ./configure --enable-fpm --sbindir=/usr/lib/quagga enable_user=root enable_group=root |
| 39 | make |
| 40 | sudo make install |
| 41 | cd .. |
| 42 | sudo ldconfig |
| 43 | |
| 44 | # Trellis - modify apparmor for the DHCP to run properly |
| 45 | sudo /etc/init.d/apparmor stop |
| 46 | sudo ln -s /etc/apparmor.d/usr.sbin.dhcpd /etc/apparmor.d/disable/ |
| 47 | sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.dhcpd |
| 48 | sudo sed -i '30i /var/lib/dhcp{,3}/dhcpclient* lrw,' /etc/apparmor.d/sbin.dhclient |
| 49 | sudo /etc/init.d/apparmor start |
| 50 | |
Carmelo Cascone | 95e5afd | 2018-07-17 14:45:23 +0200 | [diff] [blame] | 51 | # fabric-p4test |
| 52 | git clone https://github.com/opennetworkinglab/fabric-p4test.git |
| 53 | |
Andrea Campanella | 4f9085e | 2018-05-29 12:04:16 +0200 | [diff] [blame] | 54 | # Set Python path for bmv2 in fabric.p4 |
Carmelo Cascone | bcb055e | 2019-01-08 14:33:18 -0800 | [diff] [blame] | 55 | echo 'export PYTHONPATH=$PYTHONPATH:$ONOS_ROOT/tools/dev/mininet' >> ~/.bashrc |