blob: 77b853449120750cc2ebf0cf9caa38d67c47f652 [file] [log] [blame]
Marc De Leenheer5dbd04f2015-01-09 12:51:49 -08001#!/bin/bash
2# vm-setup.sh
3#
4# This script installs ONOS dependencies for packet/optical use case.
5
6
Marc De Leenheer06aae542015-01-09 14:47:41 -08007export CURRENT_USER=optical
Marc De Leenheer5dbd04f2015-01-09 12:51:49 -08008export USER_HOME=/home/${CURRENT_USER}
9
10# -------------- Setup keys -------------------
11
12mkdir -p ~/.ssh
13ssh-keygen -t dsa -P "" -f .ssh/id_dsa
14cp .ssh/id_dsa.pub .ssh/authorized_keys
15
16# -------------- Setup Desktop ---------------
17
18DESKTOP=${USER_HOME}/Desktop
19
20mkdir -p ${DESKTOP}
21
22cat > ${DESKTOP}/ONOS << EOF
23[Desktop Entry]
24Encoding=UTF-8
25Type=Application
26Name=ONOS
27Name[en_US]=ONOS
28Icon=konsole
29Exec=/usr/bin/lxterminal -e '/opt/onos/apache-karaf-3.0.2/bin/client -u karaf'
30Comment[en_US]=
31EOF
32
Marc De Leenheer5dbd04f2015-01-09 12:51:49 -080033cat > "${DESKTOP}/Packet-Optical Mininet Small" << EOF
34[Desktop Entry]
35Encoding=UTF-8
36Type=Application
37Name=Packet/Optical Mininet Small
38Name[en_US]=Packet/Optical Mininet Small
39Icon=konsole
Marc De Leenheere90f2882015-01-12 15:32:30 -080040Exec=/usr/bin/lxterminal -e 'sudo -E ~/opticalTest.py'
Marc De Leenheer5dbd04f2015-01-09 12:51:49 -080041Comment[en_US]=
42EOF
43
44cat > "${DESKTOP}/Packet-Optical Mininet Large" << EOF
45[Desktop Entry]
46Encoding=UTF-8
47Type=Application
48Name=Packet/Optical Mininet Large
49Name[en_US]=Packet/Optical Mininet Large
50Icon=konsole
Marc De Leenheere90f2882015-01-12 15:32:30 -080051Exec=/usr/bin/lxterminal -e 'sudo -E ~/opticalTestBig.py'
Marc De Leenheer5dbd04f2015-01-09 12:51:49 -080052Comment[en_US]=
53EOF
54
55cat > ${DESKTOP}/Tutorial << EOF
56[Desktop Entry]
57Encoding=UTF-8
58Type=Application
Marc De Leenheere90f2882015-01-12 15:32:30 -080059Name=Packet-Optical Tutorial
60Name[en_US]=Packet-Optical Tutorial
Marc De Leenheer5dbd04f2015-01-09 12:51:49 -080061Icon=internet-web-browser
62Exec=/usr/bin/chromium-browser https://wiki.onosproject.org/display/ONOS/Packet+Optical+Tutorial
63Comment[en_US]=
64EOF
65
66cat > ${DESKTOP}/GUI << EOF
67[Desktop Entry]
68Encoding=UTF-8
69Type=Application
70Name=ONOS GUI
71Name[en_US]=ONOS GUI
72Icon=internet-web-browser
73Exec=/usr/bin/chromium-browser http://localhost:8181/onos/ui/index.html#topo
74Comment[en_US]=
75EOF
76
77cat > ${DESKTOP}/Wireshark << EOF
78[Desktop Entry]
79Encoding=UTF-8
80Type=Application
81Name=Wireshark
82Name[en_US]=Wireshark
83Icon=wireshark
84Exec=/usr/bin/wireshark
85Comment[en_US]=
86EOF
87
88cat > ${DESKTOP}/Reset << EOF
89[Desktop Entry]
90Encoding=UTF-8
91Type=Application
92Name=Reset
93Name[en_US]=Reset
94Icon=konsole
95Exec=/usr/bin/lxterminal -t 'Resetting; please wait' -e 'sudo service onos restart'
96Comment[en_US]=
97EOF
98
Marc De Leenheera95a4622015-01-09 17:57:16 -080099# -------------- Setup LINC & dependencies ---------------
100git clone https://github.com/FlowForwarding/LINC-config-generator.git
101cd ~/LINC-config-generator
102git checkout oe-0.4
103make
104cd
105
106git clone https://github.com/FlowForwarding/LINC-Switch.git linc-oe
107cd linc-oe
Marc De Leenheer19ec1312015-01-12 11:46:05 -0800108sed -i s/3000/300000/ rel/files/vm.args
Marc De Leenheera95a4622015-01-09 17:57:16 -0800109cp rel/files/sys.config.orig rel/files/sys.config
110make rel
111cd