This repository has been archived by the owner on Apr 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
install.sh
executable file
·187 lines (160 loc) · 3.73 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#!/bin/bash
# This script should run in this VM:
# https://bitbucket.org/mininet/mininet-vm-images/downloads/mininet-2.1.0-130919-ubuntu-13.04-server-amd64-ovf.zip
#
# The newer one with ubuntu 14.04 seems to produce strange random
# errors when we run click/clicky.
# (http://onlab.vicci.org/mininet-vm/mininet-2.1.0p2-140718-ubuntu-14.04-server-amd64-ovf.zip)
#
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
install='sudo apt-get -y install'
sshd_config_file='/etc/ssh/sshd_config'
# 13.04 is now in the old-releases.
if [ $(lsb_release -r|cut -f2) == 13.04 ]; then
apt_file=/etc/apt/sources.list
sudo sed -i -s 's/mirrors.kernel.org/old-releases.ubuntu.com/' $apt_file
sudo sed -i -s 's/security.ubuntu.com/old-releases.ubuntu.com/' $apt_file
fi
sudo apt-get update
##
## general
##
$install \
xserver-xorg-video-vmware xinit x11-xserver-utils \
fluxbox
##
## autologin
##
file=/etc/init/tty1.conf
if ! grep -q autologin $file; then
sudo sed -i -e 's/sbin\/getty/sbin\/getty --autologin mininet/' $file
fi
file=~/.profile
if ! grep -q on.tty1 $file; then
cat <<EOF >>$file
#start x automatically on tty1
test \$(tty) == /dev/tty1 && exec startx
EOF
fi
##
## VirtualBox Guest Additions
##
sudo mount /dev/cdrom /mnt
cd /mnt
if [ -f ./VBoxLinuxAdditions.run ]; then
sudo ./VBoxLinuxAdditions.run
else
$install virtualbox-guest-additions
fi
sudo umount /mnt
##
## GUI
##
$install python-networkx python-imaging-tk
##
## Click
##
# for clicky
$install graphviz
# Download click from git and compile
# TODO: instead of HEAD, we should clone a version known to work.
cd
git clone --depth 1 https://github.com/kohler/click.git
cd click
./configure --disable-linuxmodule
CPU=$(grep -c '^processor' /proc/cpuinfo)
make -j$CPU
sudo make install
cd apps/clicky
autoreconf -i
./configure
make -j$CPU
sudo make install
cd ../..
make clean
# install clickhelper.py to be availble from netconfd
cd /usr/local/bin
sudo ln -s "$DIR/mininet/mininet/clickhelper.py" .
##
## OpenYuma
##
# This will install all dependencies for NETCONF
$install \
libxml2-dev libssh2-1-dev libgcrypt11-dev libncurses5-dev \
make gcc automake \
openssh-client openssh-server ssh
#git clone https://github.com/OpenClovis/OpenYuma.git
cd "$DIR/OpenYuma"
make
sudo make install
#we need to setup the ssh server with more than one port for NETCONF
cat <<EOF | sudo tee -a $sshd_config_file
# ----- NETCONF -----
Port 830
Port 831
Port 832
Port 833
Subsystem netconf /usr/sbin/netconf-subsystem
# --- END NETCONF ---
EOF
#restarting ssh server
sudo /etc/init.d/ssh restart
cd "$DIR/Unify_ncagent/vnf_starter"
mkdir -p bin
mkdir -p lib
sudo cp vnf_starter.yang /usr/share/yuma/modules/
make
sudo make install
make clean
##
## NCCLIENT
##
# Requirements:
# <= 2.6 python < 3
# python-setuptools 0.6+
# python-paramiko 1.7+
# python-lxml 3.0+
# python-libxml2
# python-libxslt
# libxml2
# (Debian) libxslt1-dev
$install \
python-setuptools python-paramiko python-lxml python-libxml2 \
python-libxslt1 libxml2 libxslt1-dev
cd "$DIR/ncclient"
sudo python setup.py install
##
## vnfcatalog by iMinds
##
$install \
python-jinja2
###
### lookbusy, http://www.devin.com/lookbusy/download/lookbusy-1.4.tar.gz
###
cd "$DIR/lookbusy-1.4"
./configure
make
sudo make install
make clean
##
## mininet
##
cd "$DIR/mininet"
sudo python setup.py install
##
## Start the demo automatically
##
mkdir -p ~/bin
cat <<EOF > ~/bin/fbautostart
#!/bin/sh
cd $DIR/gui && xterm -geometry +0+0 &
cd $DIR/gui && sudo ./run &
emacs --no-splash -f tool-bar-mode -g 70x23-0+0 $DIR/walkthrough.org &
EOF
chmod u+x ~/bin/fbautostart
##
## Restore disk space, remove sensitive files, etc.
##
sudo rm -f /etc/udev/rules.d/70-persistent-net.rules
$DIR/mininet/util/install.sh -d
sudo rm -f /tmp/zero