Try to make format mostly consistent. No tabs for the moment, although

we could switch to smart tabs (i.e. tab for indent, space for align.)
This commit is contained in:
Bob Lantz
2012-02-01 15:29:53 -08:00
parent d990eb0717
commit c120e37897
+30 -24
View File
@@ -49,7 +49,7 @@ function kernel {
wget -c $KERNEL_LOC/$KERNEL_HEADERS wget -c $KERNEL_LOC/$KERNEL_HEADERS
wget -c $KERNEL_LOC/$KERNEL_IMAGE wget -c $KERNEL_LOC/$KERNEL_IMAGE
#Install custom linux headers and image: # Install custom linux headers and image:
sudo dpkg -i $KERNEL_IMAGE $KERNEL_HEADERS sudo dpkg -i $KERNEL_IMAGE $KERNEL_HEADERS
# The next two steps are to work around a bug in newer versions of # The next two steps are to work around a bug in newer versions of
@@ -63,7 +63,9 @@ function kernel {
# Ensure /boot/grub/menu.lst boots with initrd image: # Ensure /boot/grub/menu.lst boots with initrd image:
sudo update-grub sudo update-grub
# The default should be the new kernel. Otherwise, you may need to modify /boot/grub/menu.lst to set the default to the entry corresponding to the kernel you just installed. # The default should be the new kernel. Otherwise, you may need to modify
# /boot/grub/menu.lst to set the default to the entry corresponding to the
# kernel you just installed.
fi fi
} }
@@ -74,7 +76,7 @@ function kernel_clean {
# To save disk space, remove previous kernel # To save disk space, remove previous kernel
sudo apt-get -y remove $KERNEL_IMAGE_OLD sudo apt-get -y remove $KERNEL_IMAGE_OLD
#Also remove downloaded packages: # Also remove downloaded packages:
rm -f ~/linux-headers-* ~/linux-image-* rm -f ~/linux-headers-* ~/linux-image-*
} }
@@ -89,10 +91,11 @@ function mn_deps {
sudo easy_install --upgrade networkx sudo easy_install --upgrade networkx
fi fi
#Add sysctl parameters as noted in the INSTALL file to increase kernel limits to support larger setups: # Add sysctl parameters as noted in the INSTALL file to increase kernel
# limits to support larger setups:
sudo su -c "cat $HOME/mininet/util/sysctl_addon >> /etc/sysctl.conf" sudo su -c "cat $HOME/mininet/util/sysctl_addon >> /etc/sysctl.conf"
#Load new sysctl settings: # Load new sysctl settings:
sudo sysctl -p sudo sysctl -p
echo "Installing Mininet core" echo "Installing Mininet core"
@@ -111,7 +114,8 @@ function of {
echo "Installing OpenFlow and its tools..." echo "Installing OpenFlow and its tools..."
cd ~/ cd ~/
sudo apt-get install -y git-core automake m4 pkg-config libtool make libc6-dev autoconf autotools-dev gcc sudo apt-get install -y git-core automake m4 pkg-config libtool \
make libc6-dev autoconf autotools-dev gcc
git clone git://openflowswitch.org/openflow.git git clone git://openflowswitch.org/openflow.git
cd ~/openflow cd ~/openflow
@@ -134,7 +138,8 @@ function of {
mkdir -p ~/.wireshark mkdir -p ~/.wireshark
cp ~/mininet/util/colorfilters ~/.wireshark cp ~/mininet/util/colorfilters ~/.wireshark
# Remove avahi-daemon, which may cause unwanted discovery packets to be sent during tests, near link status changes: # Remove avahi-daemon, which may cause unwanted discovery packets to be
# sent during tests, near link status changes:
sudo apt-get remove -y avahi-daemon sudo apt-get remove -y avahi-daemon
# Disable IPv6. Add to /etc/modprobe.d/blacklist: # Disable IPv6. Add to /etc/modprobe.d/blacklist:
@@ -153,8 +158,8 @@ function ovs {
if [ "$DIST" = "Debian" ]; then if [ "$DIST" = "Debian" ]; then
sudo aptitude -y install pkg-config gcc make git-core python-dev libssl-dev sudo aptitude -y install pkg-config gcc make git-core python-dev libssl-dev
#Install Autoconf 2.63+ backport from Debian Backports repo: # Install Autoconf 2.63+ backport from Debian Backports repo:
#Instructions from http://backports.org/dokuwiki/doku.php?id=instructions # Instructions from http://backports.org/dokuwiki/doku.php?id=instructions
sudo su -c "echo 'deb http://www.backports.org/debian lenny-backports main contrib non-free' >> /etc/apt/sources.list" 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 update
sudo apt-get -y --force-yes install debian-backports-keyring sudo apt-get -y --force-yes install debian-backports-keyring
@@ -165,7 +170,7 @@ function ovs {
sudo apt-get -y install $KERNEL_HEADERS sudo apt-get -y install $KERNEL_HEADERS
fi fi
#Install OVS from release # Install OVS from release
cd ~/ cd ~/
git clone git://openvswitch.org/openvswitch git clone git://openvswitch.org/openvswitch
cd $OVS_DIR cd $OVS_DIR
@@ -186,8 +191,9 @@ function ovs {
function nox { function nox {
echo "Installing NOX w/tutorial files..." echo "Installing NOX w/tutorial files..."
#Install NOX deps: # Install NOX deps:
sudo apt-get -y install autoconf automake g++ libtool python python-twisted swig libxerces-c2-dev libssl-dev make sudo apt-get -y install autoconf automake g++ libtool python python-twisted \
swig libxerces-c2-dev libssl-dev make
if [ "$DIST" = "Debian" ]; then if [ "$DIST" = "Debian" ]; then
sudo apt-get -y install libboost1.35-dev sudo apt-get -y install libboost1.35-dev
elif [ "$DIST" = "Ubuntu" ]; then elif [ "$DIST" = "Ubuntu" ]; then
@@ -195,10 +201,10 @@ function nox {
sudo apt-get -y install libboost-filesystem-dev sudo apt-get -y install libboost-filesystem-dev
sudo apt-get -y install libboost-test-dev sudo apt-get -y install libboost-test-dev
fi fi
#Install NOX optional deps: # Install NOX optional deps:
sudo apt-get install -y libsqlite3-dev python-simplejson sudo apt-get install -y libsqlite3-dev python-simplejson
#Install NOX: # Install NOX:
cd ~/ cd ~/
git clone git://openflowswitch.org/nox-tutorial noxcore git clone git://openflowswitch.org/nox-tutorial noxcore
cd noxcore cd noxcore
@@ -227,10 +233,10 @@ function nox {
function oftest { function oftest {
echo "Installing oftest..." echo "Installing oftest..."
#Install deps: # Install deps:
sudo apt-get install -y tcpdump python-scapy sudo apt-get install -y tcpdump python-scapy
#Install oftest: # Install oftest:
cd ~/ cd ~/
git clone git://openflow.org/oftest git clone git://openflow.org/oftest
cd oftest cd oftest
@@ -256,25 +262,25 @@ function cbench {
function other { function other {
echo "Doing other setup tasks..." echo "Doing other setup tasks..."
#Enable command auto completion using sudo; modify ~/.bashrc: # Enable command auto completion using sudo; modify ~/.bashrc:
sed -i -e 's|# for examples$|&\ncomplete -cf sudo|' ~/.bashrc sed -i -e 's|# for examples$|&\ncomplete -cf sudo|' ~/.bashrc
#Install tcpdump and tshark, cmd-line packet dump tools. Also install gitk, # Install tcpdump and tshark, cmd-line packet dump tools. Also install gitk,
#a graphical git history viewer. # a graphical git history viewer.
sudo apt-get install -y tcpdump tshark gitk sudo apt-get install -y tcpdump tshark gitk
#Install common text editors # Install common text editors
sudo apt-get install -y vim nano emacs sudo apt-get install -y vim nano emacs
#Install NTP # Install NTP
sudo apt-get install -y ntp sudo apt-get install -y ntp
#Set git to colorize everything. # Set git to colorize everything.
git config --global color.diff auto git config --global color.diff auto
git config --global color.status auto git config --global color.status auto
git config --global color.branch auto git config --global color.branch auto
#Reduce boot screen opt-out delay. Modify timeout in /boot/grub/menu.lst to 1: # Reduce boot screen opt-out delay. Modify timeout in /boot/grub/menu.lst to 1:
if [ "$DIST" = "Debian" ]; then if [ "$DIST" = "Debian" ]; then
sudo sed -i -e 's/^timeout.*$/timeout 1/' /boot/grub/menu.lst sudo sed -i -e 's/^timeout.*$/timeout 1/' /boot/grub/menu.lst
fi fi
@@ -326,7 +332,7 @@ function vm_clean {
history -c # note this won't work if you have multiple bash sessions history -c # note this won't work if you have multiple bash sessions
rm -f ~/.bash_history # need to clear in memory and remove on disk rm -f ~/.bash_history # need to clear in memory and remove on disk
rm -f ~/.ssh/id_rsa* ~/.ssh/known_hosts rm -f ~/.ssh/id_rsa* ~/.ssh/known_hosts
sudo rm -f ~/.ssh/authorized_keys2 sudo rm -f ~/.ssh/authorized_keys*
# Remove Mininet files # Remove Mininet files
#sudo rm -f /lib/modules/python2.5/site-packages/mininet* #sudo rm -f /lib/modules/python2.5/site-packages/mininet*