blob: 3c3a075fe68f7f252541d6f9a5c25a61a79868ec [file] [log] [blame]
Brian O'Connor5abe3db2014-08-05 02:08:34 -07001#!/bin/bash
Brian O'Connor37f0cc72014-06-06 20:03:05 -07002# vm-setup.sh
3#
4# This script installs ONOS dependencies and installs a desktop environment on a Miniet VM.
5
alshabibbca6bf22014-11-15 16:38:45 -08006
alshabib22a2c3a2014-11-17 14:37:18 -08007export CURRENT_USER=tutorial1
8export USER_HOME=/home/${CURRENT_USER}
Brian O'Connor37f0cc72014-06-06 20:03:05 -07009
alshabib3881a142014-11-17 15:04:35 -080010URL='https://gerrit.onosproject.org/gitweb?p=ONOS-VM.git;a=blob_plain;hb=refs/heads/onos-tutorial;f=tutorial1-setup.sh'
11
alshabib22a2c3a2014-11-17 14:37:18 -080012sudo /usr/sbin/useradd -c "Basic ONOS Tutorial" -d /home/${CURRENT_USER} -U -m -p $(openssl passwd -1 ${CURRENT_USER}) -s /bin/bash ${CURRENT_USER}
alshabibbca6bf22014-11-15 16:38:45 -080013
alshabib3881a142014-11-17 15:04:35 -080014echo "${CURRENT_USER} ALL=NOPASSWD: ALL" >> tutorial1
15sudo cp tutorial1 /etc/sudoers.d
16sudo chown root:root /etc/sudoers.d/tutorial1
alshabibbca6bf22014-11-15 16:38:45 -080017
Brian O'Connor37f0cc72014-06-06 20:03:05 -070018sudo apt-get update
19
alshabib8b561d42014-11-18 10:54:06 -080020sudo apt-get install -y git openjdk-8-jdk maven unzip
21sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
alshabib1207a832014-11-18 13:27:11 -080022sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Brian O'Connor10d941e2014-06-12 19:55:09 -070023
alshabibbca6bf22014-11-15 16:38:45 -080024#--------------- Setup Mininet ----------------
Brian O'Connor10d941e2014-06-12 19:55:09 -070025
alshabib91de3b52014-11-17 10:52:55 -080026#git clone git://github.com/mininet/mininet
Brian O'Connor10d941e2014-06-12 19:55:09 -070027
alshabib91de3b52014-11-17 10:52:55 -080028#mininet/util/install.sh -a
Brian O'Connor3ca84022014-08-11 19:46:54 -070029
alshabibbca6bf22014-11-15 16:38:45 -080030# -------------- Switch User ------------------
Brian O'Connor3ca84022014-08-11 19:46:54 -070031
alshabib3881a142014-11-17 15:04:35 -080032wget -O tutorial1-setup.sh $URL
Brian O'Connor37f0cc72014-06-06 20:03:05 -070033
alshabib3881a142014-11-17 15:04:35 -080034sudo -u ${CURRENT_USER} -H sh -c 'cp tutorial1-setup.sh ~/ && cd ~/ && sh tutorial1-setup.sh'
Brian O'Connor24512552014-08-11 23:22:14 -070035