blob: dadc83f234c8817d3d06cfc61dec8f6fa1f2290c [file] [log] [blame]
alshabibbca6bf22014-11-15 16:38:45 -08001#!/bin/bash
2# vm-setup.sh
3#
4# This script installs ONOS dependencies and installs a desktop environment on a Miniet VM.
5
6
7USER=tutorial1
8USER_HOME=/home/${USER}
9
alshabibbca6bf22014-11-15 16:38:45 -080010export ONOS_USER=$USER
11
12export ONOS_ROOT=~/onos-next
13source $ONOS_ROOT/tools/dev/bash_profile
alshabib343d1602014-11-18 14:49:52 -080014sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
15sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
alshabibfbbb90a2014-11-18 14:52:54 -080016java -version
17javac -version
alshabib36510ef2014-11-18 15:11:15 -080018echo $JAVA_HOME
alshabiba984a3a2014-11-18 15:14:42 -080019export JAVA_HOME=""
alshabib36510ef2014-11-18 15:11:15 -080020cd $ONOS_ROOT && mvn clean install && cd -
alshabibbca6bf22014-11-15 16:38:45 -080021
22sed -i -e s/sdn/$USER/ onos-next/tools/package/debian/onos.conf
23
24cat << EOF >> onos-next/tools/test/cells/tutorial
25export ONOS_NIC=127.0.0.*
26export OC1="127.0.0.1"
27export OCI="${OC1}"
alshabib384af732014-11-20 14:31:20 -080028export ONOS_FEATURES="webconsole,onos-rest,onos-api,onos-core-trivial,onos-cli,onos-openflow"
alshabibbca6bf22014-11-15 16:38:45 -080029EOF
30
alshabib343d1602014-11-18 14:49:52 -080031cell tutorial
32
alshabibbca6bf22014-11-15 16:38:45 -080033onos-package
alshabibff061ee2014-11-17 15:57:10 -080034onos-install -f $OC1
alshabibbca6bf22014-11-15 16:38:45 -080035
alshabiba66571a2014-12-01 19:29:41 -080036sudo echo 'export ONOS_OPTS="clean debug"' > /opt/onos/options
alshabib63899492014-12-01 14:53:10 -080037
alshabib96d222e2014-12-01 17:35:48 -080038sudo su -c 'echo GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash\" >> /etc/default/grub'
alshabibefbdd932014-12-01 17:05:00 -080039sudo su -c update-grub
Jonathan Hart8886ac22014-12-01 22:47:18 -080040
41#--------------- Copy SDNIP code to home -----
42
Jonathan Hart9acae332014-12-01 23:31:21 -080043sudo -u sdnip cp -r /home/tutorial1/onos-next/tools/test/topos/sdnip /home/sdnip/
44sudo -u sdnip cp -r /home/sdnip/sdnip/configs /home/sdnip/
Jonathan Hart8886ac22014-12-01 22:47:18 -080045
46# -------------- Copy SDN-IP config ----------
47
48sudo -u tutorial1 cp /home/sdnip/configs/addresses.json /opt/onos/config/
49sudo -u tutorial1 cp /home/sdnip/configs/sdnip.json /opt/onos/config/