Skip to content

Commit

Permalink
rhel: Do not update kmod RPM newer major revision kernels.
Browse files Browse the repository at this point in the history
The ovs-kmod-manage.sh script will run weak-updates even on newer
release kernels installing a non-compatible or un-runnable kernel
module.

Update the script to never install weak-updates onto kernels with
newer major release versions.

VMware-BZ: #2717283
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
  • Loading branch information
gvrose8192 authored and igsilya committed Mar 22, 2021
1 parent 56e60ec commit 2eb7e22
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
Expand Up @@ -155,6 +155,16 @@ kmod_versions=()
kversion=$(rpm -ql ${rpmname} | grep '\.ko$' | \
sed -n -e 's/^\/lib\/modules\/\(.*\)\/extra\/.*$/\1/p' | \
sort | uniq)

IFS='.\|-' read installed_major installed_minor installed_patch \
installed_major_rev installed_minor_rev installed_extra <<<"${kversion}"

if [ "$installed_major_rev" -lt "$major_rev" ]; then
echo "Not installing RPM with major revision $installed_major_rev" \
"to kernel with greater major revision $major_rev. Exiting"
exit 1
fi

for kv in $kversion; do
IFS='.\|-' read -r -a kv_nums <<<"${kv}"
kmod_versions+=(${kv_nums[$ver_offset]})
Expand Down

0 comments on commit 2eb7e22

Please sign in to comment.