From a6ec885522ced8185cfe66c0ab467d902f043b65 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Thu, 20 Jun 2019 03:22:45 +0000 Subject: [PATCH] openvswitch: rework skipping intree kmod build for unsupported kernels This is a workaround to prevent the whole build from failing because of the intree kmods are not supported yet by upstream project. Root cause is that kernel version should not play a part when making DEPENDS as the generated kconfig was for all targets that may have different kernel versions. One less than ideal effect of this change is that for an unsupported kernel version, people can still select the intree kmod but it won't be built. This may contradict expectation if the warning was not noticed by them Resolves openwrt/packages#9274 Signed-off-by: Yousong Zhou --- net/openvswitch/Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/net/openvswitch/Makefile b/net/openvswitch/Makefile index 57942fe42..e14acb7c3 100644 --- a/net/openvswitch/Makefile +++ b/net/openvswitch/Makefile @@ -49,12 +49,13 @@ ovs_kmod_is_intree=$(filter %-intree,$(1)) ovs_kmod_upstream_name=kmod-$(call ovs_kmod_package_name,$(patsubst %-intree,%,$(1))) ovs_kmod_package_provides=$(call ovs_kmod_upstream_name,$(1)) define OvsKmodPackageTemplate +ifeq ($(if $(call ovs_kmod_is_intree,$(1)),$(ovs_kmod_intree_not_supported)),) define KernelPackage/$(call ovs_kmod_package_name,$(1)) SECTION:=kernel CATEGORY:=Kernel modules SUBMENU:=Network Support TITLE:=$(ovs_kmod_$(1)_title) - DEPENDS:=$(ovs_kmod_$(1)_depends) $(if $(call ovs_kmod_is_intree,$(1)),@DEVEL $(if $(ovs_kmod_intree_not_supported),@BROKEN)) + DEPENDS:=$(ovs_kmod_$(1)_depends) $(if $(call ovs_kmod_is_intree,$(1)),@DEVEL) PROVIDES:=$(call ovs_kmod_package_provides,$(1)) KCONFIG:=$(ovs_kmod_$(1)_kconfig) FILES:=$(ovs_kmod_$(1)_files) @@ -62,6 +63,7 @@ define OvsKmodPackageTemplate endef ovs_kmod_packages+=$(call ovs_kmod_package_name,$(1)) +endif endef ovs_kmod_openvswitch_title:=Open vSwitch kernel datapath (upstream) @@ -311,7 +313,11 @@ ovs_intree_kmod_configs:=CONFIG_PACKAGE_kmod-openvswitch-intree ovs_intree_kmod_enabled:=$(strip $(foreach c,$(ovs_intree_kmod_configs),$($(c)))) PKG_CONFIG_DEPENDS+=$(ovs_intree_kmod_configs) ifneq ($(ovs_intree_kmod_enabled),) - CONFIGURE_ARGS += --with-linux=$(LINUX_DIR) + ifeq ($(ovs_kmod_intree_not_supported),) + CONFIGURE_ARGS += --with-linux=$(LINUX_DIR) + else + $(warning XXX: openvswitch: intree kmods selected but not supported) + endif endif TARGET_CFLAGS += -flto -std=gnu99