1 Star 0 Fork 47

gu-gu-gu/openvswitch

forked from src-openEuler/openvswitch 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
rhel-Fix-ovs-kmod-manage.sh-that-may-create-invalid-.patch 2.02 KB
一键复制 编辑 原始数据 按行查看 历史
wangluosu 提交于 2019-12-26 22:17 . update patch
From 7fbfaf9c5ca7a722bf1887afa6f2a7a45af61b7c Mon Sep 17 00:00:00 2001
From: Yifeng Sun <pkusunyifeng@gmail.com>
Date: Mon, 18 Nov 2019 12:06:26 -0800
Subject: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>
---
rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh | 6 +++---
1 file 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 693fb0b74..8464a6fbc 100644
--- a/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
+++ b/rhel/usr_share_openvswitch_scripts_ovs-kmod-manage.sh
@@ -151,7 +151,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]}
@@ -178,14 +178,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
--
2.14.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gu-gu-gu/openvswitch.git
git@gitee.com:gu-gu-gu/openvswitch.git
gu-gu-gu
openvswitch
openvswitch
master

搜索帮助