[ovs-dev] [PATCH 1/2] rhel: Add depmod file for openvswitch moduule search

Greg Rose gvrose8192 at gmail.com
Fri Jan 12 00:13:28 UTC 2018


From: Greg Rose <roseg at vmware.com>

There are occasions when an openvswitch kernel module rpm which does
not match the exact build number of the running kernel.  In that
case the openvswitch kernel modules will be installed to the
"weak-updates" directory under the /lib/modules/$(uname -r)
directory.  But the new kernel modules will not be found because
the default /etc/depmod.d/dist.conf search path lists weak-updates
last.

This patch creates a file in /etc/depmod.d/ named 01openvswitch.conf.
This file specifies weak-updates first in the search path and since
it is named with a preceeding "01" it will be found first by depmod.

This resolves issues with customers who have installed openvswitch
kernel modules previously and a kernel upgrade has occurred since
and when the kernel minor build numbers do not exactly match the
running kernel.

Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
---
 rhel/openvswitch-kmod-rhel6.spec.in | 10 ++++++----
 rhel/openvswitch-kmod.files         |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/rhel/openvswitch-kmod-rhel6.spec.in b/rhel/openvswitch-kmod-rhel6.spec.in
index 8413b25..a7f4832 100644
--- a/rhel/openvswitch-kmod-rhel6.spec.in
+++ b/rhel/openvswitch-kmod-rhel6.spec.in
@@ -62,17 +62,19 @@ for flavor in %flavors_to_build ; do
          find $INSTALL_MOD_PATH/lib/modules -iname 'modules.*' -exec rm {} \;
 done
 install -d %{buildroot}%{_sysconfdir}/depmod.d/
+
+echo "search extra/openvswitch weak-updates/openvswitch updates extra built-in weak-updates" >> 01%{oname}.conf
 for module in %{buildroot}/lib/modules/%{kernel_version}/$INSTALL_MOD_DIR/*.ko;
 do
     modname="$(basename ${module})"
-    echo "override ${modname%.ko} * extra/%{oname}" >> %{oname}.conf
-    echo "override ${modname%.ko} * weak-updates/%{oname}" >> %{oname}.conf
+    echo "override ${modname%.ko} * extra/%{oname}" >> 01%{oname}.conf
+    echo "override ${modname%.ko} * weak-updates/%{oname}" >> 01%{oname}.conf
 done
-install -m 644 %{oname}.conf %{buildroot}%{_sysconfdir}/depmod.d/
+install -m 644 01%{oname}.conf %{buildroot}%{_sysconfdir}/depmod.d/
 
 %files
 %defattr(644,root,root)
-/etc/depmod.d/%{oname}.conf
+/etc/depmod.d/01%{oname}.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
diff --git a/rhel/openvswitch-kmod.files b/rhel/openvswitch-kmod.files
index 357c2e8..49262f3 100644
--- a/rhel/openvswitch-kmod.files
+++ b/rhel/openvswitch-kmod.files
@@ -1,3 +1,3 @@
 %defattr(644,root,root,755)
 /lib/modules/%2-%1
-/etc/depmod.d/openvswitch.conf
+/etc/depmod.d/01openvswitch.conf
-- 
1.8.3.1



More information about the dev mailing list