]> git.proxmox.com Git - mirror_ovs.git/blame - INSTALL.RHEL
datapath-windows: NetlinkBuf.c: Minor fix for lines exceeding 79 chars
[mirror_ovs.git] / INSTALL.RHEL
CommitLineData
c434706a
BP
1 How to Install Open vSwitch on Red Hat Enterprise Linux
2 =======================================================
3
4This document describes how to build and install Open vSwitch on a Red
5Hat Enterprise Linux (RHEL) host. If you want to install Open vSwitch
f6eb6b20 6on a generic Linux host, see INSTALL instead.
c434706a
BP
7
8We have tested these instructions with RHEL 5.6 and RHEL 6.0.
9
10Building Open vSwitch for RHEL
11------------------------------
12
13You may build from an Open vSwitch distribution tarball or from an
14Open vSwitch Git tree.
15
1547f8e3
FL
16The default RPM build directory (_topdir) has five directories in
17the top-level:
181. BUILD/ Where the software is unpacked and built.
192. RPMS/ Where the newly created binary package files are written.
203. SOURCES/ Contains the original sources, patches, and icon files.
214. SPECS/ Contains the spec files for each package to be built.
225. SRPMS/ Where the newly created source package files are written.
23
24Before you begin, note the RPM sources directory on your version of
3c49da46 25RHEL. The command "rpmbuild --showrc" will show the configuration
1547f8e3
FL
26for each of those directories. Alternatively, the command "rpm --eval
27 '%{_topdir}'" shows the current configuration for the top level
28directory and the command "rpm --eval '%{_sourcedir}'" does the same
29for the sources directory. On RHEL 5, the default RPM _topdir is
30/usr/src/redhat and the default RPM sources directory is
31/usr/src/redhat/SOURCES. On RHEL 6, the default _topdir is
32$HOME/rpmbuild and the default RPM sources directory is
33$HOME/rpmbuild/SOURCES.
c434706a 34
935cdc95
BP
351. Install build prerequisites:
36
37 yum install gcc make python-devel openssl-devel kernel-devel graphviz \
38 kernel-debug-devel autoconf automake rpm-build redhat-rpm-config \
39 libtool
40
412. If you are building from a distribution tarball, skip to step 3.
42 Otherwise, you must be building from an Open vSwitch Git tree.
43 Determine what version of Autoconf is installed (e.g. run "autoconf
44 --version"). If it is not at least version 2.63, then you have two
6fdbeaa6
BP
45 choices:
46
0877a018 47 a. Install Autoconf 2.63 or later, one way or another.
6fdbeaa6
BP
48
49 b. Create a distribution tarball on some other machine, by
50 running "./boot.sh; ./configure; make dist" in the Git tree.
51 You must run this on a machine that has the tools listed in
52 INSTALL as prerequisites for building from a Git tree.
53 Afterward, proceed with the rest of the instructions using the
54 distribution tarball.
55
6fdbeaa6 563. Some versions of the RHEL 6 kernel-devel package contain a broken
8f5cb995
BP
57 "build" symlink. If you are using such a version, you must fix
58 the problem before continuing.
59
60 To find out whether you are affected, run:
61
62 cd /lib/modules/<version>
63 ls -l build/
64
65 where <version> is the version number of the RHEL 6 kernel. (The
66 trailing slash in the final command is important. Be sure to include
67 it.) If the "ls" command produces a directory listing, your
68 kernel-devel package is OK. If it produces a "No such file or
69 directory" error, your kernel-devel package is buggy.
70
71 If your kernel-devel package is buggy, then you can fix it with:
72
73 cd /lib/modules/<version>
74 rm build
75 ln -s /usr/src/kernels/<target> build
76
77 where <target> is the name of an existing directory under
78 /usr/src/kernels, whose name should be similar to <version> but may
79 contain some extra parts. Once you have done this, verify the fix with
80 the same procedure you used above to check for the problem.
81
935cdc95
BP
824. If you are building from a distribution tarball, skip to step 5.
83 Otherwise, create a distribution tarball from the root of the Git
84 tree by running:
85
86 ./boot.sh
87 ./configure
88 make dist
89
905. Now you have a distribution tarball, named something like
91 openvswitch-x.y.z.tar.gz. Copy this file into the RPM sources
92 directory, e.g.:
93
94 cp openvswitch-x.y.z.tar.gz $HOME/rpmbuild/SOURCES
c434706a 95
935cdc95
BP
966. Make another copy of the distribution tarball in a temporary
97 directory. Then unpack the tarball and "cd" into its root, e.g.:
c434706a 98
935cdc95
BP
99 tar xzf openvswitch-x.y.z.tar.gz
100 cd openvswitch-x.y.z
c434706a 101
6fdbeaa6 1027. To build Open vSwitch userspace, run:
c434706a
BP
103
104 rpmbuild -bb rhel/openvswitch.spec
105
106 This produces two RPMs: "openvswitch" and "openvswitch-debuginfo".
107
329cf232
GS
108 The above command automatically runs the Open vSwitch unit tests.
109 To disable the unit tests, run:
110
111 rpmbuild -bb --without check rhel/openvswitch.spec
112
8f5cb995
BP
113 If the build fails with "configure: error: source dir
114 /lib/modules/2.6.32-279.el6.x86_64/build doesn't exist" or similar,
115 then the kernel-devel package is missing or buggy. Go back to step
116 1 or 2 and fix the problem.
117
6fdbeaa6 1188. On RHEL 6, to build the Open vSwitch kernel module, copy
935cdc95 119 rhel/openvswitch-kmod.files into the RPM sources directory and run:
c434706a
BP
120
121 rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec
122
935cdc95 123 You might have to specify a kernel version and/or variants, e.g.:
6c9b8ee4
AF
124
125 rpmbuild -bb \
126 -D "kversion 2.6.32-131.6.1.el6.x86_64" \
127 -D "kflavors default debug kdump" \
128 rhel/openvswitch-kmod-rhel6.spec
129
935cdc95
BP
130 This produces an "kmod-openvswitch" RPM for each kernel variant, in
131 this example: "kmod-openvswitch", "kmod-openvswitch-debug", and
132 "kmod-openvswitch-kdump".
c434706a 133
f9ee9dcb
GS
134A RHEL host has default firewall rules that prevent any Open vSwitch tunnel
135traffic from passing through. If a user configures Open vSwitch tunnels like
271e6bc7
JG
136Geneve, GRE, VXLAN, LISP etc., they will either have to manually add iptables
137firewall rules to allow the tunnel traffic or add it through a startup script
138(Please refer to the "enable-protocol" command in the ovs-ctl(8) manpage).
f9ee9dcb 139
0fb42626
AF
140Red Hat Network Scripts Integration
141-----------------------------------
142
143Simple integration with Red Hat network scripts has been implemented.
144Please read rhel/README.RHEL in the source tree or
145/usr/share/doc/openvswitch/README.RHEL in the installed openvswitch
146package for details.
147
c434706a
BP
148Reporting Bugs
149--------------
150
151Please report problems to bugs@openvswitch.org.