Jonathan Hart | 59c036f | 2015-04-01 16:33:33 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Jonathan Hart | 445aa5c | 2015-04-02 16:34:22 -0700 | [diff] [blame] | 2 | # opt-setup.sh |
Jonathan Hart | a509f47 | 2015-04-02 16:19:47 -0700 | [diff] [blame] | 3 | # |
| 4 | # Runs as optical user. |
| 5 | # |
| 6 | # Sets up the packet-optical tutorial. |
Jonathan Hart | 59c036f | 2015-04-01 16:33:33 -0700 | [diff] [blame] | 7 | |
| 8 | export USER=optical |
| 9 | export USER_HOME=/home/${USER} |
| 10 | |
| 11 | echo "Creating optical tutorial" |
| 12 | |
| 13 | DESKTOP=${USER_HOME}/Desktop |
| 14 | |
| 15 | mkdir -p ${DESKTOP} |
| 16 | |
| 17 | cat > ${DESKTOP}/ONOS << EOF |
| 18 | [Desktop Entry] |
| 19 | Encoding=UTF-8 |
| 20 | Type=Application |
| 21 | Name=ONOS |
| 22 | Name[en_US]=ONOS |
| 23 | Icon=konsole |
| 24 | Exec=/usr/bin/lxterminal -t 'ONOS' -e '/home/mininet/apache-karaf-3.0.2/bin/client -u karaf -h 10.0.3.11' |
| 25 | Comment[en_US]= |
| 26 | EOF |
| 27 | |
Jonathan Hart | f16c122 | 2015-04-01 19:38:49 -0700 | [diff] [blame] | 28 | |
Jonathan Hart | 59c036f | 2015-04-01 16:33:33 -0700 | [diff] [blame] | 29 | cat > "${DESKTOP}/Mininet Small" << EOF |
| 30 | [Desktop Entry] |
| 31 | Encoding=UTF-8 |
| 32 | Type=Application |
| 33 | Name=Mininet Small |
| 34 | Name[en_US]=Mininet Small |
| 35 | Icon=konsole |
Jonathan Hart | f16c122 | 2015-04-01 19:38:49 -0700 | [diff] [blame] | 36 | Exec=/usr/bin/lxterminal -t 'Mininet Small Topology' -e '/bin/bash -c "export ONOS_ROOT=~/onos ; sudo -E python /home/mininet/onos/tools/test/topos/opticalTest.py 10.0.3.11"' |
Jonathan Hart | 59c036f | 2015-04-01 16:33:33 -0700 | [diff] [blame] | 37 | Comment[en_US]= |
| 38 | EOF |
| 39 | |
| 40 | cat > "${DESKTOP}/Mininet Large" << EOF |
| 41 | [Desktop Entry] |
| 42 | Encoding=UTF-8 |
| 43 | Type=Application |
| 44 | Name=Mininet Large |
| 45 | Name[en_US]=Mininet Large |
| 46 | Icon=konsole |
Jonathan Hart | f16c122 | 2015-04-01 19:38:49 -0700 | [diff] [blame] | 47 | Exec=/usr/bin/lxterminal -t 'Mininet Large Topology' -e '/bin/bash -c "export ONOS_ROOT=~/onos ; sudo -E python /home/mininet/onos/tools/test/topos/opticalTestBig.py 10.0.3.11"' |
Jonathan Hart | 59c036f | 2015-04-01 16:33:33 -0700 | [diff] [blame] | 48 | Comment[en_US]= |
| 49 | EOF |
| 50 | |
| 51 | cat > "${DESKTOP}/LINC-OE" << EOF |
| 52 | [Desktop Entry] |
| 53 | Encoding=UTF-8 |
| 54 | Type=Application |
| 55 | Name=LINC-OE |
| 56 | Name[en_US]=LINC-OE |
| 57 | Icon=konsole |
| 58 | Exec=/usr/bin/lxterminal -t 'LINC-OE' -e 'sudo linc-oe/rel/linc/bin/linc attach' |
| 59 | Comment[en_US]= |
| 60 | EOF |
| 61 | |
| 62 | cat > ${DESKTOP}/Tutorial << EOF |
| 63 | [Desktop Entry] |
| 64 | Encoding=UTF-8 |
| 65 | Type=Application |
| 66 | Name=Tutorial |
| 67 | Name[en_US]=Tutorial |
| 68 | Icon=internet-web-browser |
| 69 | Exec=/usr/bin/chromium-browser https://wiki.onosproject.org/display/ONOS/Packet+Optical+Tutorial |
| 70 | Comment[en_US]= |
| 71 | EOF |
| 72 | |
| 73 | cat > ${DESKTOP}/GUI << EOF |
| 74 | [Desktop Entry] |
| 75 | Encoding=UTF-8 |
| 76 | Type=Application |
| 77 | Name=ONOS GUI |
| 78 | Name[en_US]=ONOS GUI |
| 79 | Icon=internet-web-browser |
| 80 | Exec=/usr/bin/chromium-browser http://10.0.3.11:8181/onos/ui/index.html#topo |
| 81 | Comment[en_US]= |
| 82 | EOF |
| 83 | |
| 84 | cat > ${DESKTOP}/Wireshark << EOF |
| 85 | [Desktop Entry] |
| 86 | Encoding=UTF-8 |
| 87 | Type=Application |
| 88 | Name=Wireshark |
| 89 | Name[en_US]=Wireshark |
| 90 | Icon=wireshark |
| 91 | Exec=/usr/bin/wireshark |
| 92 | Comment[en_US]= |
| 93 | EOF |
| 94 | |
| 95 | |
Jonathan Hart | f31c4b5 | 2015-04-02 15:07:28 -0700 | [diff] [blame] | 96 | cat > ${DESKTOP}/Reset << EOF |
Jonathan Hart | 59c036f | 2015-04-01 16:33:33 -0700 | [diff] [blame] | 97 | [Desktop Entry] |
| 98 | Encoding=UTF-8 |
| 99 | Type=Application |
| 100 | Name=Reset ONOS |
| 101 | Name[en_US]=Reset ONOS |
| 102 | Icon=konsole |
Jonathan Hart | 5cf990e | 2015-04-02 14:47:36 -0700 | [diff] [blame] | 103 | Exec=/usr/bin/lxterminal -t 'Resetting; please wait' -e '/bin/bash -c "/home/mininet/reset-to-1.sh onos-app-proxyarp,onos-app-optical"' |
Jonathan Hart | 59c036f | 2015-04-01 16:33:33 -0700 | [diff] [blame] | 104 | Comment[en_US]= |
| 105 | EOF |
| 106 | |
| 107 | |
Jonathan Hart | f16c122 | 2015-04-01 19:38:49 -0700 | [diff] [blame] | 108 | ln -s /home/mininet/onos onos |
| 109 | ln -s /home/mininet/.m2 .m2 |
| 110 | |
Jonathan Hart | 59c036f | 2015-04-01 16:33:33 -0700 | [diff] [blame] | 111 | # -------------- Setup LINC & dependencies --------------- |
| 112 | git clone https://github.com/FlowForwarding/LINC-config-generator.git |
| 113 | cd ~/LINC-config-generator |
Jonathan Hart | 5cf990e | 2015-04-02 14:47:36 -0700 | [diff] [blame] | 114 | cp priv/* . |
Jonathan Hart | 59c036f | 2015-04-01 16:33:33 -0700 | [diff] [blame] | 115 | make |
| 116 | cd |
| 117 | |
| 118 | git clone https://github.com/FlowForwarding/LINC-Switch.git linc-oe |
| 119 | cd linc-oe |
| 120 | sed -i s/3000/300000/ rel/files/vm.args |
| 121 | cp rel/files/sys.config.orig rel/files/sys.config |
Jonathan Hart | 5cf990e | 2015-04-02 14:47:36 -0700 | [diff] [blame] | 122 | make |
Jonathan Hart | 59c036f | 2015-04-01 16:33:33 -0700 | [diff] [blame] | 123 | cd |