Version that hopefully will work on Ubuntu with an ext3 root FS.
This commit is contained in:
+40
-9
@@ -17,12 +17,12 @@ KERNEL_NAME=2.6.33.1-mininet
|
|||||||
#KERNEL_NAME=`uname -r`
|
#KERNEL_NAME=`uname -r`
|
||||||
KERNEL_HEADERS=linux-headers-${KERNEL_NAME}_${KERNEL_NAME}-10.00.Custom_i386.deb
|
KERNEL_HEADERS=linux-headers-${KERNEL_NAME}_${KERNEL_NAME}-10.00.Custom_i386.deb
|
||||||
KERNEL_IMAGE=linux-image-${KERNEL_NAME}_${KERNEL_NAME}-10.00.Custom_i386.deb
|
KERNEL_IMAGE=linux-image-${KERNEL_NAME}_${KERNEL_NAME}-10.00.Custom_i386.deb
|
||||||
DIST=UBUNTU # Assume Ubuntu, not debian Lenny
|
DIST=`lsb_release -is`
|
||||||
|
|
||||||
# Kernel Deb pkg to be removed:
|
# Kernel Deb pkg to be removed:
|
||||||
KERNEL_IMAGE_OLD=linux-image-2.6.26-2-686
|
KERNEL_IMAGE_OLD=linux-image-2.6.26-2-686
|
||||||
|
|
||||||
DRIVERS_DIR=/lib/modules/${KERNEL_NAME}/kernel/drivers
|
DRIVERS_DIR=/lib/modules/${KERNEL_NAME}/kernel/drivers/net
|
||||||
|
|
||||||
#OVS_RELEASE=openvswitch-1.0.1
|
#OVS_RELEASE=openvswitch-1.0.1
|
||||||
OVS_RELEASE=openvswitch # release 1.0.1 doesn't work with veth pairs.
|
OVS_RELEASE=openvswitch # release 1.0.1 doesn't work with veth pairs.
|
||||||
@@ -33,6 +33,13 @@ function kernel {
|
|||||||
echo "Install new kernel..."
|
echo "Install new kernel..."
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
|
|
||||||
|
# Until we build ext4 into our kernel image
|
||||||
|
ext2=`mount | head -1 | egrep 'ext2|ext3'`
|
||||||
|
if [ "$ext2" == "" ]; then
|
||||||
|
echo "Kernel package requires ext2 or ext3 root filesystem"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# The easy approach: download pre-built linux-image and linux-headers packages:
|
# The easy approach: download pre-built linux-image and linux-headers packages:
|
||||||
wget -c $KERNEL_LOC/$KERNEL_HEADERS
|
wget -c $KERNEL_LOC/$KERNEL_HEADERS
|
||||||
wget -c $KERNEL_LOC/$KERNEL_IMAGE
|
wget -c $KERNEL_LOC/$KERNEL_IMAGE
|
||||||
@@ -118,7 +125,7 @@ function of {
|
|||||||
function ovs {
|
function ovs {
|
||||||
echo "Installing OpenVSwitch..."
|
echo "Installing OpenVSwitch..."
|
||||||
|
|
||||||
if [ "$DIST" = "LENNY" ]; then
|
if [ "$DIST" = "Debian" ]; then
|
||||||
#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"
|
||||||
@@ -149,10 +156,12 @@ function nox {
|
|||||||
|
|
||||||
#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" == "LENNY" ]; then
|
if [ "$DIST" == "Debian" ]; then
|
||||||
sudo apt-get -y install libboost1.35-dev
|
sudo apt-get -y install libboost1.35-dev
|
||||||
else
|
elif [ "$DIST" == "Ubuntu" ]; then
|
||||||
sudo apt-get -y install libboost1.40-dev
|
sudo apt-get -y install python-dev libboost-dev
|
||||||
|
sudo apt-get -y install libboost-filesystem-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
|
||||||
@@ -164,8 +173,10 @@ function nox {
|
|||||||
|
|
||||||
# With later autoconf versions this doesn't quite work:
|
# With later autoconf versions this doesn't quite work:
|
||||||
./boot.sh --apps-core || true
|
./boot.sh --apps-core || true
|
||||||
|
if [ "$DIST" == "Debian" ]; then
|
||||||
# So use this instead:
|
# So use this instead:
|
||||||
autoreconf --install --force
|
autoreconf --install --force
|
||||||
|
fi
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
../configure --with-python=yes
|
../configure --with-python=yes
|
||||||
@@ -275,7 +286,7 @@ function vm_clean {
|
|||||||
|
|
||||||
# Remove sensistive files
|
# Remove sensistive files
|
||||||
history -c
|
history -c
|
||||||
rm ~/.bash_history # history -c doesn't seem to work for some reason
|
rm ~/.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 ~/.ssh/authorized_keys2
|
sudo rm ~/.ssh/authorized_keys2
|
||||||
|
|
||||||
@@ -295,6 +306,27 @@ function vm_clean {
|
|||||||
|
|
||||||
function usage {
|
function usage {
|
||||||
printf "Usage: %s: [-acdfhkmntvxy] args\n" $(basename $0) >&2
|
printf "Usage: %s: [-acdfhkmntvxy] args\n" $(basename $0) >&2
|
||||||
|
|
||||||
|
printf "This install script attempts to install useful packages\n" >&2
|
||||||
|
printf "for Mininet. It should (hopefully) work on Ubuntu 10.04 and\n" >&2
|
||||||
|
printf "Debian 5.0 (Lenny). If you run into trouble, try\n" >&2
|
||||||
|
printf "installing one thing at a time, and looking at the \n" >&2
|
||||||
|
printf "specific installation function in this script.\n" >&2
|
||||||
|
|
||||||
|
printf "\noptions:\n" >&2
|
||||||
|
printf "-a: install (A)ll packages - good luck!\n" >&2
|
||||||
|
printf "-c: (C)lean up after kernel install\n" >&2
|
||||||
|
printf "-d: (D)elete some sensitive files from a VM image\n" >&2
|
||||||
|
printf "-f: install open(F)low\n" >&2
|
||||||
|
printf "-h: print this (H)elp message\n" >&2
|
||||||
|
printf "-k: install new (K)ernel\n" >&2
|
||||||
|
printf "-m: install Open vSwitch kernel (M)odule\n" >&2
|
||||||
|
printf "-n: install mini(N)et dependencies\nn" >&2
|
||||||
|
printf "-t: install o(T)her stuff\n" >&2
|
||||||
|
printf "-v: install open (V)switch\n" >&2
|
||||||
|
printf "-x: install NOX(X) OpenFlow contoller\n" >&2
|
||||||
|
printf "-y: install (A)ll packages\n" >&2
|
||||||
|
|
||||||
exit 2
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,10 +339,9 @@ if [ $# -eq 0 ]
|
|||||||
then
|
then
|
||||||
all
|
all
|
||||||
else
|
else
|
||||||
while getopts 'lacdfhkmntvx' OPTION
|
while getopts 'acdfhkmntvx' OPTION
|
||||||
do
|
do
|
||||||
case $OPTION in
|
case $OPTION in
|
||||||
l) lenny;;
|
|
||||||
a) all;;
|
a) all;;
|
||||||
c) kernel_clean;;
|
c) kernel_clean;;
|
||||||
d) vm_clean;;
|
d) vm_clean;;
|
||||||
|
|||||||
Reference in New Issue
Block a user