Revision 011b02f8 util/install.sh

View differences:

util/install.sh
13 13

  
14 14
# Kernel params
15 15
# These kernels have been tried:
16
#KERNEL_NAME=2.6.29.6-custom
17
#KERNEL_NAME=2.6.33-custom
18
KERNEL_NAME=2.6.33.1-custom
16
KERNEL_NAME=2.6.33.1-mininet
19 17
#KERNEL_NAME=`uname -r`
20 18
KERNEL_HEADERS=linux-headers-${KERNEL_NAME}_${KERNEL_NAME}-10.00.Custom_i386.deb
21 19
KERNEL_IMAGE=linux-image-${KERNEL_NAME}_${KERNEL_NAME}-10.00.Custom_i386.deb
......
25 23

  
26 24
DRIVERS_DIR=/lib/modules/${KERNEL_NAME}/kernel/drivers
27 25

  
28
OVS_RELEASE=openvswitch-0.99.2
29
#OVS_RELEASE=openvswitch
26
OVS_RELEASE=openvswitch-1.0.1
30 27
OVS_DIR=~/$OVS_RELEASE
31 28
OVS_KMOD=openvswitch_mod.ko
32
OF_DIR=~/openflow
33
OF_KMOD=ofdatapath.ko
34 29

  
35 30
function kernel {
36 31
	echo "Install new kernel..."
......
81 76

  
82 77
# The following will cause a full OF install, covering:
83 78
# -user switch
84
# -kernel switch
85 79
# -dissector
86 80
# The instructions below are an abbreviated version from
87 81
# http://www.openflowswitch.org/wk/index.php/Debian_Install
......
93 87
	sudo apt-get install -y git-core automake m4 pkg-config libtool make libc6-dev autoconf autotools-dev gcc
94 88
	git clone git://openflowswitch.org/openflow.git
95 89
	cd ~/openflow
96
	git fetch
97
	sudo regress/scripts/install_deps.pl
98 90

  
99 91
	# Resume the install:
100
	#git checkout -b release/0.8.9 origin/release/0.8.9
101
    # Use temp 0.8.9 branch that compiles:
102
    git checkout -b devel/brandonh/nlfix origin/devel/brandonh/nlfix
103 92
	./boot.sh
104
	./configure --with-l26=/lib/modules/${KERNEL_NAME}
93
	./configure
105 94
	make
106 95
	sudo make install
107 96

  
......
134 123
	sudo apt-get -y --force-yes install debian-backports-keyring
135 124
	sudo apt-get -y --force-yes -t lenny-backports install autoconf
136 125

  
137
	#Install OVS from git
138
	#git clone git://openvswitch.org/openvswitch
139
	#cd openvswitch
140
	#./boot.sh
141

  
142 126
	#Install OVS from release
143 127
	cd ~/
144 128
	wget http://openvswitch.org/releases/${OVS_RELEASE}.tar.gz
......
150 134
	sudo make install
151 135
}
152 136

  
153
# Install NOX
137
# Install NOX with tutorial files
154 138
function nox {
155
	echo "Install NOX..."
139
	echo "Installing NOX w/tutorial files..."
156 140

  
157 141
	#Install NOX deps:
158 142
	sudo apt-get -y install autoconf automake g++ libtool python python-twisted swig libboost1.35-dev libxerces-c2-dev libssl-dev make
......
162 146

  
163 147
	#Install NOX:
164 148
	cd ~/
165
	#git clone git://noxrepo.org/noxcore
166
	# Temporary tutorial repo
167 149
	git clone git://openflowswitch.org/nox-tutorial noxcore
168 150
	cd noxcore
169 151

  
170 152
	# With later autoconf versions this doesn't quite work:
171
	./boot.sh || true
153
	./boot.sh --apps-core || true
172 154
	# So use this instead:
173 155
	autoreconf --install --force
174 156
	mkdir build
......
185 167
    #./nox_core -v -i ptcp:
186 168
}
187 169

  
170
# Install OFtest
171
function oftest {
172
    echo "Installing oftest..."
173

  
174
    #Install deps:
175
    sudo apt-get install -y tcpdump python-scapy
176

  
177
    #Install oftest:
178
    cd ~/
179
    git clone git://openflow.org/oftest
180
    cd oftest
181
    cd tools/munger
182
    sudo make install
183
}
184

  
185
# Install cbench
186
function cbench {
187
    echo "Installing cbench..."
188
    
189
    sudo apt-get install -y libsnmp-dev
190
    cd ~/
191
    git clone git://www.openflow.org/oflops.git
192
    cd oflops
193
    sh boot.sh
194
    ./configure --with-openflow-src-dir=/home/mininet/openflow
195
    make
196
    sudo make install || true # make install fails; force past this
197
}
198

  
188 199
function other {
189 200
	echo "Doing other setup tasks..."
190 201

  
......
208 219

  
209 220
	#Reduce boot screen opt-out delay. Modify timeout in /boot/grub/menu.lst to 1:
210 221
	sudo sed -i -e 's/^timeout.*$/timeout         1/' /boot/grub/menu.lst
211
}
212 222

  
213
function of_33 {
214
	echo "Installing OpenFlow..."
215
	cd ~/
216
	cd openflow
217
	./configure --with-l26=/lib/modules/${KERNEL_NAME}
218
	make
219
	sudo make install
223
    # Clean unneeded debs:
224
    rm -f ~/linux-headers-* ~/linux-image-*
220 225
}
221 226

  
222
# OVS v0.99.2 does not build on 2.6.33, and the master branch of OVS includes
223
# patches for OF1.0 support.  It doesn't look like there's a supported branch
224
# for v0.99, so the script below applies a patch for this.
225
# Since the patch is in a makefile, we'll have to steal the makefile builder,
226
# boot.sh, from the OVS git repo.
227
function ovs_33 {
228
	echo "Installing OpenVSwitch..."
229
	cd ~/
230
	git clone git://openvswitch.org/openvswitch
231
	cp openvswitch/boot.sh $OVS_RELEASE
232
	rm -rf openvswitch
233
	cd ~/$OVS_RELEASE
234
	git apply ~/mininet/util/ovs-fix-2.6.33.patch
235
	./boot.sh
236
	./configure --with-l26=/lib/modules/${KERNEL_NAME}/build
237
	make
238
	sudo make install
239
}
240

  
241
function linux_33 {
242
    kernel
243
	of_33
244
	ovs_33
245
	modprobe
246

  
247
	# Clean unneeded debs:
248
	rm -f ~/linux-headers-* ~/linux-image-*
249
}
250

  
251
# Script to copy built OVS and OF kernel modules to where modprobe will
227
# Script to copy built OVS kernel module to where modprobe will
252 228
# find them automatically.  Removes the need to keep an environment variable
253
# for each, and works nicely with multiple kernel versions.
229
# for insmod usage, and works nicely with multiple kernel versions.
254 230
#
255
# The downside is that after each recompilation of OVS or OF you'll need to
231
# The downside is that after each recompilation of OVS you'll need to
256 232
# re-run this script.  If you're using only one kernel version, then it may be
257 233
# a good idea to use a symbolic link in place of the copy below.
258 234
function modprobe {
259 235
	echo "Setting up modprobe for OVS kmod..."
260
	sudo cp $OVS_DIR/datapath/linux-2.6/$OVS_KMOD $DRIVERS_DIR
261

  
262
	echo "Setting up modprobe for OF kmod..."
263
	sudo cp $OF_DIR/datapath/linux-2.6/$OF_KMOD $DRIVERS_DIR
264 236

  
237
	sudo cp $OVS_DIR/datapath/linux-2.6/$OVS_KMOD $DRIVERS_DIR
265 238
	sudo depmod -a ${KERNEL_NAME}
266 239
}
267 240

  
......
273 246
	ovs
274 247
	modprobe
275 248
	nox
249
	oftest
250
	cbench
276 251
	other
277 252
	echo "Please reboot, then run ./mininet/util/install.sh -c to remove unneeded packages."
278 253
	echo "Enjoy Mininet!"
......
310 285
then
311 286
	all
312 287
else
313
	while getopts 'acdfhkmntvxy' OPTION
288
	while getopts 'acdfhkmntvx' OPTION
314 289
	do
315 290
	  case $OPTION in
316 291
	  a)    all;;
......
324 299
	  t)    other;;
325 300
	  v)    ovs;;
326 301
	  x)    nox;;
327
	  y)    linux_33;;
328 302
	  ?)    usage;;
329 303
	  esac
330 304
	done

Also available in: Unified diff