Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | set -xe |
| 3 | |
Carmelo Cascone | e59bc37 | 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 | e59bc37 | 2019-01-08 14:33:18 -0800 | [diff] [blame] | 11 | git clone https://github.com/opennetworkinglab/onos.git --depth 1 -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 | b7e618d | 2018-01-12 18:31:33 -0800 | [diff] [blame] | 18 | EOF |
Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 19 | |
| 20 | # Build and install P4 tools |
Carmelo Cascone | b7e618d | 2018-01-12 18:31:33 -0800 | [diff] [blame] | 21 | bash /vagrant/install-p4-tools.sh |
Carmelo Cascone | 95e5afd | 2018-07-17 14:45:23 +0200 | [diff] [blame] | 22 | # We'll delete bmv2 sources later... |
| 23 | cp ~/p4tools/bmv2/tools/veth_setup.sh ~/veth_setup.sh |
| 24 | cp ~/p4tools/bmv2/tools/veth_teardown.sh ~/veth_teardown.sh |
Carmelo Cascone | d661507 | 2017-12-15 00:53:43 -0800 | [diff] [blame] | 25 | |
| 26 | # Mininet |
Carmelo Cascone | 95e5afd | 2018-07-17 14:45:23 +0200 | [diff] [blame] | 27 | git clone git://github.com/mininet/mininet |
Carmelo Cascone | 57defd3 | 2018-05-11 14:34:01 -0700 | [diff] [blame] | 28 | sudo ~/mininet/util/install.sh -nv |
Andrea Campanella | 4f9085e | 2018-05-29 12:04:16 +0200 | [diff] [blame] | 29 | |
Charles Chan | 84431b9 | 2018-08-16 20:30:09 -0700 | [diff] [blame] | 30 | # Trellis - checkout routing repo |
Andrea Campanella | 4f9085e | 2018-05-29 12:04:16 +0200 | [diff] [blame] | 31 | git clone https://github.com/opennetworkinglab/routing.git |
| 32 | |
Charles Chan | 84431b9 | 2018-08-16 20:30:09 -0700 | [diff] [blame] | 33 | # Trellis - install Quagga |
| 34 | git clone -b onos-1.11 https://gerrit.opencord.org/quagga |
| 35 | cd quagga |
| 36 | ./bootstrap.sh |
| 37 | ./configure --enable-fpm --sbindir=/usr/lib/quagga enable_user=root enable_group=root |
| 38 | make |
| 39 | sudo make install |
| 40 | cd .. |
| 41 | sudo ldconfig |
| 42 | |
| 43 | # Trellis - modify apparmor for the DHCP to run properly |
| 44 | sudo /etc/init.d/apparmor stop |
| 45 | sudo ln -s /etc/apparmor.d/usr.sbin.dhcpd /etc/apparmor.d/disable/ |
| 46 | sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.dhcpd |
| 47 | sudo sed -i '30i /var/lib/dhcp{,3}/dhcpclient* lrw,' /etc/apparmor.d/sbin.dhclient |
| 48 | sudo /etc/init.d/apparmor start |
| 49 | |
Carmelo Cascone | 95e5afd | 2018-07-17 14:45:23 +0200 | [diff] [blame] | 50 | # fabric-p4test |
| 51 | git clone https://github.com/opennetworkinglab/fabric-p4test.git |
| 52 | |
Andrea Campanella | 4f9085e | 2018-05-29 12:04:16 +0200 | [diff] [blame] | 53 | # Set Python path for bmv2 in fabric.p4 |
Carmelo Cascone | e59bc37 | 2019-01-08 14:33:18 -0800 | [diff] [blame] | 54 | echo 'export PYTHONPATH=$PYTHONPATH:$ONOS_ROOT/tools/dev/mininet' >> ~/.bashrc |
Carmelo Cascone | 95e5afd | 2018-07-17 14:45:23 +0200 | [diff] [blame] | 55 | |
| 56 | # FIXME: for some reason protobuf python bindings are not properly installed |
| 57 | cd ~/p4tools/protobuf/python |
| 58 | sudo pip install . |