On 1/12/2018 11:32 AM, Flavio Leitner wrote:
On Fri, Jan 12, 2018 at 08:37:43AM -0800, Greg Rose wrote:
From: Gurucharan Shetty <shet...@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.
I am a bit rusty on this so apologies if I am missing something
obvious.  However, I don't know how this is fixing the issue because
the module is still being installed at /lib/modules/%{kernel_version}
and you are saying to depmod to look at /lib/modules/extra/openvswitch
and /lib/modules/weak-updates/openvswitch first.

It seems all you need is to run /sbin/weak-modules in %post to make
sure all kernels are updated.

I've never even heard of that utility.  There's no man page for it (at least on my system) but
let me give it a look.  Sounds promising!!

Thanks,

- Greg


fbl


Signed-off-by: Greg Rose <gvrose8...@gmail.com>

---

V2 - Fix typo in commit title
---
  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

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to