alshabib | bca6bf2 | 2014-11-15 16:38:45 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # vm-setup.sh |
| 3 | # |
| 4 | # This script installs ONOS dependencies and installs a desktop environment on a Miniet VM. |
| 5 | |
| 6 | |
| 7 | USER=tutorial1 |
| 8 | USER_HOME=/home/${USER} |
| 9 | |
alshabib | bca6bf2 | 2014-11-15 16:38:45 -0800 | [diff] [blame] | 10 | export ONOS_USER=$USER |
| 11 | |
| 12 | export ONOS_ROOT=~/onos-next |
| 13 | source $ONOS_ROOT/tools/dev/bash_profile |
alshabib | 343d160 | 2014-11-18 14:49:52 -0800 | [diff] [blame] | 14 | sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java |
| 15 | sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac |
alshabib | fbbb90a | 2014-11-18 14:52:54 -0800 | [diff] [blame] | 16 | java -version |
| 17 | javac -version |
alshabib | 36510ef | 2014-11-18 15:11:15 -0800 | [diff] [blame] | 18 | echo $JAVA_HOME |
alshabib | a984a3a | 2014-11-18 15:14:42 -0800 | [diff] [blame] | 19 | export JAVA_HOME="" |
alshabib | 36510ef | 2014-11-18 15:11:15 -0800 | [diff] [blame] | 20 | cd $ONOS_ROOT && mvn clean install && cd - |
alshabib | bca6bf2 | 2014-11-15 16:38:45 -0800 | [diff] [blame] | 21 | |
| 22 | sed -i -e s/sdn/$USER/ onos-next/tools/package/debian/onos.conf |
| 23 | |
| 24 | cat << EOF >> onos-next/tools/test/cells/tutorial |
| 25 | export ONOS_NIC=127.0.0.* |
| 26 | export OC1="127.0.0.1" |
| 27 | export OCI="${OC1}" |
alshabib | 384af73 | 2014-11-20 14:31:20 -0800 | [diff] [blame] | 28 | export ONOS_FEATURES="webconsole,onos-rest,onos-api,onos-core-trivial,onos-cli,onos-openflow" |
alshabib | bca6bf2 | 2014-11-15 16:38:45 -0800 | [diff] [blame] | 29 | EOF |
| 30 | |
alshabib | 343d160 | 2014-11-18 14:49:52 -0800 | [diff] [blame] | 31 | cell tutorial |
| 32 | |
alshabib | bca6bf2 | 2014-11-15 16:38:45 -0800 | [diff] [blame] | 33 | onos-package |
alshabib | ff061ee | 2014-11-17 15:57:10 -0800 | [diff] [blame] | 34 | onos-install -f $OC1 |
alshabib | bca6bf2 | 2014-11-15 16:38:45 -0800 | [diff] [blame] | 35 | |
alshabib | a66571a | 2014-12-01 19:29:41 -0800 | [diff] [blame] | 36 | sudo echo 'export ONOS_OPTS="clean debug"' > /opt/onos/options |
alshabib | 6389949 | 2014-12-01 14:53:10 -0800 | [diff] [blame] | 37 | |
alshabib | 96d222e | 2014-12-01 17:35:48 -0800 | [diff] [blame] | 38 | sudo su -c 'echo GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash\" >> /etc/default/grub' |
alshabib | efbdd93 | 2014-12-01 17:05:00 -0800 | [diff] [blame] | 39 | sudo su -c update-grub |
Jonathan Hart | 8886ac2 | 2014-12-01 22:47:18 -0800 | [diff] [blame] | 40 | |
| 41 | #--------------- Copy SDNIP code to home ----- |
| 42 | |
Jonathan Hart | 9acae33 | 2014-12-01 23:31:21 -0800 | [diff] [blame^] | 43 | sudo -u sdnip cp -r /home/tutorial1/onos-next/tools/test/topos/sdnip /home/sdnip/ |
| 44 | sudo -u sdnip cp -r /home/sdnip/sdnip/configs /home/sdnip/ |
Jonathan Hart | 8886ac2 | 2014-12-01 22:47:18 -0800 | [diff] [blame] | 45 | |
| 46 | # -------------- Copy SDN-IP config ---------- |
| 47 | |
| 48 | sudo -u tutorial1 cp /home/sdnip/configs/addresses.json /opt/onos/config/ |
| 49 | sudo -u tutorial1 cp /home/sdnip/configs/sdnip.json /opt/onos/config/ |