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 | cf82ac7 | 2014-12-01 09:42:32 -0800 | [diff] [blame] | 36 | sudo echo 'export ONOS_OPT="clean debug"' > /opt/onos/options |
alshabib | 6389949 | 2014-12-01 14:53:10 -0800 | [diff] [blame] | 37 | |
alshabib | efbdd93 | 2014-12-01 17:05:00 -0800 | [diff] [blame^] | 38 | sudo su -c 'echo GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" >> /etc/default/grub' |
| 39 | sudo su -c update-grub |