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 <[email protected]>
---
 rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh 
b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
index f147857e4..66b09472a 100644
--- a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
+++ b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
@@ -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]})
-- 
2.17.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to