[ovs-dev] [PATCH v2] rhel: Add 4.12 kernel support in ovs-kmod-manage.sh

Guru Shetty guru at ovn.org
Mon May 20 19:53:44 UTC 2019


On Mon, 20 May 2019 at 12:48, Yi-Hung Wei <yihung.wei at gmail.com> wrote:

> This patch extends c3570519ecaf ("rhel: add 4.4 kernel in kmod build
> with mulitple versions, fedora") that updates ovs-kmod-manage.sh to
> support SLES 12 SP4 kernel (4.12.x, x>=14).
>
> For some distros, openvswitch-kmod rpm package may contain multiple
> ovs kernel modules built against different kernels to deal with kernel
> ABI changes and kernel module compatibility issues.  For rpm that
> packages with multiple kernel modules, ovs-kmod-manage.sh is invoked
> during the rpm post installation stage to 1) select the proper kernel
> module to be used; 2) create symbolic links to the proper kernel module
> in the weak-updates directory if needed.
>
> For SLES 12 SP4, since the weak-modules utility is not available, even
> though there is no ovs related kernel ABI changes for its
> currently 5 available kernels from 4.12.14-94.41.1 to 4.12.14-95.16.1,
> we still want to invoke ovs-kmod-manage.sh to create weak-updates
> symbolic links if the kernel that build the rpm package is different
> from the installed kernel.
>
> Notice that ovs-kmod-manage.sh assumes the oldest compatible kernel
> is used to build the kernel module rpm. For example, on SLES 12 SP4
> it would be,
>
> $ rpmbuild -bb -D 'kversion 4.12.14-94.41-default' \
>     rhel/openvswitch-kmod-fedora.spec
>
> Signed-off-by: Yi-Hung Wei <yihung.wei at gmail.com>
>
Thanks. Applied to master.



> ---
> v1->v2:
> * Address feedback from Guru.  That is since SLES does not have
> weak-modules, instead of checking the version number of SLES kernels
> on post-inst section, greps "suse" on /etc/os-relese and invokes
> ovs-kmod-manage.sh.
>
> ---
>  rhel/openvswitch-kmod-fedora.spec.in               | 13 ++++++-------
>  ...sr_share_openvswitch_scripts_ovs-kmod-manage.sh | 22
> ++++++++++++++++++----
>  2 files changed, 24 insertions(+), 11 deletions(-)
>
> diff --git a/rhel/openvswitch-kmod-fedora.spec.in b/rhel/
> openvswitch-kmod-fedora.spec.in
> index 9a4c48910acb..dfa6f237f82d 100644
> --- a/rhel/openvswitch-kmod-fedora.spec.in
> +++ b/rhel/openvswitch-kmod-fedora.spec.in
> @@ -85,19 +85,18 @@ IFS='.\|-' read mainline_major mainline_minor
> mainline_patch major_rev \
>      minor_rev _extra <<<"${current_kernel}"
>  # echo mainline_major=$mainline_major mainline_minor=$mainline_minor \
>  # mainline_patch=$mainline_patch major_rev=$major_rev minor_rev=$minor_rev
> -if [ "$mainline_major" = "3" ] && [ "$mainline_minor" = "10" ]; then
> +if grep -qs "suse" /etc/os-release; then
> +    # For SLES or OpenSUSE
> +    if [ -x "%{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh" ]; then
> +        %{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh
> +    fi
> +elif [ "$mainline_major" = "3" ] && [ "$mainline_minor" = "10" ]; then
>      if [ "$major_rev" = "327" ] || [ "$major_rev" = "693" ]; then
>          # For RHEL 7.2 and 7.4
>          if [ -x "%{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh" ];
> then
>              %{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh
>          fi
>      fi
> -elif [ "$mainline_major" = "4" ] && [ "$mainline_minor" = "4" ] && \
> -     [ "$mainline_patch" -ge "73" ]; then
> -     # For SLES 12 SP3
> -     if [ -x "%{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh" ]; then
> -         %{_datadir}/openvswitch/scripts/ovs-kmod-manage.sh
> -     fi
>  else
>      # Ensure that modprobe will find our modules.
>      for k in $(cd /lib/modules && /bin/ls); do
> diff --git a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
> b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
> index b5c4615f20b5..9c9f230b70d7 100644
> --- a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
> +++ b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
> @@ -14,10 +14,13 @@
>  # See the License for the specific language governing permissions and
>  # limitations under the License.
>
> -# This version of the script is intended to be used on kernel version
> 3.10.0
> -# major revision 327 (RHEL 7.2) and 693 (RHEL 7.4), and kernel version
> 4.4.x,
> -# x >= 73 (SLES 12 SP3) only. It is packaged in the openvswitch kmod RPM
> -# and run in the post-install scripts.
> +# This script is intended to be used on the following kernels.
> +#   - 3.10.0 major revision 327 (RHEL 7.2)
> +#   - 3.10.0 major revision 693 (RHEL 7.4)
> +#   - 4.4.x,  x >= 73           (SLES 12 SP3)
> +#   - 4.12.x, x >= 14           (SLES 12 SP4).
> +# It is packaged in the openvswitch kmod RPM and run in the post-install
> +# scripts.
>  #
>  # For kernel 3.10.0-693,
>  # due to some backward incompatible changes introduced in minor revision
> 17.1,
> @@ -34,6 +37,10 @@
>  # 4.4.73 to 4.4.114; modules built against 4.4.120 can run on systems from
>  # 4.4.120 onwards.
>  #
> +# For kernel 4.12.x, x>=14,
> +# kernel modules built with the oldest compatible kernel 4.12.14-94.41.1
> can
> +# run on all versions onwards.
> +#
>  # This script checks the current running kernel version, and update
> symlinks
>  # for the openvswitch kernel modules in the appropriate kernel directory,
>  # provided the kmod RPM has installed kernel modules files built from both
> @@ -80,6 +87,13 @@ elif [ "$mainline_major" = "4" ] && [ "$mainline_minor"
> = "4" ]; then
>          ver_offset=2
>          installed_ver="$mainline_patch"
>      fi
> +elif [ "$mainline_major" = "4" ] && [ "$mainline_minor" = "12" ]; then
> +    if [ "$mainline_patch" -ge "14" ]; then
> +#        echo "sles12sp4"
> +        comp_ver=14
> +        ver_offset=2
> +        installed_ver="$mainline_patch"
> +    fi
>  fi
>
>  if [ X"$ver_offset" = X ]; then
> --
> 2.7.4
>
>


More information about the dev mailing list