diff --git a/util/install.sh b/util/install.sh index 6aa6960..f295803 100755 --- a/util/install.sh +++ b/util/install.sh @@ -264,6 +264,64 @@ function wireshark { } +# Install Open vSwitch specific version Ubuntu package +function ubuntuOvs { + echo "Creating and Installing Open vSwitch packages..." + + OVS_SRC=$BUILD_DIR/openvswitch + OVS_TARBALL_LOC=http://openvswitch.org/releases + + if [ "$DIST" = "Ubuntu" ] && [ `expr $RELEASE '>=' 12.04` = 1 ]; then + rm -rf $OVS_SRC + mkdir -p $OVS_SRC + cd $OVS_SRC + + if wget $OVS_TARBALL_LOC/openvswitch-$OVS_RELEASE.tar.gz 2> /dev/null; then + tar xzf openvswitch-$OVS_RELEASE.tar.gz + else + echo "Failed to find OVS at $OVS_TARBALL_LOC/openvswitch-$OVS_RELEASE.tar.gz" + cd $BUILD_DIR + return + fi + + # Remove any old packages + $remove openvswitch-common openvswitch-datapath-dkms openvswitch-controller \ + openvswitch-pki openvswitch-switch + + # Get build deps + $install build-essential fakeroot debhelper autoconf automake libssl-dev \ + pkg-config bzip2 openssl python-all procps python-qt4 \ + python-zopeinterface python-twisted-conch dkms + + # Build OVS + cd $BUILD_DIR/openvswitch/openvswitch-$OVS_RELEASE + DEB_BUILD_OPTIONS='parallel=2 nocheck' fakeroot debian/rules binary + cd .. + $pkginst openvswitch-common_$OVS_RELEASE*.deb openvswitch-datapath-dkms_$OVS_RELEASE*.deb \ + openvswitch-pki_$OVS_RELEASE*.deb openvswitch-switch_$OVS_RELEASE*.deb + if $pkginst openvswitch-controller_$OVS_RELEASE*.deb; then + echo "Ignoring error installing openvswitch-controller" + fi + + modinfo openvswitch + sudo ovs-vsctl show + # Switch can run on its own, but + # Mininet should control the controller + # This appears to only be an issue on Ubuntu/Debian + if sudo service openvswitch-controller stop; then + echo "Stopped running controller" + fi + if [ -e /etc/init.d/openvswitch-controller ]; then + sudo update-rc.d openvswitch-controller disable + fi + else + echo "Failed to install Open vSwitch. OS must be Ubuntu >= 12.04" + cd $BUILD_DIR + return + fi +} + + # Install Open vSwitch function ovs { @@ -596,7 +654,7 @@ function vm_clean { } function usage { - printf '\nUsage: %s [-abcdfhikmnprtvwx03]\n\n' $(basename $0) >&2 + printf '\nUsage: %s [-abcdfhikmnprtvVwx03]\n\n' $(basename $0) >&2 printf 'This install script attempts to install useful packages\n' >&2 printf 'for Mininet. It should (hopefully) work on Ubuntu 11.10+\n' >&2 @@ -621,6 +679,7 @@ function usage { printf -- ' -s