Skip to content

Commit

Permalink
Add RHEL 5/6 spec files and instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
blp committed Jun 21, 2011
1 parent e5b6e3a commit c434706
Show file tree
Hide file tree
Showing 12 changed files with 792 additions and 4 deletions.
61 changes: 61 additions & 0 deletions INSTALL.RHEL
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
How to Install Open vSwitch on Red Hat Enterprise Linux
=======================================================

This document describes how to build and install Open vSwitch on a Red
Hat Enterprise Linux (RHEL) host. If you want to install Open vSwitch
on a generic Linux host, see INSTALL.Linux instead.

We have tested these instructions with RHEL 5.6 and RHEL 6.0.

Building Open vSwitch for RHEL
------------------------------

You may build from an Open vSwitch distribution tarball or from an
Open vSwitch Git tree.

Before you begin, note the RPM source directory on your version of
RHEL. On RHEL 5, the default RPM source directory is
/usr/src/redhat/SOURCES. On RHEL 6, it is $HOME/rpmbuild/SOURCES.

1. If you are building from an Open vSwitch Git tree, then you will
need to first create a distribution tarball by running "./boot.sh;
./configure; make dist" in the Git tree.

2. Copy the distribution tarball into the RPM source directory.

3. Unpack the distribution tarball into a temporary directory and "cd"
into the root of the distribution tarball.

4. To build Open vSwitch userspace, run:

rpmbuild -bb rhel/openvswitch.spec

This produces two RPMs: "openvswitch" and "openvswitch-debuginfo".

5a. On RHEL 5, to build the Open vSwitch kernel module, copy
rhel/kmodtool-openvswitch-el5.sh into the RPM source directory and
run:

rpmbuild -bb --target=i686-unknown-linux \
rhel/openvswitch-kmod-rhel5.spec

You might have to specify a kernel version, e.g.:

rpmbuild -bb -D "kversion 2.6.18-238.12.1.el5" \
--target=i686-unknown-linux \
rhel/openvswitch-kmod-rhel5.spec

This produces a "kmod-openvswitch" RPM for each kernel variant,
which is usually: "kmod-openvswitch", "kmod-openvswitch-xen", and
"kmod-openvswitch-PAE".

5b. On RHEL 6, to build the Open vSwitch kernel module, run:

rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec

This produces an "kmod-openvswitch" RPM.

Reporting Bugs
--------------

Please report problems to [email protected].
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ EXTRA_DIST = \
DESIGN \
INSTALL.KVM \
INSTALL.Linux \
INSTALL.RHEL \
INSTALL.SSL \
INSTALL.XenServer \
INSTALL.bridge \
Expand Down Expand Up @@ -157,5 +158,6 @@ include third-party/automake.mk
include debian/automake.mk
include vswitchd/automake.mk
include ovsdb/automake.mk
include rhel/automake.mk
include xenserver/automake.mk
include python/ovs/automake.mk
13 changes: 9 additions & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ vSwitch supports the following features:

The included Linux kernel module supports Linux 2.6.18 and up, with
testing focused on 2.6.32 with Centos and Xen patches. Open vSwitch
also has special support for Citrix XenServer hosts.
also has special support for Citrix XenServer and Red Hat Enterprise
Linux hosts.

Open vSwitch can also operate, at a cost in performance, entirely in
userspace, without assistance from a kernel module. This userspace
Expand All @@ -58,9 +59,10 @@ The main components of this distribution are:

* ovs-dpctl, a tool for configuring the switch kernel module.

* Scripts and specs for building RPMs that allow Open vSwitch
to be installed on a Citrix XenServer host as a drop-in
replacement for its switch, with additional functionality.
* Scripts and specs for building RPMs for Citrix XenServer and Red
Hat Enterprise Linux. The XenServer RPMs allow Open vSwitch to
be installed on a Citrix XenServer host as a drop-in replacement
for its switch, with additional functionality.

* ovs-vsctl, a utility for querying and updating the configuration
of ovs-vswitchd.
Expand Down Expand Up @@ -94,6 +96,9 @@ read INSTALL.bridge.
To build RPMs for installing Open vSwitch on a Citrix XenServer host
or resource pool, read INSTALL.XenServer.

To build RPMs for installing Open vSwitch on a Red Hat Enterprise
Linux host, read INSTALL.RHEL.

To use Open vSwitch with KVM on Linux, read INSTALL.Linux, then
INSTALL.KVM.

Expand Down
3 changes: 3 additions & 0 deletions rhel/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
openvswitch-kmod-rhel5.spec
openvswitch-kmod-rhel6.spec
openvswitch.spec
30 changes: 30 additions & 0 deletions rhel/automake.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (C) 2009, 2010, 2011 Nicira Networks, Inc.
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without warranty of any kind.

EXTRA_DIST += \
rhel/automake.mk \
rhel/etc_init.d_openvswitch \
rhel/etc_logrotate.d_openvswitch \
rhel/kmodtool-openvswitch-el5.sh \
rhel/openvswitch-kmod-rhel5.spec \
rhel/openvswitch-kmod-rhel5.spec.in \
rhel/openvswitch-kmod-rhel6.spec \
rhel/openvswitch-kmod-rhel6.spec.in \
rhel/openvswitch.spec \
rhel/openvswitch.spec.in \
rhel/usr_share_openvswitch_scripts_sysconfig.template


$(srcdir)/rhel/openvswitch-kmod-rhel5.spec: rhel/openvswitch-kmod-rhel5.spec.in $(top_builddir)/config.status
sed -e 's,[@]VERSION[@],$(VERSION),g' < $< > $@

$(srcdir)/rhel/openvswitch-kmod-rhel6.spec: rhel/openvswitch-kmod-rhel6.spec.in $(top_builddir)/config.status

sed -e 's,[@]VERSION[@],$(VERSION),g' < $< > $@

$(srcdir)/rhel/openvswitch.spec: rhel/openvswitch.spec.in $(top_builddir)/config.status
sed -e 's,[@]VERSION[@],$(VERSION),g' < $< > $@
96 changes: 96 additions & 0 deletions rhel/etc_init.d_openvswitch
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#!/bin/sh
#
# openvswitch
#
# chkconfig: 2345 09 91
# description: Manage Open vSwitch kernel modules and user-space daemons

# Copyright (C) 2009, 2010, 2011 Nicira Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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-switch
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Open vSwitch switch
### END INIT INFO

. /usr/share/openvswitch/scripts/ovs-lib.sh || exit 1
test -e /etc/sysconfig/openvswitch && . /etc/sysconfig/openvswitch

start () {
# Allow GRE traffic.
/sbin/iptables -I INPUT -p gre -j ACCEPT

set $ovs_ctl ${1-start}
set "$@" --system-id=random
if test X"$FORCE_COREFILES" != X; then
set "$@" --force-corefiles="$FORCE_COREFILES"
fi
if test X"$OVSDB_SERVER_PRIORITY" != X; then
set "$@" --ovsdb-server-priority="$OVSDB_SERVER_PRIORITY"
fi
if test X"$VSWITCHD_PRIORITY" != X; then
set "$@" --ovs-vswitchd-priority="$VSWITCHD_PRIORITY"
fi
if test X"$VSWITCHD_MLOCKALL" != X; then
set "$@" --mlockall="$VSWITCHD_MLOCKALL"
fi
if test ! -e /var/run/openvswitch.booted; then
touch /var/run/openvswitch.booted
set "$@" --delete-bridges
fi
"$@"

touch /var/lock/subsys/openvswitch
}

stop () {
$ovs_ctl stop
rm -f /var/lock/subsys/openvswitch
}

ovs_ctl=/usr/share/openvswitch/scripts/ovs-ctl
case $1 in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
reload|force-reload)
# Nothing to do.
;;
status)
$ovs_ctl status
;;
version)
$ovs_ctl version
;;
force-reload-kmod)
start force-reload-kmod
;;
help)
printf "$0 [start|stop|restart|reload|force-reload|status|version|force-reload-kmod]\n"
;;
*)
printf "Unknown command: $1\n"
exit 1
;;
esac
20 changes: 20 additions & 0 deletions rhel/etc_logrotate.d_openvswitch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (C) 2009, 2010, 2011 Nicira Networks, Inc.
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without warranty of any kind.

/var/log/openvswitch/*.log {
sharedscripts
missingok
postrotate
# Tell Open vSwitch daemons to reopen their log files
if [ -e /var/run/openvswitch/ovs-vswitchd.pid ]; then
/usr/bin/ovs-appctl -t ovs-vswitchd vlog/reopen
fi
if [ -e /var/run/openvswitch/ovsdb-server.pid ]; then
/usr/bin/ovs-appctl -t ovsdb-server vlog/reopen
fi
endscript
}
Loading

0 comments on commit c434706

Please sign in to comment.