[ovs-dev] [PATCH V2] rhel: Ensure proper OVS kernel modules load after upgrade

Guru Shetty guru at ovn.org
Tue Jan 16 22:38:07 UTC 2018


On 16 January 2018 at 08:44, Greg Rose <gvrose8192 at gmail.com> wrote:

> Add post install and post un-install scripts to make sure that the
> openvswitch kernel modules are correctly written with the weak-modules
> utility. This ensures that after an upgrade to a newer kernel the
> correct openvswitch kernel modules from a previous installation will
> be found by the depmod search path.
>
> Suggested-by: Flavio Leitner <fbl at sysclose.org>
> Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
>

Woudn't dist.conf override the contents of openvswitch.conf and you still
choose inbuilt kernel module?


>
> ---
> V2 - Modify the correct kmod spec file
> ---
>  rhel/openvswitch-kmod-fedora.spec.in | 23 ++++++++++++++++++++++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/rhel/openvswitch-kmod-fedora.spec.in b/rhel/openvswitch-kmod-
> fedora.spec.in
> index 93adb03..c0cd298 100644
> --- a/rhel/openvswitch-kmod-fedora.spec.in
> +++ b/rhel/openvswitch-kmod-fedora.spec.in
> @@ -57,7 +57,28 @@ rm -rf $RPM_BUILD_ROOT
>
>  %post
>  # Ensure that modprobe will find our modules.
> -depmod %{kernel}
> +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 openvswitch vport-gre vport-stt vport-geneve \
> +             vport-lisp vport-vxlan; do
> +        echo "/lib/modules/%{kernel}/extra/$m.ko"
> +    done | /sbin/weak-modules --add-modules
> +fi
> +
> +%postun
> +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 openvswitch vport-gre vport-stt vport-geneve \
> +                 vport-lisp vport-vxlan; do
> +        echo "/lib/modules/%{kernel}/extra/$m.ko"
> +    done | /sbin/weak-modules --remove-modules
> +    fi
> +fi
>
>  %files
>  %defattr(0644,root,root)
> --
> 1.8.3.1
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>


More information about the dev mailing list