blob: dadc83f234c8817d3d06cfc61dec8f6fa1f2290c [file] [log] [blame]
#!/bin/bash
# vm-setup.sh
#
# This script installs ONOS dependencies and installs a desktop environment on a Miniet VM.
USER=tutorial1
USER_HOME=/home/${USER}
export ONOS_USER=$USER
export ONOS_ROOT=~/onos-next
source $ONOS_ROOT/tools/dev/bash_profile
sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
java -version
javac -version
echo $JAVA_HOME
export JAVA_HOME=""
cd $ONOS_ROOT && mvn clean install && cd -
sed -i -e s/sdn/$USER/ onos-next/tools/package/debian/onos.conf
cat << EOF >> onos-next/tools/test/cells/tutorial
export ONOS_NIC=127.0.0.*
export OC1="127.0.0.1"
export OCI="${OC1}"
export ONOS_FEATURES="webconsole,onos-rest,onos-api,onos-core-trivial,onos-cli,onos-openflow"
EOF
cell tutorial
onos-package
onos-install -f $OC1
sudo echo 'export ONOS_OPTS="clean debug"' > /opt/onos/options
sudo su -c 'echo GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash\" >> /etc/default/grub'
sudo su -c update-grub
#--------------- Copy SDNIP code to home -----
sudo -u sdnip cp -r /home/tutorial1/onos-next/tools/test/topos/sdnip /home/sdnip/
sudo -u sdnip cp -r /home/sdnip/sdnip/configs /home/sdnip/
# -------------- Copy SDN-IP config ----------
sudo -u tutorial1 cp /home/sdnip/configs/addresses.json /opt/onos/config/
sudo -u tutorial1 cp /home/sdnip/configs/sdnip.json /opt/onos/config/