summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-07-18 13:51:12 -0700
committerBen Pfaff <blp@nicira.com>2011-07-26 10:37:28 -0700
commit9fc47ed759a82391070dfbda0e06592eb0a18391 (patch)
tree6450ed953d2779ebde9a4dbfdc08873b4b315e87 /debian
parent48a695011b3dda6b68e9a07824d649aa6b8eb2ef (diff)
downloadopenvswitch-9fc47ed759a82391070dfbda0e06592eb0a18391.tar.gz
debian: Add support for bridge compatibility.
This adds support for bridge compatibility to the generic Open vSwitch init scripts and to the Debian packaging. See https://bugs.launchpad.net/ubuntu/+source/openvswitch/+bug/808224.
Diffstat (limited to 'debian')
-rw-r--r--debian/.gitignore1
-rw-r--r--debian/automake.mk3
-rw-r--r--debian/control15
-rw-r--r--debian/openvswitch-brcompat.install1
-rw-r--r--debian/openvswitch-brcompat.manpages1
-rwxr-xr-xdebian/openvswitch-brcompat.postinst15
-rwxr-xr-xdebian/openvswitch-switch.init22
-rw-r--r--debian/openvswitch-switch.template4
8 files changed, 57 insertions, 5 deletions
diff --git a/debian/.gitignore b/debian/.gitignore
index b681ee410..7b8dffea3 100644
--- a/debian/.gitignore
+++ b/debian/.gitignore
@@ -6,6 +6,7 @@
/files
/nicira-switch
/openvswitch
+/openvswitch-brcompat
/openvswitch-common
/openvswitch-common.copyright
/openvswitch-controller
diff --git a/debian/automake.mk b/debian/automake.mk
index 26db1cb54..7e166ddca 100644
--- a/debian/automake.mk
+++ b/debian/automake.mk
@@ -6,6 +6,9 @@ EXTRA_DIST += \
debian/copyright \
debian/copyright.in \
debian/dirs \
+ debian/openvswitch-brcompat.install \
+ debian/openvswitch-brcompat.manpages \
+ debian/openvswitch-brcompat.postinst \
debian/openvswitch-common.dirs \
debian/openvswitch-common.install \
debian/openvswitch-common.manpages \
diff --git a/debian/control b/debian/control
index 25f65ce53..1978b73cc 100644
--- a/debian/control
+++ b/debian/control
@@ -81,6 +81,21 @@ Description: Open vSwitch controller implementation
.
Open vSwitch is a full-featured software-based Ethernet switch.
+Package: openvswitch-brcompat
+Architecture: linux-any
+Depends: ${shlibs:Depends}, openvswitch-switch (= ${binary:Version})
+Recommends: bridge-utils
+Description: Open vSwitch bridge compatibility support
+ openvswitch-brcompat provides a way for applications that use the
+ Linux bridge to gradually migrate to Open vSwitch. Programs that
+ ordinarily control the Linux bridge module, such as "brctl", instead
+ control the Open vSwitch kernel-based switch.
+ .
+ Once this package is installed, adding BRCOMPAT=yes in
+ /etc/default/openvswitch-switch enables bridge compatibility.
+ .
+ Open vSwitch is a full-featured software-based Ethernet switch.
+
Package: openvswitch-dbg
Section: debug
Architecture: linux-any
diff --git a/debian/openvswitch-brcompat.install b/debian/openvswitch-brcompat.install
new file mode 100644
index 000000000..fad09f1e5
--- /dev/null
+++ b/debian/openvswitch-brcompat.install
@@ -0,0 +1 @@
+_debian/vswitchd/ovs-brcompatd usr/sbin
diff --git a/debian/openvswitch-brcompat.manpages b/debian/openvswitch-brcompat.manpages
new file mode 100644
index 000000000..2fc0180f0
--- /dev/null
+++ b/debian/openvswitch-brcompat.manpages
@@ -0,0 +1 @@
+_debian/vswitchd/ovs-brcompatd.8
diff --git a/debian/openvswitch-brcompat.postinst b/debian/openvswitch-brcompat.postinst
new file mode 100755
index 000000000..8113e31af
--- /dev/null
+++ b/debian/openvswitch-brcompat.postinst
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# If openvswitch-switch is installed, and then later openvswitch-brcompat is
+# installed, make sure that ovs-brcompatd starts.
+if test X"$1" = Xconfigure && \
+ test -x /etc/init.d/openvswitch-switch && \
+ test -e /var/run/openvswitch/ovs-vswitchd.pid; then
+ invoke-rc.d openvswitch-switch start || exit $?
+fi
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/debian/openvswitch-switch.init b/debian/openvswitch-switch.init
index 36bc20891..a9bf44391 100755
--- a/debian/openvswitch-switch.init
+++ b/debian/openvswitch-switch.init
@@ -25,22 +25,34 @@
(test -x /usr/sbin/ovs-vswitchd && test -x /usr/bin/ovsdb-server) || exit 0
+. /usr/share/openvswitch/scripts/ovs-lib.sh
test -e /etc/default/openvswitch-switch && . /etc/default/openvswitch-switch
-ovs_ctl=/usr/share/openvswitch/scripts/ovs-ctl
+if test X"$BRCOMPAT" = Xyes && test ! -x /usr/sbin/ovs-brcompatd; then
+ BRCOMPAT=no
+ log_warning_msg "ovs-brcompatd missing, disabling bridge compatibility"
+fi
+
+ovs_ctl () {
+ set /usr/share/openvswitch/scripts/ovs-ctl "$@"
+ if test X"$BRCOMPAT" = Xyes; then
+ set "$@" --brcompat
+ fi
+ "$@"
+}
start () {
- set $ovs_ctl ${1-start} --system-id=random
+ set ovs_ctl ${1-start} --system-id=random
if test X"$FORCE_COREFILES" != X; then
set "$@" --force-corefiles="$FORCE_COREFILES"
fi
"$@" || exit $?
- $ovs_ctl --protocol=gre enable-protocol
+ ovs_ctl --protocol=gre enable-protocol
}
stop () {
- $ovs_ctl stop
+ ovs_ctl stop
}
case $1 in
@@ -58,7 +70,7 @@ case $1 in
start
;;
status)
- $ovs_ctl status
+ ovs_ctl status
;;
force-reload-kmod)
start force-reload-kmod
diff --git a/debian/openvswitch-switch.template b/debian/openvswitch-switch.template
index 70ca53e80..46816eaab 100644
--- a/debian/openvswitch-switch.template
+++ b/debian/openvswitch-switch.template
@@ -2,3 +2,7 @@
# FORCE_COREFILES: If 'yes' then core files will be enabled.
# FORCE_COREFILES=yes
+
+# BRCOMPAT: If 'yes' and the openvswitch-brcompat package is installed, then
+# Linux bridge compatibility will be enabled.
+# BRCOMPAT=no