Brian O'Connor | 37f0cc7 | 2014-06-06 20:03:05 -0700 | [diff] [blame] | 1 | #/bin/bash |
| 2 | # vm-setup.sh |
| 3 | # |
| 4 | # This script installs ONOS dependencies and installs a desktop environment on a Miniet VM. |
| 5 | |
| 6 | ONOS_USER=mininet |
| 7 | ONOS_USER_HOME=/home/${ONOS_USER} |
| 8 | |
| 9 | ECLIPSE_URL=http://ftp.osuosl.org/pub/eclipse//technology/epp/downloads/release/kepler/SR1/eclipse-java-kepler-SR1-linux-gtk-x86_64.tar.gz |
| 10 | |
| 11 | sudo apt-get update |
| 12 | |
| 13 | # ------------- Install ONOS Dependencies ------------- |
| 14 | #sudo -u ${ONOS_USER} ./install_zookeeper.sh |
| 15 | #sudo -u ${ONOS_USER} ./install_cassandra.sh |
| 16 | #sudo -u ${ONOS_USER} ./install_maven.sh |
| 17 | sudo apt-get install -y maven |
Brian O'Connor | ab49e18 | 2014-06-09 11:41:51 -0700 | [diff] [blame^] | 18 | # CLI dependencies |
| 19 | sudo apt-get install -y python-flask python-cmd2 python-pyparsing |
Brian O'Connor | 37f0cc7 | 2014-06-06 20:03:05 -0700 | [diff] [blame] | 20 | |
| 21 | # -------------- Setup Desktop ---------------- |
| 22 | sudo apt-get install -y xorg lxde |
| 23 | |
| 24 | #TODO: add backgrounds folder |
| 25 | #TODO: change background |
| 26 | # Remove wallpaper, change background color, and disable screensaver |
| 27 | sudo sed -i 's/wallpaper_mode=1/wallpaper_mode=0/g' /usr/share/lxde/pcmanfm/LXDE.conf |
| 28 | sudo sed -i 's/desktop_bg=#000000/desktop_bg=#104187/g' /usr/share/lxde/pcmanfm/LXDE.conf |
| 29 | sudo sed -i '/screensaver/d' /etc/xdg/lxsession/LXDE/autostart |
| 30 | |
| 31 | DESKTOP=${ONOS_USER_HOME}/Desktop |
| 32 | |
| 33 | mkdir -p ${DESKTOP} |
| 34 | |
| 35 | cat > ${DESKTOP}/Eclipse << EOF |
| 36 | [Desktop Entry] |
| 37 | Encoding=UTF-8 |
| 38 | Type=Application |
| 39 | Name=Eclipse |
| 40 | Name[en_US]=Eclipse |
| 41 | Icon=/opt/eclipse/icon.xpm |
| 42 | Exec=/usr/bin/eclipse |
| 43 | Comment[en_US]= |
| 44 | EOF |
| 45 | |
| 46 | cat > ${DESKTOP}/Terminal << EOF |
| 47 | [Desktop Entry] |
| 48 | Encoding=UTF-8 |
| 49 | Type=Application |
| 50 | Name=Terminal |
| 51 | Name[en_US]=Terminal |
| 52 | Icon=konsole |
| 53 | Exec=/usr/bin/x-terminal-emulator |
| 54 | Comment[en_US]= |
| 55 | EOF |
| 56 | |
| 57 | cat > ${DESKTOP}/Gerrit << EOF |
| 58 | [Desktop Entry] |
| 59 | Encoding=UTF-8 |
| 60 | Type=Application |
| 61 | Name=ONOS Gerrit |
| 62 | Name[en_US]=ONOS Gerrit |
| 63 | Icon=internet-web-browser |
| 64 | Exec=/usr/bin/chromium-browser http://gerrit.onos.onlab.us |
| 65 | Comment[en_US]= |
| 66 | EOF |
| 67 | |
| 68 | cat > ${DESKTOP}/Docs << EOF |
| 69 | [Desktop Entry] |
| 70 | Encoding=UTF-8 |
| 71 | Type=Application |
| 72 | Name=ONOS Docs |
| 73 | Name[en_US]=ONOS Docs |
| 74 | Icon=internet-web-browser |
| 75 | Exec=/usr/bin/chromium-browser http://docs.onos.onlab.us |
| 76 | Comment[en_US]= |
| 77 | EOF |
| 78 | |
| 79 | cat > ${DESKTOP}/Wireshark << EOF |
| 80 | [Desktop Entry] |
| 81 | Encoding=UTF-8 |
| 82 | Type=Application |
| 83 | Name=Wireshark |
| 84 | Name[en_US]=Wireshark |
| 85 | Icon=wireshark |
| 86 | Exec=/usr/bin/wireshark |
| 87 | Comment[en_US]= |
| 88 | EOF |
| 89 | |
| 90 | # ------------- Install Other Tools ------------- |
| 91 | sudo apt-get install -y wireshark |
| 92 | # Enable root-less wireshark and add mininet |
| 93 | echo "Enabling wireshark group" |
| 94 | echo "wireshark-common wireshark-common/install-setuid boolean true" | sudo debconf-set-selections |
| 95 | sudo dpkg-reconfigure -f noninteractive wireshark-common |
| 96 | sudo usermod -a -G wireshark mininet |
| 97 | |
| 98 | sudo apt-get install -y git-review |
| 99 | |
| 100 | wget -c -N -O /tmp/eclipse.tar.gz ${ECLIPSE_URL} |
| 101 | tar xzf /tmp/eclipse.tar.gz |
| 102 | sudo mv eclipse /opt |
| 103 | sudo ln -s /opt/eclipse/eclipse /usr/bin/eclipse |
| 104 | |
| 105 | # ------------ Change username and hostname --------------- |
| 106 | echo 'mininet:onos' | sudo chpasswd |
| 107 | sudo mv /home/mininet /home/onos |
| 108 | sudo sed -i 's/mininet/onos/g' /etc/group /etc/gshadow /etc/hosts /etc/hostname /etc/passwd /etc/shadow /etc/sudoers |
| 109 | |