]> git.proxmox.com Git - mirror_ovs.git/blame - INSTALL.RHEL.rst
ovn-sbctl: document logging and common options in man page
[mirror_ovs.git] / INSTALL.RHEL.rst
CommitLineData
5361570f
SF
1..
2 Licensed under the Apache License, Version 2.0 (the "License"); you may
3 not use this file except in compliance with the License. You may obtain
4 a copy of the License at
5
6 http://www.apache.org/licenses/LICENSE-2.0
7
8 Unless required by applicable law or agreed to in writing, software
9 distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 License for the specific language governing permissions and limitations
12 under the License.
13
14 Convention for heading levels in Open vSwitch documentation:
15
16 ======= Heading 0 (reserved for the title in a document)
17 ------- Heading 1
18 ~~~~~~~ Heading 2
19 +++++++ Heading 3
20 ''''''' Heading 4
21
22 Avoid deeper levels because they do not render well.
23
24========================================
25Open vSwitch on Red Hat Enterprise Linux
26========================================
27
28This document describes how to build and install Open vSwitch on a Red Hat
29Enterprise Linux (RHEL) host. If you want to install Open vSwitch on a generic
30Linux host, see the `general installation guide <INSTALL.rst>`__ instead.
31
32We have tested these instructions with RHEL 5.6 and RHEL 6.0.
33
34For RHEL 7.x (or derivatives, such as CentOS 7.x), you should follow the
35instructions in the `Fedora installation guide <INSTALL.Fedora.rst>`__. The
36Fedora spec files are used for RHEL 7.x.
37
38Prerequisites
39-------------
40
41You may build from an Open vSwitch distribution tarball or from an Open vSwitch
42Git tree.
43
44The default RPM build directory, ``_topdir``, has five directories in the
45top-level.
46
47BUILD/
48 where the software is unpacked and built
49RPMS/
50 where the newly created binary package files are written
51SOURCES/
52 contains the original sources, patches, and icon files
53SPECS/
54 contains the spec files for each package to be built
55SRPMS/
56 where the newly created source package files are written
57
58Before you begin, note the RPM sources directory on your version of RHEL. The
59command ``rpmbuild --showrc`` will show the configuration for each of those
60directories. Alternatively, the command ``rpm --eval '%{_topdir}'`` shows the
61current configuration for the top level directory and the command ``rpm --eval
62'%{_sourcedir}'`` does the same for the sources directory. On RHEL 5, the
63default RPM ``_topdir`` is ``/usr/src/redhat`` and the default RPM sources
64directory is ``/usr/src/redhat/SOURCES``. On RHEL 6, the default ``_topdir`` is
65``$HOME/rpmbuild`` and the default RPM sources directory is
66``$HOME/rpmbuild/SOURCES``.
67
68Build Requirements
69------------------
70
71To compile the RPMs, you will need to install the packages described in the
72`general installation guide <INSTALL.rst>`__ along with some additional
73packages. These can be installed with the below command::
74
75 $ yum install gcc make python-devel openssl-devel kernel-devel graphviz \
76 kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \
77 libtool
78
79Bootstrapping and Configuring
80-----------------------------
81
82If you are building from a distribution tarball, skip to *Building*. If not,
83you must be building from an Open vSwitch Git tree. Determine what version of
84Autoconf is installed (e.g. run ``autoconf --version``). If it is not at least
85version 2.63, then you must upgrade or use another machine to build the
86packages.
87
88Assuming all requirements have been met, build the tarball by running::
89
90 $ ./boot.sh
91 $ ./configure
92 $ make dist
93
94You must run this on a machine that has the tools listed in the `general
95installation guide <INSTALL.rst>`__ as prerequisites for building from a Git
96tree. Afterward, proceed with the rest of the instructions using the
97distribution tarball.
98
99Now you have a distribution tarball, named something like
100``openvswitch-x.y.z.tar.gz``. Copy this file into the RPM sources directory,
101e.g.::
102
103 $ cp openvswitch-x.y.z.tar.gz $HOME/rpmbuild/SOURCES
104
105Broken ``build`` symlink
106~~~~~~~~~~~~~~~~~~~~~~~~
107
108Some versions of the RHEL 6 kernel-devel package contain a broken ``build``
109symlink. If you are using such a version, you must fix the problem before
110continuing.
111
112To find out whether you are affected, run::
113
114 $ cd /lib/modules/<version>
115 $ ls -l build/
116
117where ``<version>`` is the version number of the RHEL 6 kernel.
118
119.. note::
120 The trailing slash in the final command is important. Be sure to include
121 it.
122
123If the ``ls`` command produces a directory listing, your kernel-devel package
124is OK. If it produces a ``No such file or directory`` error, your kernel-devel
125package is buggy.
126
127If your kernel-devel package is buggy, then you can fix it with::
128
129 $ cd /lib/modules/<version>
130 $ rm build
131 $ ln -s /usr/src/kernels/<target> build
132
133where ``<target>`` is the name of an existing directory under
134``/usr/src/kernels``, whose name should be similar to ``<version>`` but may
135contain some extra parts. Once you have done this, verify the fix with the
136same procedure you used above to check for the problem.
137
138Building
139--------
140
141You should have a distribution tarball named something like
142openvswitch-x.y.z.tar.gz. Copy this file into the RPM sources directory::
143
144 $ cp openvswitch-x.y.z.tar.gz $HOME/rpmbuild/SOURCES
145
146Make another copy of the distribution tarball in a temporary directory. Then
147unpack the tarball and ``cd`` into its root::
148
149 $ tar xzf openvswitch-x.y.z.tar.gz
150 $ cd openvswitch-x.y.z
151
152Userspace
153~~~~~~~~~
154
155To build Open vSwitch userspace, run::
156
157 $ rpmbuild -bb rhel/openvswitch.spec
158
159This produces two RPMs: "openvswitch" and "openvswitch-debuginfo".
160
161The above command automatically runs the Open vSwitch unit tests. To disable
162the unit tests, run::
163
164 $ rpmbuild -bb --without check rhel/openvswitch.spec
165
166.. note::
167 If the build fails with ``configure: error: source dir
168 /lib/modules/2.6.32-279.el6.x86_64/build doesn't exist`` or similar, then
169 the kernel-devel package is missing or buggy.
170
171Kernel Module
172~~~~~~~~~~~~~
173
174On RHEL 6, to build the Open vSwitch kernel module, copy
175rhel/openvswitch-kmod.files into the RPM sources directory and run::
176
177 $ rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec
178
179You might have to specify a kernel version and/or variants, e.g.:
180
181 $ rpmbuild -bb \
182 -D "kversion 2.6.32-131.6.1.el6.x86_64" \
183 -D "kflavors default debug kdump" \
184 rhel/openvswitch-kmod-rhel6.spec
185
186This produces an "kmod-openvswitch" RPM for each kernel variant, in this
187example: "kmod-openvswitch", "kmod-openvswitch-debug", and
188"kmod-openvswitch-kdump".
189
190Red Hat Network Scripts Integration
191-----------------------------------
192
193A RHEL host has default firewall rules that prevent any Open vSwitch tunnel
194traffic from passing through. If a user configures Open vSwitch tunnels like
195Geneve, GRE, VXLAN, LISP etc., they will either have to manually add iptables
196firewall rules to allow the tunnel traffic or add it through a startup script
197Refer to the "enable-protocol" command in the ovs-ctl(8) manpage for more
198information.
199
200In addition, simple integration with Red Hat network scripts has been
201implemented. Refer to `README.RHEL.rst <rhel/README.RHEL.rst>`__ in the source
202tree or /usr/share/doc/openvswitch/README.RHEL.rst in the installed openvswitch
203package for details.
204
205Reporting Bugs
206--------------
207
208Report problems to bugs@openvswitch.org.