diff mbox series

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

Message ID 1515716009-3063-1-git-send-email-gvrose8192@gmail.com
State Superseded
Headers show
Series [ovs-dev,1/2] rhel: Add depmod file for openvswitch moduule search | expand

Commit Message

Gregory Rose Jan. 12, 2018, 12:13 a.m. UTC
From: Greg Rose <roseg@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@gmail.com>
---
 rhel/openvswitch-kmod-rhel6.spec.in | 10 ++++++----
 rhel/openvswitch-kmod.files         |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

Comments

Gregory Rose Jan. 12, 2018, 12:20 a.m. UTC | #1
On 1/11/2018 4:13 PM, Greg Rose wrote:
> From: Greg Rose <roseg@vmware.com>

I forgot to reset the author on this patch - it is Guru.

- Greg

>
> 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@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
Ansis Jan. 12, 2018, 4:07 a.m. UTC | #2
On 11 January 2018 at 16:13, Greg Rose <gvrose8192@gmail.com> wrote:
> From: Greg Rose <roseg@vmware.com>
>

You have a typo in title: s/moduule/module

Otherwise, looks good, but I would prefer that someone else takes a look too.

> 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@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
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Gregory Rose Jan. 12, 2018, 5:39 a.m. UTC | #3
-----Original Message-----
From: Ansis Atteka [mailto:ansisatteka@gmail.com] 
Sent: Thursday, January 11, 2018 8:08 PM
To: Greg Rose <gvrose8192@gmail.com>
Cc: <dev@openvswitch.org> <dev@openvswitch.org>; Gregory Rose <roseg@vmware.com>
Subject: Re: [ovs-dev] [PATCH 1/2] rhel: Add depmod file for openvswitch moduule search

On 11 January 2018 at 16:13, Greg Rose <gvrose8192@gmail.com> wrote:
> From: Greg Rose <roseg@vmware.com>
>

> You have a typo in title: s/moduule/module

Yes, was in a bit of a hurry. We'll fix it up.

> Otherwise, looks good, but I would prefer that someone else takes a look too.

Thanks for the review!

- Greg


> 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@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
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.openvswitch.
> org_mailman_listinfo_ovs-2Ddev&d=DwIBaQ&c=uilaK90D4TOVoH58JNXRgQ&r=rh0
> r8h0vfvriptyxfci4Rw&m=mnMqhwqXXL9oyp9mHChv8Dco5AZz-FJZRk-Ha_UhCIE&s=tv
> WCbseALJuCqR8v_3Yt8EpcXkJnRjG3-EaLa7RER8g&e=
diff mbox series

Patch

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