Commit Graph

152 Commits

Author SHA1 Message Date
Yousong Zhou 7ccbb9a66c openvswitch: bump to 2.17.9
Refresh and backport patches so that

 - ./python path in the source code takes precedence over the same dir in hostpkg
 - OVN LTS version 22.03.5 which depends on Open vSwitch 3.0 can compile
   with Open vSwitch 2.17

Fixes: https://github.com/openwrt/packages/issues/22744
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2024-02-22 09:31:44 +08:00
Matthias Schiffer db34f33cc7
openvswitch: disable groff manpage check
The openvswitch build trips over a number of warnings during the
manpage-check step if groff 1.23 is installed on the build host,
resulting in a failed build.

As this check is optional, and we don't even install the manpages, simply
override the groff configure check to never detect groff.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2023-09-23 18:10:30 +02:00
Paul Fertser 0c10c224be treewide: remove AUTORELEASE
Automatically compute and substitute current values for all
$(AUTORELEASE) instances as this feature is deprecated and shouldn't be
used.

The following temporary change was made to the core:

diff --git a/rules.mk b/rules.mk
index 57d7995d4fa8..f16367de87a8 100644
--- a/rules.mk
+++ b/rules.mk
@@ -429,7 +429,7 @@ endef
 abi_version_str = $(subst -,,$(subst _,,$(subst .,,$(1))))

 COMMITCOUNT = $(if $(DUMP),0,$(call commitcount))
-AUTORELEASE = $(if $(DUMP),0,$(call commitcount,1))
+AUTORELEASE = $(if $(DUMP),0,$(shell sed -i "s/\$$(AUTORELEASE)/$(call commitcount,1)/" $(CURDIR)/Makefile))

 all:
 FORCE: ;

And this command used to fix affected packages:

for i in $(cd feeds/packages; git grep -l PKG_RELEASE:=.*AUTORELEASE | \
                              sed 's^.*/\([^/]*\)/Makefile^\1^';);
do
  make package/$i/download
done

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2023-04-21 22:46:58 +02:00
Andre Heider e7d9c86503 treewide: refactor to use PKG_BUILD_FLAGS:=lto
See commit 07730ff3 "treewide: add support for "lto" in PKG_BUILD_FLAGS"
on the main repository.

Note: Some packages only added `-flto` to CFLAGS and not LDFLAGS. This
fixes it and properly enables LTO.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-04-08 08:38:54 +02:00
Andre Heider 565866a472 treewide: refactor to use PKG_BUILD_FLAGS:=no-mips16
See commit 5c545bdb "treewide: replace PKG_USE_MIPS16:=0 with
PKG_BUILD_FLAGS:=no-mips16" on the main repository.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-04-08 08:38:54 +02:00
Yousong Zhou b1b37995e1 openvswitch: bump to version 2.17.0
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2022-03-24 12:53:31 +08:00
Stijn Tintel f8c8348f32 openvswitch: bump to 2.15.3
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-03-23 11:21:46 +08:00
Stijn Tintel cf1e146858 openvswitch: enable AUTORELEASE
Enable AUTORELEASE in a separate commit so that the next commit can be
reverted without having to manually re-introduce it.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-03-23 11:21:46 +08:00
Stijn Tintel 6fe18ac4de openvswitch: partially restore kmod-mpls dependency
Enabling OPENVSWITCH in the kernel config selects MPLS. This exposes the
MPLS_ROUTING symbol, which is missing if kmod-mpls is not enabled. On
kernel 5.4 this problem doesn't show up, as the Open vSwitch package
uses the in-tree kernel modules rather than the upstream ones.

Restore the kmod-mpls dependency when using the upstream kernel modules
to fix build.

Reported-by: Matthew Hagan <mnhagan88@gmail.com>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-12-16 13:27:24 +08:00
Matthew Hagan 5ffc45126d openvswitch: fix libunbound dependency check
The ifeq check for CONFIG_OPENVSWITCH_WITH_LIBUNBOUND does not evaluate
correctly within the menuconfig, resulting in libunbound not being
selected, resulting in a failing libunbound.so.8 dependency.

Instead add this condition:dependency in the manner defined in the
OpenWrt developer guide.

Signed-off-by: Matthew Hagan <mathagan@fb.com>
2021-12-16 13:25:37 +08:00
Matthew Hagan 136003c44d openvswitch: Change dependency from append to definition
ovs_libovsdb_depends and ovs_libofproto_depends append the libatomic
dependency. However in these cases these variables were not previously
defined and thus a reader may search the Makefile for the definition.
Therefore change the operator to explicitly define these dependency
variables, rather than append. In addition add a space after operator to
improve readability and conform to other dependency definitions in the
Makefile.

Signed-off-by: Matthew Hagan <mathagan@fb.com>
2021-12-16 13:25:37 +08:00
Matthew Hagan 4e5eb5e0b9 openvswitch: merge dependency lists
Rather than defining dependencies, then appending the libatomic
dependency on the following line, merge all into one definition.
Simultaneously, sort by alphabetical order.

Signed-off-by: Matthew Hagan <mathagan@fb.com>
2021-12-16 13:25:37 +08:00
Stijn Tintel 07c5f565bf openvswitch: document missing options
Commit 1038ac1235 ("openvswitch: add support for definining bridge ports...")
added two new options:
- drop_unknown_ports
- ports
They are missing from the README, so add them.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-11-25 09:36:05 +08:00
Stijn Tintel 596051c77e openvswitch: bring up member ports
Open vSwitch does not bring up ports automatically. This is not a
problem for wireless ports, or for ports configured in
/etc/config/network, but other ports will be down, and require manual
interaction to be brought up. Configuring them with proto none will
cause netifd to do some actions on them, which might cause undefined
results, and will also bloat the UCI config file.

The cleanest solution is to bring all member ports up as part of the
init script.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-11-19 14:15:42 +08:00
Alexandru Ardelean 2648f2e02c openvswitch: remove python-six dependency
Python six was required to build the OVS Python libs during the time when
they were supporting both Python 2 & 3.

Python 3 is a minimum requirement for OVS Python's libs since commits:
  1ca0323e7c
  bd90524550
and Six is no longer required since commit
  0c4d144a98

The end-goal here is to get rid of the Python Six host-build.
OVS is the only user.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2021-11-10 14:32:16 +02:00
Stijn Tintel 9e45d45348 openvswitch: add option for failure mode
When Open vSwitch is configured to use a controller, but is unable to
connect to it, Open vSwitch will setup flows to allow all traffic, if
the failure mode is not configured, or set to standalone.

As this might be a security hazard, it is also possible to configure
Open vSwitch in a secure failure mode. Enabling this mode causes Open
vSwitch to drop all traffic if it is unable to connect to the
controller.

Redirect stderr of the command to /dev/null as it does not support the
--if-exists option.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-09-23 09:15:34 +08:00
Stijn Tintel b2bfb572a3 openvswitch: fix build with libunbound
Due to a copy-paste error, libopenvswitch is missing a dependency when
Open vSwitch is configured to use unbound:

Package openvswitch-libopenvswitch is missing dependencies for the following libraries:
libunbound.so.8

Use the correct config symbol to solve this.

Fixes: 45c8cc9d8a ("openvswitch: make libunbound optional")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-09-23 09:15:34 +08:00
Stijn Tintel c05103da92 openvswitch: add option for OpenFlow datapath desc
Add a UCI config option to set the OpenFlow datapath description. This
allows setting a human readable description of the bridge, e.g.
"Building x, Floor y, AP z", which makes it easier to recognize the AP.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-09-22 20:40:45 +08:00
Stijn Tintel 653716eb19 openvswitch: add SSL support
Open vSwitch supports SSL to connect to an OpenFlow controller. This is
recommended for security. Expand the UCI ovs config section to allow
configuring SSL CA, certificate and private key.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-29 12:30:39 +03:00
Stijn Tintel 2430c4ef82 openvswitch: add missing basescript variable
The Open vSwitch init script does not set USE_PROCD=1. Instead, it
defines most of the functions and variables that would be set when
USE_PROCD is set to 1, but with some minor changes.

The basescript variable however, which is used when calling
procd_open_service and procd_kill, is not set. As a result, basename of
the contents of the initscript variable is used as the service name. As
the service is automatically started via its symlink in /etc/rc.d,
S15openvswitch, the service name is S15openvswitch.

Set the basescript variable so that the service name is openvswitch.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-29 12:30:22 +03:00
Stijn Tintel 4a4c1634e6 openvswitch: support setting OpenFlow datapath ID
By default, Open vSwitch will generate the OpenFlow datapath ID of a
bridge based on the MAC address of one of its ports. Due to this, it's
possible that the datapath ID changes when new ports are added. When the
datapath ID changes, Open vSwitch disconnects from the controller, as
there is no way to notify the controller that the datapath ID has
changed.

Add an option to set the datapath ID so that the above situation can be
avoided. The option takes either exactly 16 hex characters, or when
prefixed with 0x, between 1 and 16 hex characters.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-29 11:02:34 +03:00
Stijn Tintel 5423522944 openvswitch: check correct config symbol
The config symbol is named CONFIG_OPENVSWITCH_WITH_LIBUNBOUND, so check
for that instead of the non-existent CONFIG_OPENVSWITCH_WITH_UNBOUND.

Fixes: 45c8cc9d8a ("openvswitch: make libunbound optional")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-27 23:52:44 +03:00
Stijn Tintel 45c8cc9d8a openvswitch: make libunbound optional
Installing openvswitch on an x86/64 snapshot image pulls in a bunch of
dependencies, good for a total size of 3648406 byte. Disabling
libunbound reduces that with 559941 byte, for a total of 3088465 byte.
This is quite a big reduction for a small tradeoff: without libunbound,
hostnames can not be used to specify OpenFlow managers or controllers.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-26 18:25:13 +03:00
Stijn Tintel eff5adb9a3 openvswitch: allow complex port configurations
The current way to add ports to an Open vSwitch bridge does not allow
complex port configurations. Use a dedicated uci config section per port
instead of the current port:type syntax. This way we can easily support
more features like setting the VLAN tag or the OpenFlow port number.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-23 12:16:29 +03:00
Stijn Tintel a5648280b3 openvswitch: only init bridges when (re)starting
Calling the ovs_bridge_init function when stopping the service will
result in ovs-vsctl being called after ovsdb-server has been shut down.
This causes the following error:

ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (No such file or directory)

Calling the ovs_bridge_init function when requesting the service status
has no added value.

Only call ovs_bridge_init during start or restart to fix this.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-23 12:16:29 +03:00
Stijn Tintel 261961a33c openvswitch: refresh patches
CI run fails due to dirty patches, so refresh them.

Fixes: f4f1a25e80 ("openvswitch: bump to version 2.15.0")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-23 12:16:29 +03:00
Felix Fietkau ec56b98a7e openvswitch: close flock fd when starting openvswitch services
Fixes deadlock with multiple init script calls

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-20 14:26:55 +02:00
Felix Fietkau 1038ac1235 openvswitch: add support for definining bridge ports in the config
Add limited procd support to handle config reload
Option drop_unknown_ports can be used to ensure that only configured ports
are part of the bridge

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-06-23 15:49:28 +02:00
Yousong Zhou f4f1a25e80 openvswitch: bump to version 2.15.0
Quote NEWS item

>   - Building the Linux kernel module from the OVS source tree is
>     deprecated
>     * Support for the Linux kernel is capped at version 5.8
>     * Only bug fixes for the Linux OOT kernel module will be accepted.
>     * The Linux kernel module will be fully removed from the OVS source
>       tree
>       in OVS branch 2.18

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2021-02-24 20:36:27 +08:00
Ilya Lipnitskiy 5d8d4fbbcb
treewide: Run refresh on all packages
The crude loop I wrote to come up with this changeset:

  find -L package/feeds/packages/ -name patches | \
  sed 's/patches$/refresh/' | sort | xargs make

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-02-20 16:02:15 -08:00
Florian Eckert 7184a471ef openvswitch: use new extra_command function definition
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-11-04 08:50:34 +01:00
Adrian Schmutzler 4b65ea569a openvswitch: remove support for kernel 4.14 and 4.9
Support for kernel 4.14 has been removed in main repo, so drop the
dependencies here as well (and those for even older 4.9).

Also drop a patch that is required only for 4.14 and lower.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-02 22:58:15 +08:00
Yousong Zhou 282038d97b openvswitch: bump to version 2.14.0
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-08-25 15:50:32 +08:00
Matthias Schiffer 8bb7659f08 openvswitch: backport patch to fix build against kernel 4.14.193
(and possibly other recent stable kernels)

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2020-08-15 09:19:59 +08:00
Yousong Zhou 3f383103ee openvswitch: bump to version 2.13.1
The two backported patches are included in 2.13.1

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-08-10 20:38:49 +08:00
Yousong Zhou a00671bf86 openvswitch: remove explicit dependency on librt
Selection of librt will be handled by the build system

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-07-30 11:54:34 +08:00
Yousong Zhou 52e074411b openvswitch: only libopenvswitch depends on libunbound, libunwind
This is to make explicit the conditional select of libunwind is only
needed for libopenvswitch.  If we spill it over other packages, the
generated kconfig will have recursive dependency issue.  2 new patches
were made for this goal

The other thing is that "+libunwind" will cause it to be built if any of the
packages defined in this Makefile is enabled (y or m).  This is at the moment
by-design of the build system.

Libunwind does not support architectures like arc.  Use conditional select To
avoid (libunwind) build failures like the following,

  checking for ELF helper width... configure: error: Unknown ELF target: arc
  make[3]: *** [Makefile:65: /data/openwrt/build_dir/target-arc_arc700_uClibc/
  libunwind-1.3.1/.configured_68b329da9893e34099c7d8ad5cb9c940] Error 1

Things like "+PACKAGE_openvswitch-libopenvswitch:libunwind" will also result in
recursive deps error for chains of 3 nodes.  Kconfig construct like the
following will be made

	config A
		tristate
		select B
		depends on !(C) || (x)

	config B
		tristate
		select C

	config C
		tristate

	config x
		bool

Other changes include

 - Shared use of variable ovs__common_depends was removed
 - Ovn doc build was patched out

Link: https://github.com/openwrt/packages/pull/12959#issuecomment-665021413
Reported-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-07-30 10:02:13 +08:00
Yousong Zhou f69f4f3fae openvswitch: rename shared var name ovs{,_}_common_depends
To avoid conflict with package ovs_common_depends of package
openvswitch-common

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-07-30 10:02:13 +08:00
Yousong Zhou acca35d460 openvswitch: backport patch fixing build for 4.14.187
Supersedes openwrt/packages#12932

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-07-30 10:02:13 +08:00
Simon Kinane d7507146e8 openvswitch: adds new UCI section ovs_bridge
This new config section in package openvswitch
supports creating a named bridge, and setting
its' OpenFlow controller end-point.

An example config is included in /rom/etc/config/openvswitch

Signed-off-by: Simon Kinane <skinane@fb.com>
2020-07-28 12:46:17 +08:00
Yousong Zhou 26291bba4e openvswitch: pass KERNEL_MAKE_FLAGS for reproducible build
Reported-by: Paul Spooren <mail@aparcar.org>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-05-27 16:38:56 +08:00
Yousong Zhou 931ff98633 openvswitch: rework disabling docs build
This is needed since openvswitch 2.13 commit 2a97891eb23b
("Documentation: Work with sphinx-build for Python 3 also.")

The 4th patch was also reworked to serve as another guard

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-05-27 16:38:56 +08:00
Yousong Zhou 1091badd83 openvswitch: fix file generation in /etc/modules.d
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Reported-by: Paul Spooren <mail@aparcar.org>
2020-05-20 23:29:44 +08:00
Huangbin Zhan 0ec746ccb6 treewide: add conffiles
Signed-off-by: Huangbin Zhan <zhanhb88@gmail.com>
2020-05-09 06:06:43 +08:00
Jeffery To 1bc2f4f3c6 treewide: Remove Python variants for non-Python packages
This removes Python-related build variants, and adds
PYTHON3_PKG_BUILD:=0 and minor build adjustments (where appropriate),
for non-Python packages. There should be no changes to build output.

This also updates some include paths for python3-package.mk and/or
python3-host.mk to be relative to the package Makefile.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-04-19 01:56:23 +08:00
Yousong Zhou 88dcd09487 openvswitch: depend on IPV6 for intree kmods
Ref: https://github.com/openwrt/packages/issues/11665
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-03-26 15:50:34 +08:00
Yousong Zhou 07d6310d2f openvswitch: unset CONFIG_AUTOREMOVE
Phase 2 buildbots with this option enabled will cleanup openvswitch
build dir which is needed later when building ovn

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-03-26 15:50:34 +08:00
Yousong Zhou 0fa07ed578 openvswitch: openvswitch.mk: add ovs_common_depends variable
This is to address the need that openvswitch starting with 2.13 now
depends on libunwind for handling SIGSEGV (upstream commit e2ed6fbeb18
("fatal-signal: Catch SIGSEGV and print backtrace"))

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-03-24 10:45:57 +08:00
Yousong Zhou bf4f584e75 openvswitch: bump to version 2.13.0
python2 library is now removed as the transition has been done by the
upstream project

OVN is now a separate project released with its own release plan and
it's not included within openvswitch starting with ovs 2.13.

openvswitch.mk is split out from the main Makefile for adding ovn
packages back in following commits.

The following two patches are already included in 2.13

 - ovsdb-idlc-fix-dict-change-during-iteration.patch
 - compat-Include-confirm_neigh-parameter-if-needed.patch

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-03-23 16:07:24 +08:00
Yousong Zhou e9d6414437 openvswitch: fix PIE build against 4.14 kernel
Reported-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Ref: https://github.com/openwrt/packages/pull/11567
2020-03-16 15:26:17 +08:00