SHA256
1
0
forked from pool/openvswitch
openvswitch/ovs-suse.patch

158 lines
5.0 KiB
Diff

From: Patrick Mullaney <pm.mullaney@gmail.com>
---
xenserver/etc_init.d_openvswitch | 87 +++++++++++++++-----------
xenserver/etc_init.d_openvswitch-xapi-update | 9 +++
2 files changed, 59 insertions(+), 37 deletions(-)
diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch
index 5f18196..ad3fc11 100755
--- a/xenserver/etc_init.d_openvswitch
+++ b/xenserver/etc_init.d_openvswitch
@@ -18,35 +18,46 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+### BEGIN INIT INFO
+# Provides: vswitch
+# Required-Start: $local_fs
+# Required-Stop: $local_fs
+# Default-Start: 2 3 5
+# Default-Stop:
+# Short-Description: vswitch
+# Description: virtual switch
+### END INIT INFO
+
+#. /etc/init.d/functions
+# source function library
+if [ -f /etc/init.d/functions ]; then
+ . /etc/init.d/functions
+elif [ -f /etc/rc.d/init.d/functions ]; then
+ . /etc/rc.d/init.d/functions
+elif [ -f /lib/lsb/init-functions ]; then
+ . /lib/lsb/init-functions
+else
+ exit 0
+fi
-. /etc/init.d/functions
+# Ugh, SUSE doesn't implement action
+action() {
+ STRING=$1
+ shift
+ "$@"
+ rc=$?
+ if [ $rc -eq 0 ] ; then
+ log_success_msg $"$STRING "
+ else
+ log_failure_msg $"$STRING "
+ fi
+ return $rc
+}
-. /etc/xensource-inventory
test -e /etc/sysconfig/openvswitch && . /etc/sysconfig/openvswitch
-NETWORK_MODE=$(cat /etc/xensource/network.conf)
-case $NETWORK_MODE in
- vswitch|openvswitch)
- ;;
- bridge)
- exit 0
- ;;
- *)
- echo "Open vSwitch disabled (/etc/xensource/network.conf is invalid)" >&2
- exit 0
- ;;
-esac
-
-# General config variables in /etc/sysconfig/openvswitch
-if test "$PRODUCT_VERSION" = "5.5.0"; then
- # XenServer 5.5.0 needs ovs-brcompatd and /proc/net simulation.
- : ${ENABLE_BRCOMPAT:=y}
- : ${ENABLE_FAKE_PROC_NET:=y}
-else
- # Later versions don't need them.
- : ${ENABLE_BRCOMPAT:=n}
- : ${ENABLE_FAKE_PROC_NET:=n}
-fi
+: ${ENABLE_BRCOMPAT:=y}
+: ${ENABLE_FAKE_PROC_NET:=y}
: ${ENABLE_MONITOR:=y}
: ${FORCE_COREFILES:=y}
@@ -228,7 +239,7 @@ function start_ovsdb_server {
for remote in $OVSDB_SERVER_REMOTES; do
set -- "$@" --remote="$remote"
done
- set -- "$@" --private-key=db:SSL,private_key --certificate=db:SSL,certificate --bootstrap-ca-cert=db:SSL,ca_cert
+ #set -- "$@" --private-key=db:SSL,private_key --certificate=db:SSL,certificate --bootstrap-ca-cert=db:SSL,ca_cert
start_daemon OVSDB_SERVER "$@"
}
@@ -297,16 +308,18 @@ EOF
}
function set_system_ids {
- if [ -f /etc/xensource-inventory ]; then
- action "Configuring Open vSwitch system IDs" true
- $vsctl --no-wait --timeout=5 set Open_vSwitch . \
- external-ids:system-type="$PRODUCT_BRAND" \
- external-ids:system-version="$PRODUCT_VERSION-$BUILD_NUMBER" \
- external-ids:system-id="$INSTALLATION_UUID" \
- external-ids:xs-system-uuid="$INSTALLATION_UUID"
+ if [ -f /etc/openvswitch/install_uuid.conf ]; then
+ . /etc/openvswitch/install_uuid.conf
else
- action "Configuring Open vSwitch system IDs" false
+ INSTALLATION_UUID=`uuidgen`
+ echo "INSTALLATION_UUID=$INSTALLATION_UUID" > /etc/openvswitch/install_uuid.conf
fi
+ action "Configuring Open vSwitch system IDs" true
+# external-ids:system-type="$PRODUCT_BRAND" \
+# external-ids:system-version="$PRODUCT_VERSION-$BUILD_NUMBER" \
+ $vsctl --no-wait --timeout=5 set Open_vSwitch . \
+ external-ids:system-id="$INSTALLATION_UUID" \
+ external-ids:xs-system-uuid="$INSTALLATION_UUID"
}
function start {
@@ -351,9 +364,9 @@ function start {
fi
# Start daemon to monitor external ids
- PYTHONPATH=/usr/share/openvswitch/python \
- /usr/share/openvswitch/scripts/ovs-external-ids \
- --pidfile --detach $monitor_opt "$VSWITCHD_OVSDB_SERVER"
+# PYTHONPATH=/usr/share/openvswitch/python \
+# /usr/share/openvswitch/scripts/ovs-external-ids \
+# --pidfile --detach $monitor_opt "$VSWITCHD_OVSDB_SERVER"
touch /var/lock/subsys/openvswitch
}
diff --git a/xenserver/etc_init.d_openvswitch-xapi-update b/xenserver/etc_init.d_openvswitch-xapi-update
index bc62ba2..e2e8e98 100755
--- a/xenserver/etc_init.d_openvswitch-xapi-update
+++ b/xenserver/etc_init.d_openvswitch-xapi-update
@@ -18,6 +18,15 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+### BEGIN INIT INFO
+# Provides: openvswitch-api-update
+# Required-Start: $network $remote_fs
+# Required-Stop: $network
+# Default-Start: 3 5
+# Default-Stop:
+# Short-Description: openvswitch-api-update
+# Description: virtual switch-api-update
+### END INIT INFO
. /etc/init.d/functions