From 15f2d240d67c680365a3afae40b1141757e21fab Mon Sep 17 00:00:00 2001 From: Jose Pedro Oliveira Date: Thu, 22 Aug 2013 00:47:30 +0100 Subject: [PATCH 1/4] Make install.sh support Fedora 19 (install.sh -n) --- util/install.sh | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/util/install.sh b/util/install.sh index 4873a8e..1714206 100755 --- a/util/install.sh +++ b/util/install.sh @@ -47,6 +47,19 @@ if [ "$DIST" = "Ubuntu" ] || [ "$DIST" = "Debian" ]; then $install bc fi fi +test -e /etc/fedora-release && DIST="Fedora" +if [ "$DIST" = "Fedora" ]; then + install='sudo yum -y install' + remove='sudo yum -y erase' + pkginst='sudo rpm -ivh' + # Prereqs for this script + if ! which lsb_release &> /dev/null; then + $install redhat-lsb-core + fi + if ! which bc &> /dev/null; then + $install bc + fi +fi if which lsb_release &> /dev/null; then DIST=`lsb_release -is` RELEASE=`lsb_release -rs` @@ -67,8 +80,11 @@ elif [ "$DIST" = "Debian" ] && [ "$ARCH" = "i386" ] && [ "$CODENAME" = "lenny" ] KERNEL_NAME=2.6.33.1-mininet 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 +elif [ "$DIST" = "Fedora" ]; then + KERNEL_NAME=`uname -r` + KERNEL_HEADERS=kernel-headers-${KERNEL_NAME} else - echo "Install.sh currently only supports Ubuntu and Debian Lenny i386." + echo "Install.sh currently only supports Ubuntu, Debian Lenny i386 and Fedora." exit 1 fi @@ -140,9 +156,15 @@ function kernel_clean { # Install Mininet deps function mn_deps { echo "Installing Mininet dependencies" - $install gcc make socat psmisc xterm ssh iperf iproute telnet \ - python-setuptools cgroup-bin ethtool help2man \ - pyflakes pylint pep8 + if [ "$DIST" = "Fedora" ]; then + $install gcc make socat psmisc xterm openssh-clients iperf \ + iproute telnet python-setuptools libcgroup-tools \ + ethtool help2man pyflakes pylint python-pep8 + else + $install gcc make socat psmisc xterm ssh iperf iproute telnet \ + python-setuptools cgroup-bin ethtool help2man \ + pyflakes pylint pep8 + fi echo "Installing Mininet core" pushd $MININET_DIR/mininet From 3d89df13efb4493560e51d48531e9ba37e8d2285 Mon Sep 17 00:00:00 2001 From: Jose Pedro Oliveira Date: Thu, 22 Aug 2013 00:57:14 +0100 Subject: [PATCH 2/4] Handle Fedora's telnet output: ---------- *** c0 : ('echo A | telnet -e A 127.0.0.1 6633',) telnet: connect to address 127.0.0.1: Connection refused Telnet escape character is 'A'. Trying 127.0.0.1... Unable to contact the remote controller at 127.0.0.1:6633 ---------- --- mininet/node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mininet/node.py b/mininet/node.py index 3185746..a737845 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -1140,7 +1140,7 @@ class Controller( Node ): "installed." ) listening = self.cmd( "echo A | telnet -e A %s %d" % ( self.ip, self.port ) ) - if 'Unable' not in listening: + if 'refused' not in listening: servers = self.cmd( 'netstat -atp' ).split( '\n' ) pstr = ':%d ' % self.port clist = servers[ 0:1 ] + [ s for s in servers if pstr in s ] @@ -1235,6 +1235,6 @@ class RemoteController( Controller ): "Warn if remote controller is not accessible" listening = self.cmd( "echo A | telnet -e A %s %d" % ( self.ip, self.port ) ) - if 'Unable' in listening: + if 'refused' in listening: warn( "Unable to contact the remote controller" " at %s:%d\n" % ( self.ip, self.port ) ) From 6cb05c37626a2bf99f9973f3dc695e89067e135c Mon Sep 17 00:00:00 2001 From: Jose Pedro Oliveira Date: Thu, 22 Aug 2013 17:42:17 +0100 Subject: [PATCH 3/4] Make options -f and -b work in Fedora 19 --- util/install.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/util/install.sh b/util/install.sh index 1714206..9091dc2 100755 --- a/util/install.sh +++ b/util/install.sh @@ -186,8 +186,12 @@ function mn_dev { function of { echo "Installing OpenFlow reference implementation..." cd $BUILD_DIR/ - $install git-core autoconf automake autotools-dev pkg-config \ - make gcc libtool libc6-dev + $install autoconf automake libtool make gcc + if [ "$DIST" = "Fedora" ]; then + $install git pkgconfig glibc-devel + else + $install git-core autotools-dev pkg-config libc6-dev + fi git clone git://openflowswitch.org/openflow.git cd $BUILD_DIR/openflow @@ -537,7 +541,11 @@ function oftest { function cbench { echo "Installing cbench..." - $install libsnmp-dev libpcap-dev libconfig-dev + if [ "$DIST" = "Fedora" ]; then + $install net-snmp-devel libpcap-devel libconfig-devel + else + $install libsnmp-dev libpcap-dev libconfig-dev + fi cd $BUILD_DIR/ git clone git://openflow.org/oflops.git cd oflops From 5b08af2e8d69ce0a4cc9ce48eae9b19fe088c714 Mon Sep 17 00:00:00 2001 From: Jose Pedro Oliveira Date: Thu, 22 Aug 2013 18:13:31 +0100 Subject: [PATCH 4/4] Add a small notice about the Fedora's support. --- util/install.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/util/install.sh b/util/install.sh index 9091dc2..02f146f 100755 --- a/util/install.sh +++ b/util/install.sh @@ -637,6 +637,14 @@ function modprobe { } function all { + if [ "$DIST" = "Fedora" ]; then + printf "\nFedora 19 support status:\n" + printf "the install script options -b, -f, -n, and -p should work.\n\n" + printf "Just try:\n" + printf " install.sh -fnp\n" + printf "with Fedora's kernel (3.10) and openvswitch (1.10.0) packages.\n" + exit 3 + fi echo "Running all commands..." kernel mn_deps