[ovs-dev] [PATCH V2 1/2] rhel: Add depmod file for openvswitch module search
Gregory Rose
gvrose8192 at gmail.com
Fri Jan 12 20:30:57 UTC 2018
On 1/12/2018 11:53 AM, Flavio Leitner wrote:
> On Fri, Jan 12, 2018 at 11:38:05AM -0800, Gregory Rose wrote:
>> 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 <shettyg 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.
>>> 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!!
> It's a valid request, feel free to open a bz.
>
> Looks at this example:
>
> %post kmod-%{kverrel}
> for k in $(cd /lib/modules && /bin/ls); do
> [ -d "/lib/modules/$k/kernel/" ] && depmod -a "$k"
> done
> if [ -x "/sbin/weak-modules" ]; then
> for m in sfc sfc_resource sfc_char onload sfc_affinity; do
> echo "/lib/modules/%{kernel}/extra/$m.ko"
> done | /sbin/weak-modules --add-modules
> fi
>
> %postun kmod-%{kverrel}
> for k in $(cd /lib/modules && /bin/ls); do
> [ -d "/lib/modules/$k/kernel/" ] && depmod -a "$k"
> done
> if [ "$1" = 0 ]; then # Erase, not upgrade
> if [ -x "/sbin/weak-modules" ]; then
> for m in sfc sfc_resource sfc_char onload sfc_affinity; do
> echo "/lib/modules/%{kernel}/extra/$m.ko"
> done | /sbin/weak-modules --remove-modules
> fi
> fi
>
>
> from here
> https://github.com/majek/openonload/blob/master/scripts/onload_misc/openonload.spec
Thanks for the example, that's very helpful.
- Greg
>
> HTH,
> fbl
>
>
More information about the dev
mailing list