3 # Mininet install script for Ubuntu (and Debian Wheezy+)
4 # Brandon Heller (brandonh@stanford.edu)
9 # Fail on unset var usage
12 # Get directory containing mininet folder
13 MININET_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd -P )"
15 # Set up build directory, which by default is the working directory
16 # unless the working directory is a subdirectory of mininet,
17 # in which case we use the directory containing mininet
20 $MININET_DIR/*) BUILD_DIR=$MININET_DIR;; # currect directory is a subdirectory
21 *) BUILD_DIR=$BUILD_DIR;;
24 # Location of CONFIG_NET_NS-enabled kernel(s)
25 KERNEL_LOC=http://www.openflow.org/downloads/mininet
27 # Attempt to identify Linux release
33 if [ "$ARCH" = "x86_64" ]; then ARCH="amd64"; fi
34 if [ "$ARCH" = "i686" ]; then ARCH="i386"; fi
36 test -e /etc/debian_version && DIST="Debian"
37 grep Ubuntu /etc/lsb-release &> /dev/null && DIST="Ubuntu"
38 if [ "$DIST" = "Ubuntu" ] || [ "$DIST" = "Debian" ]; then
39 # Truly non-interactive apt-get installation
40 install='sudo DEBIAN_FRONTEND=noninteractive apt-get -y -q install'
41 remove='sudo DEBIAN_FRONTEND=noninteractive apt-get -y -q remove'
42 pkginst='sudo dpkg -i'
44 # Prereqs for this script
45 if ! which lsb_release &> /dev/null; then
49 test -e /etc/fedora-release && DIST="Fedora"
50 test -e /etc/redhat-release && DIST="RedHatEnterpriseServer"
51 if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then
52 install='sudo yum -y install'
53 remove='sudo yum -y erase'
54 pkginst='sudo rpm -ivh'
56 # Prereqs for this script
57 if ! which lsb_release &> /dev/null; then
58 $install redhat-lsb-core
61 test -e /etc/SuSE-release && DIST="SUSE Linux"
62 if [ "$DIST" = "SUSE Linux" ]; then
63 install='sudo zypper --non-interactive install '
64 remove='sudo zypper --non-interactive remove '
65 pkginst='sudo rpm -ivh'
66 # Prereqs for this script
67 if ! which lsb_release &> /dev/null; then
68 $install openSUSE-release
71 if which lsb_release &> /dev/null; then
72 DIST=`lsb_release -is`
73 RELEASE=`lsb_release -rs`
74 CODENAME=`lsb_release -cs`
76 echo "Detected Linux distribution: $DIST $RELEASE $CODENAME $ARCH"
80 KERNEL_NAME=`uname -r`
81 KERNEL_HEADERS=kernel-headers-${KERNEL_NAME}
83 # Treat Raspbian as Debian
84 [ "$DIST" = 'Raspbian' ] && DIST='Debian'
86 DISTS='Ubuntu|Debian|Fedora|RedHatEnterpriseServer|SUSE LINUX'
87 if ! echo $DIST | egrep "$DISTS" >/dev/null; then
88 echo "Install.sh currently only supports $DISTS."
92 # More distribution info
93 DIST_LC=`echo $DIST | tr [A-Z] [a-z]` # as lower case
96 # Determine whether version $1 >= version $2
97 # usage: if version_ge 1.20 1.2.3; then echo "true!"; fi
99 # sort -V sorts by *version number*
100 latest=`printf "$1\n$2" | sort -V | tail -1`
101 # If $1 is latest version, then $1 >= $2
102 [ "$1" == "$latest" ]
105 # Attempt to identify Python version
106 PYTHON=${PYTHON:-python}
107 if $PYTHON --version |& grep 'Python 2' > /dev/null; then
108 PYTHON_VERSION=2; PYPKG=python
110 PYTHON_VERSION=3; PYPKG=python3
112 echo "${PYTHON} is version ${PYTHON_VERSION}"
114 # Kernel Deb pkg to be removed:
115 KERNEL_IMAGE_OLD=linux-image-2.6.26-33-generic
117 DRIVERS_DIR=/lib/modules/${KERNEL_NAME}/kernel/drivers/net
120 OVS_PACKAGE_LOC=https://github.com/downloads/mininet/mininet
121 OVS_BUILDSUFFIX=-ignore # was -2
122 OVS_PACKAGE_NAME=ovs-$OVS_RELEASE-core-$DIST_LC-$RELEASE-$ARCH$OVS_BUILDSUFFIX.tar
123 OVS_TAG=v$OVS_RELEASE
125 OF13_SWITCH_REV=${OF13_SWITCH_REV:-""}
129 echo "Install Mininet-compatible kernel if necessary"
131 if ! $install linux-image-$KERNEL_NAME; then
132 echo "Could not install linux-image-$KERNEL_NAME"
133 echo "Skipping - assuming installed kernel is OK."
137 function kernel_clean {
138 echo "Cleaning kernel..."
140 # To save disk space, remove previous kernel
141 if ! $remove $KERNEL_IMAGE_OLD; then
142 echo $KERNEL_IMAGE_OLD not installed.
145 # Also remove downloaded packages:
146 rm -f $HOME/linux-headers-* $HOME/linux-image-*
149 # Install Mininet deps
151 echo "Installing Mininet dependencies"
152 if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then
153 $install gcc make socat psmisc xterm openssh-clients iperf \
154 iproute telnet python-setuptools libcgroup-tools \
155 ethtool help2man pyflakes pylint python-pep8 python-pexpect
156 elif [ "$DIST" = "SUSE LINUX" ]; then
157 $install gcc make socat psmisc xterm openssh iperf \
158 iproute telnet ${PYPKG}-setuptools libcgroup-tools \
159 ethtool help2man python-pyflakes python3-pylint \
160 python-pep8 ${PYPKG}-pexpect ${PYPKG}-tk
162 $install gcc make socat psmisc xterm ssh iperf telnet \
163 cgroup-bin ethtool help2man pyflakes pylint pep8 \
164 ${PYPKG}-setuptools ${PYPKG}-pexpect ${PYPKG}-tk
165 $install iproute2 || $install iproute
168 echo "Installing Mininet core"
169 pushd $MININET_DIR/mininet
170 sudo PYTHON=${PYTHON} make install
174 # Install Mininet developer dependencies
176 echo "Installing Mininet developer dependencies"
177 $install doxygen doxypy texlive-fonts-recommended
178 if ! $install doxygen-latex; then
179 echo "doxygen-latex not needed"
183 # The following will cause a full OF install, covering:
185 # The instructions below are an abbreviated version from
186 # http://www.openflowswitch.org/wk/index.php/Debian_Install
188 echo "Installing OpenFlow reference implementation..."
190 $install autoconf automake libtool make gcc
191 if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then
192 $install git pkgconfig glibc-devel
193 elif [ "$DIST" = "SUSE LINUX" ]; then
194 $install git pkgconfig glibc-devel
196 $install git-core autotools-dev pkg-config libc6-dev
198 # was: git clone git://openflowswitch.org/openflow.git
199 # Use our own fork on github for now:
200 git clone git://github.com/mininet/openflow
201 cd $BUILD_DIR/openflow
203 # Patch controller to handle more than 16 switches
204 patch -p1 < $MININET_DIR/mininet/util/openflow-patches/controller.patch
206 # Resume the install:
215 echo "Installing OpenFlow 1.3 soft switch implementation..."
217 $install git-core autoconf automake autotools-dev pkg-config \
218 make gcc g++ libtool libc6-dev cmake libpcap-dev \
219 unzip libpcre3-dev flex bison libboost-dev
220 if [ "$DIST" = "Ubuntu" ] && version_le $RELEASE 16.04; then
221 $install libxerces-c2-dev
223 $install libxerces-c-dev
225 if [ ! -d "ofsoftswitch13" ]; then
226 git clone https://github.com/CPqD/ofsoftswitch13.git
227 if [[ -n "$OF13_SWITCH_REV" ]]; then
229 git checkout ${OF13_SWITCH_REV}
235 if [ ! -d "netbee" ]; then
236 git clone https://github.com/netgroup-polito/netbee.git
243 sudo cp netbee/bin/libn*.so /usr/local/lib
245 sudo cp -R netbee/include/ /usr/
247 # Resume the install:
248 cd $BUILD_DIR/ofsoftswitch13
257 function install_wireshark {
258 if ! which wireshark; then
259 echo "Installing Wireshark"
260 if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then
261 $install wireshark wireshark-gnome
262 elif [ "$DIST" = "SUSE LINUX" ]; then
265 $install wireshark tshark
269 # Copy coloring rules: OF is white-on-blue:
270 echo "Optionally installing wireshark color filters"
271 mkdir -p $HOME/.wireshark
272 cp -n $MININET_DIR/mininet/util/colorfilters $HOME/.wireshark
274 echo "Checking Wireshark version"
275 WSVER=`wireshark -v | egrep -o '[0-9\.]+' | head -1`
276 if version_ge $WSVER 1.12; then
277 echo "Wireshark version $WSVER >= 1.12 - returning"
281 echo "Cloning LoxiGen and building openflow.lua dissector"
283 git clone https://github.com/floodlight/loxigen.git
287 # Copy into plugin directory
288 # libwireshark0/ on 11.04; libwireshark1/ on later
289 WSDIR=`find /usr/lib -type d -name 'libwireshark*' | head -1`
290 WSPLUGDIR=$WSDIR/plugins/
291 PLUGIN=loxi_output/wireshark/openflow.lua
292 sudo cp $PLUGIN $WSPLUGDIR
293 echo "Copied openflow plugin $PLUGIN to $WSPLUGDIR"
299 # Install Open vSwitch specific version Ubuntu package
301 echo "Creating and Installing Open vSwitch packages..."
303 OVS_SRC=$BUILD_DIR/openvswitch
304 OVS_TARBALL_LOC=http://openvswitch.org/releases
306 if ! echo "$DIST" | egrep "Ubuntu|Debian" > /dev/null; then
307 echo "OS must be Ubuntu or Debian"
311 if [ "$DIST" = "Ubuntu" ] && ! version_ge $RELEASE 12.04; then
312 echo "Ubuntu version must be >= 12.04"
316 if [ "$DIST" = "Debian" ] && ! version_ge $RELEASE 7.0; then
317 echo "Debian version must be >= 7.0"
326 if wget $OVS_TARBALL_LOC/openvswitch-$OVS_RELEASE.tar.gz 2> /dev/null; then
327 tar xzf openvswitch-$OVS_RELEASE.tar.gz
329 echo "Failed to find OVS at $OVS_TARBALL_LOC/openvswitch-$OVS_RELEASE.tar.gz"
334 # Remove any old packages
336 $remove openvswitch-common openvswitch-datapath-dkms openvswitch-pki openvswitch-switch \
337 openvswitch-controller || true
340 $install build-essential fakeroot debhelper autoconf automake libssl-dev \
341 pkg-config bzip2 openssl python-all procps python-qt4 \
342 python-zopeinterface python-twisted-conch dkms dh-python dh-autoreconf \
346 parallel=`grep processor /proc/cpuinfo | wc -l`
347 cd $BUILD_DIR/openvswitch/openvswitch-$OVS_RELEASE
348 DEB_BUILD_OPTIONS='parallel=$parallel nocheck' fakeroot debian/rules binary
350 for pkg in common datapath-dkms pki switch; do
351 pkg=openvswitch-${pkg}_$OVS_RELEASE*.deb
352 echo "Installing $pkg"
355 if $pkginst openvswitch-controller_$OVS_RELEASE*.deb 2>/dev/null; then
356 echo "Ignoring error installing openvswitch-controller"
359 /sbin/modinfo openvswitch
361 # Switch can run on its own, but
362 # Mininet should control the controller
363 # This appears to only be an issue on Ubuntu/Debian
364 if sudo service openvswitch-controller stop 2>/dev/null; then
365 echo "Stopped running controller"
367 if [ -e /etc/init.d/openvswitch-controller ]; then
368 sudo update-rc.d openvswitch-controller disable
373 # Install Open vSwitch
376 echo "Installing Open vSwitch..."
378 if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then
379 $install openvswitch openvswitch-controller
383 if [ "$DIST" = "Ubuntu" ] && ! version_ge $RELEASE 14.04; then
384 # Older Ubuntu versions need openvswitch-datapath/-dkms
385 # Manually installing openvswitch-datapath may be necessary
386 # for manually built kernel .debs using Debian's defective kernel
387 # packaging, which doesn't yield usable headers.
388 if ! dpkg --get-selections | grep openvswitch-datapath; then
389 # If you've already installed a datapath, assume you
390 # know what you're doing and don't need dkms datapath.
391 # Otherwise, install it.
392 $install openvswitch-datapath-dkms
396 $install openvswitch-switch
398 if $install openvswitch-controller; then
399 OVSC="openvswitch-controller"
401 echo "Attempting to install openvswitch-testcontroller"
402 if $install openvswitch-testcontroller; then
403 OVSC="openvswitch-testcontroller"
405 echo "Failed - skipping openvswitch-testcontroller"
409 # Switch can run on its own, but
410 # Mininet should control the controller
411 # This appears to only be an issue on Ubuntu/Debian
412 if sudo service $OVSC stop 2>/dev/null; then
413 echo "Stopped running controller"
415 if [ -e /etc/init.d/$OVSC ]; then
416 sudo update-rc.d $OVSC disable
421 function remove_ovs {
422 pkgs=`dpkg --get-selections | grep openvswitch | awk '{ print $1;}'`
423 echo "Removing existing Open vSwitch packages:"
425 if ! $remove $pkgs; then
426 echo "Not all packages removed correctly"
428 # For some reason this doesn't happen
429 if scripts=`ls /etc/init.d/*openvswitch* 2>/dev/null`; then
431 for s in $scripts; do
435 sudo rm -f /etc/init.d/$s
436 sudo update-rc.d -f $s remove
439 echo "Done removing OVS"
443 echo "Installing Indigo Virtual Switch..."
445 IVS_SRC=$BUILD_DIR/ivs
447 # Install dependencies
449 if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then
450 $install git pkgconfig libnl3-devel libcap-devel openssl-devel
452 $install git-core pkg-config libnl-3-dev libnl-route-3-dev \
456 # Install IVS from source
458 git clone git://github.com/floodlight/ivs $IVS_SRC
460 git submodule update --init
467 echo "Installing RYU..."
469 # install Ryu dependencies"
470 $install autoconf automake g++ libtool python make
471 if [ "$DIST" = "Ubuntu" -o "$DIST" = "Debian" ]; then
472 $install gcc python-pip python-dev libffi-dev libssl-dev \
473 libxml2-dev libxslt1-dev zlib1g-dev
478 git clone git://github.com/osrg/ryu.git ryu
482 sudo pip install -r tools/pip-requires -r tools/optional-requires \
483 -r tools/test-requires
484 sudo python setup.py install
486 # Add symbolic link to /usr/bin
487 sudo ln -s ./bin/ryu-manager /usr/local/bin/ryu-manager
490 # Install NOX with tutorial files
492 echo "Installing NOX w/tutorial files..."
495 $install autoconf automake g++ libtool python python-twisted \
497 if [ "$DIST" = "Debian" ]; then
498 $install libboost1.35-dev
499 elif [ "$DIST" = "Ubuntu" ]; then
500 $install python-dev libboost-dev
501 $install libboost-filesystem-dev
502 $install libboost-test-dev
504 # Install NOX optional deps:
505 $install libsqlite3-dev python-simplejson
509 git clone https://github.com/noxrepo/nox-classic.git noxcore
511 if ! git checkout -b destiny remotes/origin/destiny ; then
512 echo "Did not check out a new destiny branch - assuming current branch is destiny"
516 git checkout -b tutorial-destiny
517 git am $MININET_DIR/mininet/util/nox-patches/*tutorial-port-nox-destiny*.patch
518 if [ "$DIST" = "Ubuntu" ] && version_ge $RELEASE 12.04; then
519 git am $MININET_DIR/mininet/util/nox-patches/*nox-ubuntu12-hacks.patch
530 # Add NOX_CORE_DIR env var:
531 sed -i -e 's|# for examples$|&\nexport NOX_CORE_DIR=$BUILD_DIR/noxcore/build/src|' ~/.bashrc
533 # To verify this install:
534 #cd ~/noxcore/build/src
535 #./nox_core -v -i ptcp:
538 # Install NOX Classic/Zaku for OpenFlow 1.3
540 echo "Installing NOX w/tutorial files..."
543 $install autoconf automake g++ libtool python python-twisted \
545 if [ "$DIST" = "Debian" ]; then
546 $install libboost1.35-dev
547 elif [ "$DIST" = "Ubuntu" ]; then
548 $install python-dev libboost-dev
549 $install libboost-filesystem-dev
550 $install libboost-test-dev
555 git clone https://github.com/CPqD/nox13oflib.git
566 # To verify this install:
567 #cd ~/nox13oflib/build/src
568 #./nox_core -v -i ptcp:
574 echo "Installing POX into $BUILD_DIR/pox..."
576 git clone https://github.com/noxrepo/pox.git
581 echo "Installing oftest..."
584 $install tcpdump python-scapy
588 git clone git://github.com/floodlight/oftest
593 echo "Installing cbench..."
595 if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then
596 $install net-snmp-devel libpcap-devel libconfig-devel
597 elif [ "$DIST" = "SUSE LINUX" ]; then
598 $install net-snmp-devel libpcap-devel libconfig-devel
600 $install libsnmp-dev libpcap-dev libconfig-dev
603 # was: git clone git://gitosis.stanford.edu/oflops.git
604 # Use our own fork on github for now:
605 git clone git://github.com/mininet/oflops
607 sh boot.sh || true # possible error in autoreconf, so run twice
609 ./configure --with-openflow-src-dir=$BUILD_DIR/openflow
611 sudo make install || true # make install fails; force past this
615 echo "Doing other Mininet VM setup tasks..."
617 # Remove avahi-daemon, which may cause unwanted discovery packets to be
618 # sent during tests, near link status changes:
619 echo "Removing avahi-daemon"
622 # was: Disable IPv6. Add to /etc/modprobe.d/blacklist:
623 #echo "Attempting to disable IPv6"
624 #if [ "$DIST" = "Ubuntu" ]; then
625 # BLACKLIST=/etc/modprobe.d/blacklist.conf
627 # BLACKLIST=/etc/modprobe.d/blacklist
629 #sudo sh -c "echo 'blacklist net-pf-10\nblacklist ipv6' >> $BLACKLIST"
630 echo "Disabling IPv6"
632 if ! grep 'disable_ipv6' /etc/sysctl.conf; then
633 echo 'Disabling IPv6'
635 # Mininet: disable IPv6
636 net.ipv6.conf.all.disable_ipv6 = 1
637 net.ipv6.conf.default.disable_ipv6 = 1
638 net.ipv6.conf.lo.disable_ipv6 = 1' | sudo tee -a /etc/sysctl.conf > /dev/null
640 # Since the above doesn't disable neighbor discovery, also do this:
641 if ! grep 'ipv6.disable' /etc/default/grub; then
643 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 /' \
647 # Disabling IPv6 breaks X11 forwarding via ssh
648 line='AddressFamily inet'
649 file='/etc/ssh/sshd_config'
650 echo "Adding $line to $file"
651 if ! grep "$line" $file > /dev/null; then
652 echo "$line" | sudo tee -a $file > /dev/null
655 # Enable command auto completion using sudo; modify ~/.bashrc:
656 sed -i -e 's|# for examples$|&\ncomplete -cf sudo|' ~/.bashrc
658 # Install tcpdump, cmd-line packet dump tool. Also install gitk,
659 # a graphical git history viewer.
660 $install tcpdump gitk
662 # Install common text editors
663 $install vim nano emacs
668 # Install vconfig for VLAN example
669 if [ "$DIST" = "Fedora" -o "$DIST" = "RedHatEnterpriseServer" ]; then
675 # Set git to colorize everything.
676 git config --global color.diff auto
677 git config --global color.status auto
678 git config --global color.branch auto
680 # Reduce boot screen opt-out delay. Modify timeout in /boot/grub/menu.lst to 1:
681 if [ "$DIST" = "Debian" ]; then
682 sudo sed -i -e 's/^timeout.*$/timeout 1/' /boot/grub/menu.lst
685 # Clean unneeded debs:
686 rm -f ~/linux-headers-* ~/linux-image-*
689 # Script to copy built OVS kernel module to where modprobe will
690 # find them automatically. Removes the need to keep an environment variable
691 # for insmod usage, and works nicely with multiple kernel versions.
693 # The downside is that after each recompilation of OVS you'll need to
694 # re-run this script. If you're using only one kernel version, then it may be
695 # a good idea to use a symbolic link in place of the copy below.
697 echo "Setting up modprobe for OVS kmod..."
699 if [ -z "$OVS_KMODS" ]; then
700 echo "OVS_KMODS not set. Aborting."
702 sudo cp $OVS_KMODS $DRIVERS_DIR
703 sudo depmod -a ${KERNEL_NAME}
709 if [ "$DIST" = "Fedora" ]; then
710 printf "\nFedora 18+ support (still work in progress):\n"
711 printf " * Fedora 18+ has kernel 3.10 RPMS in the updates repositories\n"
712 printf " * Fedora 18+ has openvswitch 1.10 RPMS in the updates repositories\n"
713 printf " * the install.sh script options [-bfnpvw] should work.\n"
714 printf " * for a basic setup just try:\n"
715 printf " install.sh -fnpv\n\n"
718 echo "Installing all packages except for -eix (doxypy, ivs, nox-classic)..."
721 # Skip mn_dev (doxypy/texlive/fonts/etc.) because it's huge
726 # We may add ivs once it's more mature
728 # NOX-classic is deprecated, but you can install it manually if desired.
733 echo "Enjoy Mininet!"
736 # Restore disk space and remove sensitive files before shipping a VM.
738 echo "Cleaning VM..."
740 sudo apt-get autoremove
742 sudo rm -rf openvswitch*.tar.gz
744 # Remove sensistive files
745 history -c # note this won't work if you have multiple bash sessions
746 rm -f ~/.bash_history # need to clear in memory and remove on disk
747 rm -f ~/.ssh/id_rsa* ~/.ssh/known_hosts
748 sudo rm -f ~/.ssh/authorized_keys*
750 # Remove SSH keys and regenerate on boot
751 echo 'Removing SSH keys from /etc/ssh/'
752 sudo rm -f /etc/ssh/*key*
753 if ! grep mininet /etc/rc.local >& /dev/null; then
754 sudo sed -i -e "s/exit 0//" /etc/rc.local
756 # mininet: regenerate ssh keys if we deleted them
757 if ! stat -t /etc/ssh/*key* >/dev/null 2>&1; then
758 /usr/sbin/dpkg-reconfigure openssh-server
761 ' | sudo tee -a /etc/rc.local > /dev/null
764 # Remove Mininet files
765 #sudo rm -f /lib/modules/python2.5/site-packages/mininet*
766 #sudo rm -f /usr/bin/mnexec
768 # Clear optional dev script for SSH keychain load on boot
769 rm -f ~/.bash_profile
772 git config --global user.name "None"
773 git config --global user.email "None"
775 # Note: you can shrink the .vmdk in vmware using
776 # vmware-vdiskmanager -k *.vmdk
777 echo "Zeroing out disk blocks for efficient compaction..."
778 time sudo dd if=/dev/zero of=/tmp/zero bs=1M || true
779 sync ; sleep 1 ; sync ; sudo rm -f /tmp/zero
784 printf '\nUsage: %s [-abcdfhikmnprtvVwxy03]\n\n' $(basename $0) >&2
786 printf 'This install script attempts to install useful packages\n' >&2
787 printf 'for Mininet. It should (hopefully) work on Ubuntu 11.10+\n' >&2
788 printf 'If you run into trouble, try\n' >&2
789 printf 'installing one thing at a time, and looking at the \n' >&2
790 printf 'specific installation function in this script.\n\n' >&2
792 printf 'options:\n' >&2
793 printf -- ' -a: (default) install (A)ll packages - good luck!\n' >&2
794 printf -- ' -b: install controller (B)enchmark (oflops)\n' >&2
795 printf -- ' -c: (C)lean up after kernel install\n' >&2
796 printf -- ' -d: (D)elete some sensitive files from a VM image\n' >&2
797 printf -- ' -e: install Mininet d(E)veloper dependencies\n' >&2
798 printf -- ' -f: install Open(F)low\n' >&2
799 printf -- ' -h: print this (H)elp message\n' >&2
800 printf -- ' -i: install (I)ndigo Virtual Switch\n' >&2
801 printf -- ' -k: install new (K)ernel\n' >&2
802 printf -- ' -m: install Open vSwitch kernel (M)odule from source dir\n' >&2
803 printf -- ' -n: install Mini(N)et dependencies + core files\n' >&2
804 printf -- ' -p: install (P)OX OpenFlow Controller\n' >&2
805 printf -- ' -r: remove existing Open vSwitch packages\n' >&2
806 printf -- ' -s <dir>: place dependency (S)ource/build trees in <dir>\n' >&2
807 printf -- ' -t: complete o(T)her Mininet VM setup tasks\n' >&2
808 printf -- ' -v: install Open (V)switch\n' >&2
809 printf -- ' -V <version>: install a particular version of Open (V)switch on Ubuntu\n' >&2
810 printf -- ' -w: install OpenFlow (W)ireshark dissector\n' >&2
811 printf -- ' -y: install R(y)u Controller\n' >&2
812 printf -- ' -x: install NO(X) Classic OpenFlow controller\n' >&2
813 printf -- ' -0: (default) -0[fx] installs OpenFlow 1.0 versions\n' >&2
814 printf -- ' -3: -3[fx] installs OpenFlow 1.3 versions\n' >&2
824 while getopts 'abcdefhikmnprs:tvV:wxy03' OPTION
832 f) case $OF_VERSION in
835 *) echo "Invalid OpenFlow version $OF_VERSION";;
844 s) mkdir -p $OPTARG; # ensure the directory is created
845 BUILD_DIR="$( cd -P "$OPTARG" && pwd )"; # get the full path
846 echo "Dependency installation directory: $BUILD_DIR";;
849 V) OVS_RELEASE=$OPTARG;
851 w) install_wireshark;;
852 x) case $OF_VERSION in
855 *) echo "Invalid OpenFlow version $OF_VERSION";;
863 shift $(($OPTIND - 1))