2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 01:51:26 +00:00

25 Commits

Author SHA1 Message Date
Guzowski Adrian
2abd8148cf Add ability to override default Release suffix in RPM packages.
In some cases, like building OvS packages in Jenkins, it may be
useful to set a custom version suffix that will correspond with
job's build number, etc. Currently, version number is explicitly
set to 1. This change adds a define "release_number" that may be
overridden during package bulding process:

rpmbuild -ba --define="release_number X" ...

Signed-off-by: Guzowski Adrian <adrian.guzowski@exatel.pl>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-07-16 14:11:12 +02:00
Greg Rose
7bfb1952b9 Update scripts to support RHEL 7.9
Add support for RHEL7.9 GA release with kernel 3.10.0-1160

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
2020-11-18 20:04:01 -08:00
William Tu
fecb28051b rhel: Support RHEL 7.8 kernel module rpm build.
Add support for RHEL7.8 GA release with kernel 3.10.0-1127.

VMware-BZ: #2582834
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: William Tu <u9012063@gmail.com>
2020-06-18 09:12:34 -07:00
Yi-Hung Wei
391b52f3c3 rhel: Support RHEL 7.8 kernel module rpm build
This patch supports RHEL 7.8 kernel module rpm package building.

$ make rpm-fedora-kmod \
RPMBUILD_OPT='-D "kversion 3.10.0-1101.el7.x86_64"'

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: William Tu <u9012063@gmail.com>
2019-12-13 15:58:26 -08:00
Yifeng Sun
454dc17c75 rhel: Support RHEL7.7 build and packaging
This patch provides essential fixes for OVS to support
RHEL7.7's new kernel.

make rpm-fedora-kmod \
RPMBUILD_OPT='-D "kversion 3.10.0-1062.1.2.el7.x86_64"'

Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-10-24 14:26:21 -07:00
Ashish Varma
4afd1d8769 rhel: Fixed a bug for checking the correct major version and revision.
Fixed a bug where checking for major version 3.10 and major revision not
equal to 327 or 693 or 957 should have gone to the default else at the end.
In the current code, the default else condition will not get executed
for kernel with major version 3.10 and major revision not equal
to 327/693/957 resulting in failure to load the kernel module.

Fixes: 402efbe4e176 ("rhel: Add 4.12 kernel support in ovs-kmod-manage.sh")
Signed-off-by: Ashish Varma <ashishvarma.ovs@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-07-08 14:10:01 -07:00
Greg Rose
26b3641c9a rhel: Fix upgrade path
There is a bug in the upgrade path from the old kmod-openvswitch SysV
based RPM to the new openvswitch-kmod systemd based RPM. Since the
name of the package is changed it is not possible to use the yum
or rpm upgrade options.  This prevents passing in a 1 or 2 to the
%postun scriptlet section of the older RPM and that causes the section
to be treated as an 'erase'.  The old kmod-openvswitch %postun section
proceeds to erase the symlinks in ../weak-updates/openvwswitch that
the installation of the new package had just created.

Fix this by adding a %posttrans tag to the systemd spec file.  This
scriptlet is called after the symlinks have just been erased and
it calls the ovs-kmod-manage.sh script to recreate the symlinks and
run depmod -a again so that the correct kernel modules will be
found and loaded.

VMware-BZ: #236987

Cc: Aaron Conole <aconole@redhat.com>
Cc: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: Aaron Conole <aconole@redhat.com>
2019-06-25 16:12:22 -07:00
Yifeng Sun
52d12cc459 rhel7.6: Support kmod build and load for mulitple kernel versions
RHEL 7.6's new kernel 3.10.0-957.12.1.el7 introduced some ABI changes.
This leads to an issue that OVS kernel module built against
kernels newer than 12.1 cannot be loaded on systems running kernels
older than 12.1, vice versa.

By inspecting datapath/linux/openvswitch.mod.c, signatures of
the following kernel functions have changed in 3.10.0-957.12.1.el7:
    nf_ct_get_tuple
    nf_ct_invert_tuplepr
    __nf_ct_l4proto_find

This patch enables OVS to build kernel modules against multiple
kernel versions and enables RHEL 7.6 system to load the compatible
module at runtime.

make rpm-fedora-kmod \
    RPMBUILD_OPT='-D "kversion 3.10.0-957.10.1.el7.x86_64 \
    3.10.0-957.12.1.el7.x86_64"'

Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-06-05 13:21:27 -07:00
Yi-Hung Wei
402efbe4e1 rhel: Add 4.12 kernel support in ovs-kmod-manage.sh
This patch extends c3570519ecaf ("rhel: add 4.4 kernel in kmod build
with mulitple versions, fedora") that updates ovs-kmod-manage.sh to
support SLES 12 SP4 kernel (4.12.x, x>=14).

For some distros, openvswitch-kmod rpm package may contain multiple
ovs kernel modules built against different kernels to deal with kernel
ABI changes and kernel module compatibility issues.  For rpm that
packages with multiple kernel modules, ovs-kmod-manage.sh is invoked
during the rpm post installation stage to 1) select the proper kernel
module to be used; 2) create symbolic links to the proper kernel module
in the weak-updates directory if needed.

For SLES 12 SP4, since the weak-modules utility is not available, even
though there is no ovs related kernel ABI changes for its
currently 5 available kernels from 4.12.14-94.41.1 to 4.12.14-95.16.1,
we still want to invoke ovs-kmod-manage.sh to create weak-updates
symbolic links if the kernel that build the rpm package is different
from the installed kernel.

Notice that ovs-kmod-manage.sh assumes the oldest compatible kernel
is used to build the kernel module rpm. For example, on SLES 12 SP4
it would be,

$ rpmbuild -bb -D 'kversion 4.12.14-94.41-default' \
    rhel/openvswitch-kmod-fedora.spec

Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
2019-05-20 01:38:32 -07:00
Martin Xu
9fe4b2fbd2 rhel: bug fix upgrade path in kmod fedora spec file
This patch removes the "Conflicts" tag and adds "Obsoletes" tag.

With the conflicts tag, when a user attempts to install or upgrade with
the same version as already installed, the conflict kicks in. Otherwise,
such is allowed with --replacepkgs.

Obsoletes is needed for the upgrade path from kmod-openvswitch to
openvswitch-kmod.

Fixes: 22c33c3039 (rhel: support kmod build against mulitple kernel
versions, fedora)

VMware-BZ: #2249788

Signed-off-by: Martin Xu <martinxu9.ovs@gmail.com>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
CC: Yi-Hung Wei <yihung.wei@gmail.com>
CC: Yifeng Sun <pkusunyifeng@gmail.com>
CC: Zak Whittington <zwhitt.vmware@gmail.com>
CC: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2019-01-23 11:55:07 -08:00
Martin Xu
24ea309555 rhel: fix wrong condition check for ovs-kmod-manage.sh, fedora
In post-install in kmod fedora spec file, the variables storing
different parts of kernel version numbers are renamed. The condition
check to run ovs-kmod-manage.sh for RHEL 7.2 and 7.4 uses the older
variables.

Fixes: c3570519ecaf (rhel: add 4.4 kernel in kmod build with mulitple versions, fedora)
Signed-off-by: Martin Xu <martinxu9.ovs@gmail.com>
CC: Greg Rose <gvrose8192@gmail.com>
CC: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-09-26 13:30:17 -07:00
Martin Xu
8821b212df rhel: use _datadir as path prefix for ovs-kmod-manage.sh, fedora
This patch fixes the path for ovs-kmod-manage.sh script in the
openvswitch-kmod RPM in fedora spec file. Currently the path prefix is
hard coded to /usr/share. Use %{_datadir} instead.

Fixes: 22c33c303932 (rhel: support kmod build against mulitple kernel versions, fedora)
Signed-off-by: Martin Xu <martinxu9.ovs@gmail.com>
CC: Greg Rose <gvrose8192@gmail.com>
CC: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
2018-09-25 15:21:47 -07:00
Martin Xu
c3570519ec rhel: add 4.4 kernel in kmod build with mulitple versions, fedora
Extends 22c33c303932 (rhel: support kmod build against mulitple kernel
versions, fedora) to kernel version 4.4.x, x>=73 for SLES 12 SP3

Signed-off-by: Martin Xu <martinxu9.ovs@gmail.com>
CC: Greg Rose <gvrose8192@gmail.com>
CC: Markos Chandras <mchandras@suse.de>
CC: Ben Pfaff <blp@ovn.org>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Tested-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-09-05 15:03:40 -07:00
Martin Xu
eac9f26661 rhel: allow passing more flags to configure, fedora
Define a variable _ovs_config_extra_flags to allow passing more flags to
configure when building OVS kmod RPM. For example, to build with a
non-standard openssl and add an RPATH, use the following command

make rpm-fedora-kmod RPMBUILD_OPT='-D "_ovs_config_extra_flags
--with-openssl=<path to your openssl header> LDFLAGS=\"\${LDFLAGS} -Xlinker
-rpath=<path to your openssl lib>\""'

Signed-off-by: Martin Xu <martinxu9.ovs@gmail.com>
CC: Greg Rose <gvrose8192@gmail.com>
CC: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Reviewed-by: Markos Chandras <mchandras@suse.de>
2018-09-05 14:21:30 -07:00
Martin Xu
56bfa517d9 rhel: use full path for /sbin/depmod
Fixes: 22c33c303932 (rhel: support kmod build against mulitple kernel versions, fedora)
Fixes: c8cd1307b248 (rhel: support kmod build against multiple 7.2 kernels, rhel6)
Signed-off-by: Martin Xu <martinxu9.ovs@gmail.com>
CC: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
2018-09-05 14:20:55 -07:00
Martin Xu
9e8c33133c rhel: openvswitch-kmod-fedora.spec.in file bug fix
Patch 22c33c303932 used /usr/src/linux/<kernel version> as path of the
linux headers, which does not work for SLES. Use /lib/modules/<kernel
version>/build instead.

Fixes 22c33c303932 (rhel: support kmod build against mulitple kernel versions,
fedora)

Signed-off-by: Martin Xu <martinxu9.ovs@gmail.com>
CC: Greg Rose <gvrose8192@gmail.com>
CC: Markos Chandras <mchandras@suse.de>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Reviewed-by: Markos Chandras <mchandras@suse.de>
2018-09-05 14:20:31 -07:00
Martin Xu
22c33c3039 rhel: support kmod build against mulitple kernel versions, fedora
This patch ports changes from kmod rhel6 spec file to fedora spec file,
to support packaging kernel modules built against multiple versions of
kernel sources.

RHEL 7.4 introduced backward incompatible changes in the kernel. As
a result, prebuilt PRM packages against kernels newer than 693.17.1
will cannot be used on systems with older kernels, vice versa.

Intended to work only on RHEL 7.4 (kernel version 3.10.0-693.yy.zz).
This patch allows multiple kernel version numbers delimited by
whitespace to be passed as variable "kversion". The result RPM packages
the kernel module .ko files from all specified kernel versions. For
example,

make rpm-fedora-kmod \
    RPMBUILD_OPT='-D "kversion 3.10.0-693.1.1.el7.x86_64 \
    3.10.0-693.17.1.el7.x86_64"'

By default, make tries to build against the current running kernel.

This patch also includes a script to update the weak-update symlinks
if the system kernel version is upgraded or downgraded after
openvswitch-kmod is installed.

Signed-off-by: Martin Xu <martinxu9.ovs@gmail.com>
CC: Greg Rose <gvrose8192@gmail.com>
CC: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Leitner <fbl@redhat.com>
2018-08-21 14:14:38 -07:00
Greg Rose
c49889cf3e rhel: Ensure proper OVS kernel modules load after upgrade
Add post install and post un-install scripts to make sure that the
openvswitch kernel modules are correctly written with the weak-modules
utility. This ensures that after an upgrade to a newer kernel the
correct openvswitch kernel modules from a previous installation will
be found by the depmod search path.

Suggested-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Acked-by: Ansis Atteka <aatteka@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
2018-01-16 15:32:58 -08:00
Joe Stringer
d5eec8d707 fedora: Prioritize OVS modules in weak-updates.
Out-of-tree modules are installed into the kernel's "extra" modules
directory for the version that kmod-openvswitch is compiled against. For
all other kernels on the system at install time, a symlink is created in
the "weak-updates" directory. This provides a path for the same kernel
module to be used when minor kernel updates are done on a system.
However, without updating the depmod configuration the weak-update will
not be prioritized, so modprobe will switch back to using upstream
kernel modules when you upgrade. This patch introduces that depmod
configuration to ensure that the out-of-tree module is always used when
it is installed, regardless of kernel upgrades.

Signed-off-by: Joe Stringer <joe@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
2016-07-29 13:03:56 -07:00
Russell Bryant
8c7c9dd2a9 rhel: Make openvswitch-kmod-fedora.spec build.
I tried building this package on Fedora 23 and it failed for a couple of
different reasons.

This package tried to install modules without specifying the rpm build
root as an install prefix.  The result was just attempting to install
the modules on the system, which luckily failed since I wasn't running
rpmbuild as root.

The package also then tried to manually install the modules into the rpm
build root, which is unnecessary once modules_install is pointed to the
right place.

Finally, the package build failed with a completely unhelpful error
which turned out to be because it didn't know how to generate
a debuginfo pacakge.  I turned off the debug package for now.  At least
it builds now, which is an improvement.

Signed-off-by: Russell Bryant <russell@ovn.org>
Suggested-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Gurucharan Shetty <guru@ovn.org>
2016-01-29 16:25:23 -05:00
Ben Pfaff
dd2a1e9c59 rhel: Make Fedora %files and %install section wildcards match.
Since %install puts every .ko file into /lib/modules, %files should make
sure that all of them are packaged.

Suggested-by: Thomas Graf <tgraf@noironetworks.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
2015-04-06 21:28:01 -07:00
Ben Pfaff
31efbdb998 rhel: Package vport-*.ko in Fedora kernel package.
Fixes a presumed build break due to unpackaged files.  (Only "presumed" at
this point because it is masked in the VMware build system by the similar
XenServer build failure.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
2015-04-05 13:39:59 -07:00
Kyle Mestery
14ee471cb9 fedora-build: Remove %{build_number} from the configure line
Fixes the OVS builds on Fedora, which are currently broken upstream.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
2013-12-14 09:26:56 -08:00
Pravin B Shelar
5ca1ba484b openvswitch: Remove Linux bridge compatibility.
Currently brcompat does not work on master due to recent
datapath changes. We have decided to remove it as it is
not used very widely.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
2012-12-27 13:48:51 -08:00
Ralf Spenneberg
d8fe0a6ac8 build: Add support for building RPMs for Fedora Linux
Add RPM specfiles for building OVS for Fedora Linux. This
allows users of the upstream project the ability to
generate RPMs for their Open vSwitch needs.

Signed-off-by: Ralf Spenneberg <ralf@spenneberg.net>
[kmestery@cisco.com made substantial changes including
 writing documentation]
Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-10-10 09:28:39 -07:00