| #!/bin/bash |
| # onos-setup-lxc.sh |
| # |
| # This script sets up the VM ready to run ONOS and tutorials, including installing an LXC cluster |
| # for ONOS to run in. |
| |
| # -------------- Install ONOS ---------------- |
| |
| USER=mininet |
| USER_HOME=/home/${USER} |
| |
| echo `whoami` |
| |
| cd ~ |
| git clone https://gerrit.onosproject.org/onos |
| cd onos && git checkout 1.1.0 && cd - |
| |
| #echo "export ONOS_ROOT=${USER_HOME}/onos" >> ~/.bashrc |
| #echo ". ~/onos/tools/dev/bash_profile" >> ~/.bashrc |
| |
| export ONOS_ROOT=${USER_HOME}/onos |
| . ~/onos/tools/dev/bash_profile |
| |
| echo $ONOS_ROOT |
| |
| echo $JAVA_HOME |
| export JAVA_HOME="" |
| cd $ONOS_ROOT && mvn clean install && mvn dependency:go-offline && cd - |
| |
| cat << EOF >> onos/tools/test/cells/tutorial |
| export ONOS_NIC=10.0.3.* |
| export OC1="10.0.3.11" |
| export OC2="10.0.3.12" |
| export OC3="10.0.3.13" |
| export OCI="${OC1}" |
| export ONOS_FEATURES="webconsole,onos-rest,onos-gui,onos-api,onos-core,onos-cli,onos-openflow" |
| export ONOS_USER="sdn" |
| EOF |
| |
| cell tutorial |
| |
| onos-package |
| onos-group install -f |
| onos-wait-for-start $OC1 |
| onos-wait-for-start $OC2 |
| onos-wait-for-start $OC3 |
| |
| sleep 20 |
| onos 1 "nodes" |
| |
| # ------------- Zero Unused Blocks ------------- |
| #TODO investigate zerofree |
| #echo "Zeroing unused blocks" |
| #sync |
| #dd if=/dev/zero of=tmp-zeros |
| #sync |
| #rm tmp-zeros |
| #sync |