openvswitch: multiple fixes for 2.10
authorYousong Zhou <yszhou4tech@gmail.com>
Wed, 5 Sep 2018 10:21:45 +0000 (10:21 +0000)
committerYousong Zhou <yszhou4tech@gmail.com>
Sun, 9 Sep 2018 01:51:14 +0000 (09:51 +0800)
 - initscript: skip when ctl scripts are absent.  When only ovs is
   installed, this will quash error messages of ovn-ctl not found when
   invoking stop
 - openvswitch-common: include ovs-kmod-ctl
 - patches: ovs-save: compatible with busybox ip command

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
net/openvswitch/Makefile
net/openvswitch/files/openvswitch.init
net/openvswitch/files/ovs-ctl-wrapper
net/openvswitch/patches/0100-netdev-linux-Use-unsigned-int-for-ifi_flags.patch
net/openvswitch/patches/0101-netdev-linux-Let-interface-flag-survive-internal-por.patch
net/openvswitch/patches/0102-python-separate-host-target-python-for-cross-compile.patch
net/openvswitch/patches/0103-ovs-ctl-fix-setting-hostname.patch
net/openvswitch/patches/0104-ovs-lib-fix-install_dir.patch
net/openvswitch/patches/0105-build-disable-building-tests.patch
net/openvswitch/patches/0106-ovs-save-compatible-with-busybox-ip-command.patch [new file with mode: 0644]

index afe10ee35e2308cca12c3fcda8c810c59ff2863f..373ca8c2680606c5c2dcaa9aeb103a4619ab0688 100644 (file)
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=openvswitch
 PKG_VERSION:=2.10.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.openvswitch.org/releases/
 PKG_HASH:=64f7cdcfffc73b2e09980d04ee22731eadd6453698b92d7397c9e45c7c174050
@@ -173,6 +173,7 @@ ovs_common_depends:=+librt +openvswitch-libopenvswitch +openvswitch-libofproto +
 ovs_common_files:= \
        usr/share/openvswitch/scripts/ovs-lib \
        usr/share/openvswitch/scripts/ovs-ctl \
+       usr/share/openvswitch/scripts/ovs-kmod-ctl \
        usr/share/openvswitch/scripts/ovs-save \
        $(foreach b,ovs-appctl ovs-dpctl ovs-ofctl ovs-vsctl ovsdb-client ovsdb-tool,usr/bin/$(b))
 define ovs_common_install
@@ -184,6 +185,7 @@ define ovs_common_install
        $$(INSTALL_DIR) $$(1)/usr/share/openvswitch/scripts
        $$(INSTALL_BIN) ./files/ovs-ctl-wrapper $$(1)/usr/share/openvswitch/scripts/
        $$(LN) /usr/share/openvswitch/scripts/ovs-ctl-wrapper $$(1)/usr/bin/ovs-ctl
+       $$(LN) /usr/share/openvswitch/scripts/ovs-ctl-wrapper $$(1)/usr/bin/ovs-kmod-ctl
 endef
 define Package/openvswitch-common/conffiles
 /etc/openvswitch
index 3af1b1e405a39eb2767196603e0c95d29ffcb922..f504bb63a30ad75d99544ca37b2e8f747b34f54c 100755 (executable)
@@ -6,8 +6,8 @@
 START=15
 
 ovs_script_dir=/usr/share/openvswitch/scripts
-ovs_ctl="$ovs_script_dir/ovs-ctl"
-ovn_ctl="$ovs_script_dir/ovn-ctl"
+ovs_ctl="$ovs_script_dir/ovs-ctl"; [ -x "$ovs_ctl" ] || ovs_ctl=:
+ovn_ctl="$ovs_script_dir/ovn-ctl"; [ -x "$ovn_ctl" ] || ovn_ctl=:
 
 EXTRA_COMMANDS=status
 
index 20f3446125966bbbeb06e13b30f74d2cb3592da2..88ae72429cc4ad1fdad8a56d86281905d2e0df3b 100755 (executable)
@@ -3,6 +3,7 @@
 s=/usr/share/openvswitch/scripts
 case "$0" in
        *ovs-ctl) "$s/ovs-ctl" "$@" ;;
+       *ovs-kmod-ctl) "$s/ovs-kmod-ctl" "$@" ;;
        *ovn-ctl) "$s/ovn-ctl" "$@" ;;
        *) exit 1;;
 esac
index 0c7022d6e751aa2fe72b2d3f5e705f0f825c41b3..bee18d38327454432dcf95d426dc6c4c12614ff9 100644 (file)
@@ -1,7 +1,7 @@
-From 054968d5748c9ff73a69155cd64f0e81287d3bb3 Mon Sep 17 00:00:00 2001
+From e4ac9741a99866976322c21605b312bc27633c92 Mon Sep 17 00:00:00 2001
 From: Helmut Schaa <helmut.schaa@googlemail.com>
 Date: Wed, 8 Jan 2014 13:48:33 +0100
-Subject: [PATCH 100/105] netdev-linux: Use unsigned int for ifi_flags
+Subject: [PATCH 100/106] netdev-linux: Use unsigned int for ifi_flags
 
 ifi_flags is unsigned, the local equivalents should do the same.
 
index 29fbc14b20a6d4d4b99654eb2e8082070586d573..04b50ee413cceecffc43c2cf0f1b23921e4d775d 100644 (file)
@@ -1,7 +1,7 @@
-From a3eabe1e639c98ce8537df4ac4187a8c047dac59 Mon Sep 17 00:00:00 2001
+From 9f4775d9a2541e8128ea99f3b02925cc1ee05374 Mon Sep 17 00:00:00 2001
 From: Helmut Schaa <helmut.schaa@googlemail.com>
 Date: Wed, 8 Jan 2014 13:48:49 +0100
-Subject: [PATCH 101/105] netdev-linux: Let interface flag survive internal
+Subject: [PATCH 101/106] netdev-linux: Let interface flag survive internal
  port setup
 
 Due to a race condition when bringing up an internal port on Linux
index 01368beac0cc33f582061c45a5c6f305aed489cc..cd5af930fbf783285952b7bbb19011ac30ae2bba 100644 (file)
@@ -1,7 +1,7 @@
-From b5c6d8c2e1ba0c3d9b93622f68f6c0b9e9c62f0d Mon Sep 17 00:00:00 2001
+From e451d74788c73e8679e6a2268185a08901ac7f8c Mon Sep 17 00:00:00 2001
 From: Yousong Zhou <zhouyousong@yunionyun.com>
 Date: Tue, 21 Aug 2018 12:21:05 +0000
-Subject: [PATCH 102/105] python: separate host/target python for cross-compile
+Subject: [PATCH 102/106] python: separate host/target python for cross-compile
 
 At the moment, python-six is a requirement for openvswitch python
 library on target machine.
index 8124fd843be6ecad89d476a8029c4c9132222721..43e022defbdaa22e4d90cd7bd3520f8992e17c69 100644 (file)
@@ -1,7 +1,7 @@
-From 0b8ef58a26ed8d426acfe1fa27713cbcc2427f3f Mon Sep 17 00:00:00 2001
+From 6b9732c8851c5466f2a363d88b5acae320801efe Mon Sep 17 00:00:00 2001
 From: Yousong Zhou <yszhou4tech@gmail.com>
 Date: Wed, 14 Mar 2018 16:40:01 +0800
-Subject: [PATCH 103/105] ovs-ctl: fix setting hostname
+Subject: [PATCH 103/106] ovs-ctl: fix setting hostname
 
 The command "hostname" is not available in OpenWrt by default.
 
index e1a40d0b5019d80c0beea17c5068c92d4255084f..17e63382615d7dc1d912535a57d3add614e361f9 100644 (file)
@@ -1,7 +1,7 @@
-From 97107da940da7814c3e9e947aee1c247cd7b95db Mon Sep 17 00:00:00 2001
+From 940441e2982cb35765830060e8203e5dd1a0f967 Mon Sep 17 00:00:00 2001
 From: Yousong Zhou <yszhou4tech@gmail.com>
 Date: Wed, 14 Mar 2018 16:44:13 +0800
-Subject: [PATCH 104/105] ovs-lib: fix install_dir()
+Subject: [PATCH 104/106] ovs-lib: fix install_dir()
 
 The command "install" is not available in OpenWrt by default
 
index 4d52a4c1771ab038935711b9607fe0a34d4c3868..4372d9f84ec0d0ca48c6f40c3273e72bed77f7a3 100644 (file)
@@ -1,7 +1,7 @@
-From f5c6e5d4c567f3705de503b7271d384d1aad88ab Mon Sep 17 00:00:00 2001
+From d0cad5ac122aca722dc2013c1f53fda44c477cf2 Mon Sep 17 00:00:00 2001
 From: Yousong Zhou <zhouyousong@yunionyun.com>
 Date: Tue, 21 Aug 2018 13:02:21 +0000
-Subject: [PATCH 105/105] build: disable building tests
+Subject: [PATCH 105/106] build: disable building tests
 
 Signed-off-by: Yousong Zhou <zhouyousong@yunionyun.com>
 ---
diff --git a/net/openvswitch/patches/0106-ovs-save-compatible-with-busybox-ip-command.patch b/net/openvswitch/patches/0106-ovs-save-compatible-with-busybox-ip-command.patch
new file mode 100644 (file)
index 0000000..9e04966
--- /dev/null
@@ -0,0 +1,26 @@
+From 2a59f2b60e8a22dc93d48c511b5c4255b429ff66 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <zhouyousong@yunionyun.com>
+Date: Wed, 5 Sep 2018 12:32:54 +0000
+Subject: [PATCH 106/106] ovs-save: compatible with busybox ip command
+
+Busybox ip command will have exit code 1 for `ip -V` or `ip help` etc.,
+use `ip rule list` to cover both iproute2 and busybox ip command
+
+Signed-off-by: Yousong Zhou <zhouyousong@yunionyun.com>
+---
+ utilities/ovs-save | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utilities/ovs-save b/utilities/ovs-save
+index ea8fb6a45..72d460df4 100755
+--- a/utilities/ovs-save
++++ b/utilities/ovs-save
+@@ -38,7 +38,7 @@ EOF
+ }
+ save_interfaces () {
+-    if (ip -V) > /dev/null 2>&1; then :; else
++    if (ip rule list) > /dev/null 2>&1; then :; else
+         echo "$0: ip not found in $PATH" >&2
+         exit 1
+     fi