From 188964c911ab9df1a5f8f44d6c95fc9a94c8d2d3 Mon Sep 17 00:00:00 2001 From: Brandon Heller Date: Thu, 4 Mar 2010 16:29:26 -0800 Subject: [PATCH 1/5] Update install scripts Don't build NOX and OVS as root. Also don't nuke kernel src. Install newer autoconf needed for OVS install from Deb backports, not src. --- util/deb/install_mn_deps.sh | 3 +-- util/deb/install_nox.sh | 8 +------- util/deb/install_nox_deps.sh | 9 +++++++++ util/deb/install_ovs.sh | 24 +----------------------- util/deb/install_ovs_2.sh | 7 +++++++ util/deb/install_ovs_deps.sh | 20 ++++++++++++++++++++ util/deb/vm_clean.sh | 10 ++++++++++ 7 files changed, 49 insertions(+), 32 deletions(-) create mode 100755 util/deb/install_nox_deps.sh create mode 100755 util/deb/install_ovs_2.sh create mode 100755 util/deb/install_ovs_deps.sh create mode 100755 util/deb/vm_clean.sh diff --git a/util/deb/install_mn_deps.sh b/util/deb/install_mn_deps.sh index 834044f..57a409b 100755 --- a/util/deb/install_mn_deps.sh +++ b/util/deb/install_mn_deps.sh @@ -17,5 +17,4 @@ sudo su -c "cat /home/mininet/mininet/sysctl_addon >> /etc/sysctl.conf" sudo sysctl -p #Reboot to ensure you start with higher limits and verify that the IPv6 module is not loaded, plus there's an unknown issue where you need to reboot before the kernel datapath will get added (sorry). -sudo reboot - +sudo reboot \ No newline at end of file diff --git a/util/deb/install_nox.sh b/util/deb/install_nox.sh index b1ef857..f7838ac 100755 --- a/util/deb/install_nox.sh +++ b/util/deb/install_nox.sh @@ -2,12 +2,6 @@ #Brandon Heller (brandonh@stanford.edu) #Install NOX on Debian Lenny -#Install NOX deps: -sudo apt-get -y install autoconf automake g++ libtool python python-twisted swig libboost1.35-dev libxerces-c2-dev libssl-dev make - -#Install NOX optional deps: -sudo apt-get install -y libsqlite3-dev python-simplejson - #Install NOX: git clone git://noxrepo.org/noxcore cd noxcore @@ -19,4 +13,4 @@ make #make check #Add NOX_CORE_DIR env var;; modify ~/.bashrc: -sudo sed -i -e 's|# for examples$|&\ncomplete -cf sudo|' ~/.bashrc \ No newline at end of file +sed -i -e 's|# for examples$|&\ncomplete -cf sudo|' ~/.bashrc \ No newline at end of file diff --git a/util/deb/install_nox_deps.sh b/util/deb/install_nox_deps.sh new file mode 100755 index 0000000..b051ecf --- /dev/null +++ b/util/deb/install_nox_deps.sh @@ -0,0 +1,9 @@ +#!/bin/sh +#Brandon Heller (brandonh@stanford.edu) +#Install NOX deps on Debian Lenny + +#Install NOX deps: +sudo apt-get -y install autoconf automake g++ libtool python python-twisted swig libboost1.35-dev libxerces-c2-dev libssl-dev make + +#Install NOX optional deps: +sudo apt-get install -y libsqlite3-dev python-simplejson \ No newline at end of file diff --git a/util/deb/install_ovs.sh b/util/deb/install_ovs.sh index a9ea88d..14df056 100755 --- a/util/deb/install_ovs.sh +++ b/util/deb/install_ovs.sh @@ -2,31 +2,9 @@ #Brandon Heller (brandonh@stanford.edu) #Install OVS on Debian Lenny -#The following files were useful for the install process: -#OVS INSTALL file: -#http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=blob_plain;f=INSTALL.Linux;hb=HEAD - -#OVS OpenFlow INSTALL file: -#http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=blob_plain;f=INSTALL.OpenFlow;hb=HEAD - -#OVS README file: -#http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=blob_plain;f=README;hb=HEAD - -#Install Autoconf 2.63 from source (a more recent version than that in the Deb repositories is required). This should be the only extra dependency. -cd ~/ -wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.63.tar.bz2 -tar xjf autoconf-2.63.tar.bz2 -cd autoconf-2.63/ -./configure -make -sudo make install -cd ~/ -rm -rf autoconf* - #Install OVS: git clone git://openvswitch.org/openvswitch cd openvswitch ./boot.sh ./configure --with-l26=/lib/modules/`uname -r`/build -make -sudo make install \ No newline at end of file +make \ No newline at end of file diff --git a/util/deb/install_ovs_2.sh b/util/deb/install_ovs_2.sh new file mode 100755 index 0000000..30ebbf5 --- /dev/null +++ b/util/deb/install_ovs_2.sh @@ -0,0 +1,7 @@ +#!/bin/sh +#Brandon Heller (brandonh@stanford.edu) +#Install OVS on Debian Lenny + +#Install OVS: +cd openvswitch +sudo make install \ No newline at end of file diff --git a/util/deb/install_ovs_deps.sh b/util/deb/install_ovs_deps.sh new file mode 100755 index 0000000..2cc911f --- /dev/null +++ b/util/deb/install_ovs_deps.sh @@ -0,0 +1,20 @@ +#!/bin/sh +#Brandon Heller (brandonh@stanford.edu) +#Install OVS deps on Debian Lenny + +#The following files were useful for the install process: +#OVS INSTALL file: +#http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=blob_plain;f=INSTALL.Linux;hb=HEAD + +#OVS OpenFlow INSTALL file: +#http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=blob_plain;f=INSTALL.OpenFlow;hb=HEAD + +#OVS README file: +#http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=blob_plain;f=README;hb=HEAD + +#Install Autoconf 2.63+ backport from Debian Backports repo: +#Instructions from http://backports.org/dokuwiki/doku.php?id=instructions +sudo apt-get -y install debian-backports-keyring +sudo su -c "echo 'deb http://www.backports.org/debian lenny-backports main contrib non-free' >> /etc/apt/sources.list" +sudo apt-get update +sudo apt-get -y -t lenny-backports install autoconf \ No newline at end of file diff --git a/util/deb/vm_clean.sh b/util/deb/vm_clean.sh new file mode 100755 index 0000000..155eb09 --- /dev/null +++ b/util/deb/vm_clean.sh @@ -0,0 +1,10 @@ +#!/bin/sh +#Brandon Heller (brandonh@stanford.edu) +#Clean up after VM installation + +sudo apt-get clean +sudo rm -rf /tmp/* +history -c +rm ~/.ssh/id_rsa* +sudo rm ~/.ssh/authorized_keys2 +sudo rm -rf ~/mininet \ No newline at end of file From f7f2f977d57a63115b3c3fc2a27a6f2b288264c2 Mon Sep 17 00:00:00 2001 From: Brandon Heller Date: Thu, 4 Mar 2010 16:34:12 -0800 Subject: [PATCH 2/5] Colorize git output by default in VM --- util/deb/install_tools.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util/deb/install_tools.sh b/util/deb/install_tools.sh index 07d3740..84559cd 100755 --- a/util/deb/install_tools.sh +++ b/util/deb/install_tools.sh @@ -5,3 +5,8 @@ #Install tcpdump and tshark, cmd-line packet dump tools. Also install gitk, #a graphical git history viewer. sudo apt-get install -y tcpdump tshark gitk + +#Set git to colorize everything. +git config --global color.diff auto +git config --global color.status auto +git config --global color.branch auto \ No newline at end of file From 8f30aa00178603d1820db6613a4f745ea1222bba Mon Sep 17 00:00:00 2001 From: Brandon Heller Date: Tue, 9 Mar 2010 22:30:18 -0800 Subject: [PATCH 3/5] Update install instructions --- util/deb/install_mn_deps.sh | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/util/deb/install_mn_deps.sh b/util/deb/install_mn_deps.sh index 57a409b..100315f 100755 --- a/util/deb/install_mn_deps.sh +++ b/util/deb/install_mn_deps.sh @@ -5,16 +5,8 @@ #Install dependencies: sudo apt-get install -y screen psmisc xterm ssh iperf iproute python-setuptools -#Get the source, with the customtopos branch (for now, this should be removed shortly): -git clone git@yuba.stanford.edu:mininet.git -cd ~/mininet -git checkout -b customtopos origin/customtopos - #Add sysctl parameters as noted in the INSTALL file to increase kernel limits to support larger setups: -sudo su -c "cat /home/mininet/mininet/sysctl_addon >> /etc/sysctl.conf" +sudo su -c "cat /home/mininet/mininet/util/sysctl_addon >> /etc/sysctl.conf" #Load sysctl settings: -sudo sysctl -p - -#Reboot to ensure you start with higher limits and verify that the IPv6 module is not loaded, plus there's an unknown issue where you need to reboot before the kernel datapath will get added (sorry). -sudo reboot \ No newline at end of file +sudo sysctl -p \ No newline at end of file From 4e57ddbce11fb3dddb2ea6518e8b8e421bc49445 Mon Sep 17 00:00:00 2001 From: Brandon Heller Date: Tue, 9 Mar 2010 22:45:54 -0800 Subject: [PATCH 4/5] Ignore binary and egg data --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2c454b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +netns +mininet.egg-info From b0a7a2579a54744f32b630848a6d6b0409095632 Mon Sep 17 00:00:00 2001 From: Brandon Heller Date: Wed, 10 Mar 2010 15:44:00 -0800 Subject: [PATCH 5/5] Fix OVS breakage --- mininet/node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mininet/node.py b/mininet/node.py index fb98ff3..30c53ee 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -460,7 +460,7 @@ class OVSKernelSwitch( Switch ): quietRun( 'ovs-dpctl del-dp dp%i' % self.dp ) self.cmd( 'ovs-dpctl add-dp dp%i' % self.dp ) if self.defaultMAC: - intf = 'dp' % self.dp + intf = 'dp%i' % self.dp mac = self.defaultMAC self.cmd( [ 'ifconfig', intf, 'hw', 'ether', mac ] )