From ab678ef14594f03ddd48385571e70ddf55b63ef2 Mon Sep 17 00:00:00 2001 From: Gurucharan Shetty Date: Sat, 30 Mar 2013 18:32:25 -0700 Subject: [PATCH] rhel: Add depmod.d conf file for rhel6 kmod package. It looks like for Centos6.4, there is an upstream openvswitch kernel module already installed. When we try to install kmod-openvswitch package from this tree's pre-1.10 branches, we get the following warning: "brcompat.ko needs unknown symbol ovs_dp_ioctl_hook". Also, after installing the kmod-openvswitch package, if we run "modprobe openvswitch", the upstream kernel module gets loaded. We should instead load the kernel module compiled from this tree. This patch fixes both the above issues. Bug #15829. Signed-off-by: Gurucharan Shetty --- INSTALL.RHEL | 3 ++- rhel/automake.mk | 1 + rhel/openvswitch-kmod-rhel6.spec.in | 9 ++++++++- rhel/openvswitch-kmod.files | 3 +++ 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 rhel/openvswitch-kmod.files diff --git a/INSTALL.RHEL b/INSTALL.RHEL index ff79c8943..953293210 100644 --- a/INSTALL.RHEL +++ b/INSTALL.RHEL @@ -49,7 +49,8 @@ RHEL. On RHEL 5, the default RPM source directory is which is usually: "kmod-openvswitch", "kmod-openvswitch-xen", and "kmod-openvswitch-PAE". -5b. On RHEL 6, to build the Open vSwitch kernel module, run: +5b. On RHEL 6, to build the Open vSwitch kernel module, copy + rhel/openvswitch-kmod.files into the RPM source directory and run: rpmbuild -bb rhel/openvswitch-kmod-rhel6.spec diff --git a/rhel/automake.mk b/rhel/automake.mk index 3bdc4cedf..7bc852090 100644 --- a/rhel/automake.mk +++ b/rhel/automake.mk @@ -17,6 +17,7 @@ EXTRA_DIST += \ rhel/openvswitch-kmod-rhel5.spec.in \ rhel/openvswitch-kmod-rhel6.spec \ rhel/openvswitch-kmod-rhel6.spec.in \ + rhel/openvswitch-kmod.files \ rhel/openvswitch-kmod-fedora.spec \ rhel/openvswitch-kmod-fedora.spec.in \ rhel/openvswitch.spec \ diff --git a/rhel/openvswitch-kmod-rhel6.spec.in b/rhel/openvswitch-kmod-rhel6.spec.in index d9aeff03c..6dbb3771a 100644 --- a/rhel/openvswitch-kmod-rhel6.spec.in +++ b/rhel/openvswitch-kmod-rhel6.spec.in @@ -19,6 +19,7 @@ Group: System/Kernel License: GPLv2 URL: http://openvswitch.org/ Source0: %{oname}-%{version}.tar.gz +Source1: %{oname}-kmod.files BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: %kernel_module_package_buildreqs @@ -34,7 +35,7 @@ BuildRequires: %kernel_module_package_buildreqs # specified kernel variants. %{!?kflavors:%define kflavors default} -%kernel_module_package -n %{oname} %kflavors +%kernel_module_package -n %{oname} -f %{SOURCE1} %kflavors %description Open vSwitch Linux kernel module. @@ -42,6 +43,10 @@ Open vSwitch Linux kernel module. %prep %setup -n %{oname}-%{version} +cat > %{oname}.conf << EOF +override %{oname} * extra/%{oname} +override %{oname} * weak-updates/%{oname} +EOF %build for flavor in %flavors_to_build; do @@ -57,6 +62,8 @@ for flavor in %flavors_to_build ; do make -C %{kernel_source $flavor} modules_install \ M="`pwd`"/_$flavor/datapath/linux done +install -d %{buildroot}%{_sysconfdir}/depmod.d/ +install -m 644 %{oname}.conf %{buildroot}%{_sysconfdir}/depmod.d/ %clean rm -rf $RPM_BUILD_ROOT diff --git a/rhel/openvswitch-kmod.files b/rhel/openvswitch-kmod.files new file mode 100644 index 000000000..357c2e8b7 --- /dev/null +++ b/rhel/openvswitch-kmod.files @@ -0,0 +1,3 @@ +%defattr(644,root,root,755) +/lib/modules/%2-%1 +/etc/depmod.d/openvswitch.conf -- 2.20.1