summaryrefslogtreecommitdiff
path: root/rhel
diff options
context:
space:
mode:
authorYifeng Sun <pkusunyifeng@gmail.com>2019-11-18 12:06:26 -0800
committerWilliam Tu <u9012063@gmail.com>2019-11-18 12:31:58 -0800
commit1aaf467bd4514f0e23d4227075c7fecb42876c9c (patch)
treed35e55f366555226f06e1b716bd40b8f3321dfeb /rhel
parent716b035e38608429e0c3901e1ea5b4e66afce0e8 (diff)
downloadopenvswitch-1aaf467bd4514f0e23d4227075c7fecb42876c9c.tar.gz
rhel: Fix ovs-kmod-manage.sh that may create invalid soft links
Current code iterates every kernel under '/lib/modules' for a matched version. As a result, this script may create invalid soft links if the matched kernel doesn't have openvswitch-kmod RPM installed. This patch fixes it. VMWare-BZ: #2257534 Fixes: c3570519 ("rhel: add 4.4 kernel in kmod build with mulitple versions, fedora") Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com> Acked-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: William Tu <u9012063@gmail.com>
Diffstat (limited to 'rhel')
-rw-r--r--rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
index a643b55ff..a252b391e 100644
--- a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
+++ b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
@@ -157,7 +157,7 @@ fi
#$kmod_high_ver"
found_match=false
-for kname in `ls -d /lib/modules/*`
+for kname in $kversion;
do
IFS='.\|-' read -r -a pkg_ver_nums <<<"${kname}"
pkg_ver=${pkg_ver_nums[$ver_offset]}
@@ -184,14 +184,14 @@ if [ "$found_match" = "false" ]; then
exit 1
fi
-if [ "$requested_kernel" != "/lib/modules/$current_kernel" ]; then
+if [ "$requested_kernel" != "$current_kernel" ]; then
if [ ! -d /lib/modules/$current_kernel/weak-updates/openvswitch ]; then
mkdir -p /lib/modules/$current_kernel/weak-updates
mkdir -p /lib/modules/$current_kernel/weak-updates/openvswitch
fi
for m in openvswitch vport-gre vport-stt vport-geneve \
vport-lisp vport-vxlan; do
- ln -f -s $requested_kernel/extra/openvswitch/$m.ko \
+ ln -f -s /lib/modules/$requested_kernel/extra/openvswitch/$m.ko \
/lib/modules/$current_kernel/weak-updates/openvswitch/$m.ko
done
else