mininet / util / vm / install-mininet-vm.sh @ 86af067e
History | View | Annotate | Download (1.59 KB)
1 | d9fd4ea2 | Bob Lantz | #!/bin/bash |
---|---|---|---|
2 | |||
3 | # This script is intended to install Mininet into |
||
4 | 8c7c4812 | Bob Lantz | # a brand-new Ubuntu virtual machine, |
5 | d9fd4ea2 | Bob Lantz | # to create a fully usable "tutorial" VM. |
6 | b9288efc | Bob Lantz | # |
7 | # optional argument: Mininet branch to install |
||
8 | d9fd4ea2 | Bob Lantz | set -e |
9 | 1edf3515 | Brian O'Connor | echo "$(whoami) ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers > /dev/null |
10 | d9fd4ea2 | Bob Lantz | sudo sed -i -e 's/Default/#Default/' /etc/sudoers |
11 | 307d60a0 | Bob Lantz | echo mininet-vm | sudo tee /etc/hostname > /dev/null |
12 | d9fd4ea2 | Bob Lantz | sudo sed -i -e 's/ubuntu/mininet-vm/g' /etc/hosts |
13 | sudo hostname `cat /etc/hostname` |
||
14 | a84bec97 | Bob Lantz | sudo sed -i -e 's/splash//' /etc/default/grub |
15 | sudo sed -i -e 's/quiet/text/' /etc/default/grub |
||
16 | d9fd4ea2 | Bob Lantz | sudo update-grub |
17 | d9d209f3 | Bob Lantz | # Update from official archive |
18 | sudo apt-get update |
||
19 | 307d60a0 | Bob Lantz | # 12.10 and earlier |
20 | d9d209f3 | Bob Lantz | #sudo sed -i -e 's/us.archive.ubuntu.com/mirrors.kernel.org/' \ |
21 | # /etc/apt/sources.list |
||
22 | 307d60a0 | Bob Lantz | # 13.04 and later |
23 | d9d209f3 | Bob Lantz | #sudo sed -i -e 's/\/archive.ubuntu.com/\/mirrors.kernel.org/' \ |
24 | # /etc/apt/sources.list |
||
25 | 8c7c4812 | Bob Lantz | # Clean up vmware easy install junk if present |
26 | if [ -e /etc/issue.backup ]; then |
||
27 | sudo mv /etc/issue.backup /etc/issue |
||
28 | fi |
||
29 | if [ -e /etc/rc.local.backup ]; then |
||
30 | sudo mv /etc/rc.local.backup /etc/rc.local |
||
31 | fi |
||
32 | b9288efc | Bob Lantz | # Fetch Mininet |
33 | d9fd4ea2 | Bob Lantz | sudo apt-get -y install git-core openssh-server |
34 | git clone git://github.com/mininet/mininet |
||
35 | b9288efc | Bob Lantz | # Optionally check out branch |
36 | if [ "$1" != "" ]; then |
||
37 | pushd mininet |
||
38 | 0094997a | Brian O'Connor | #git checkout -b $1 $1 |
39 | # TODO branch will in detached HEAD state if it is not master |
||
40 | git checkout $1 |
||
41 | b9288efc | Bob Lantz | popd |
42 | fi |
||
43 | # Install Mininet |
||
44 | d9fd4ea2 | Bob Lantz | time mininet/util/install.sh |
45 | 949e0b3a | Bob Lantz | # Finalize VM |
46 | time mininet/util/install.sh -tc |
||
47 | 8c7c4812 | Bob Lantz | # Ignoring this since NOX classic is deprecated |
48 | #if ! grep NOX_CORE_DIR .bashrc; then |
||
49 | # echo "export NOX_CORE_DIR=~/noxcore/build/src/" >> .bashrc |
||
50 | #fi |
||
51 | 226eae97 | Bob | echo "Done preparing Mininet VM." |