[commits] [openwrt-feed-devel] master: batctl-devel: Provide different build variants (fc8e2c4)

postmaster at open-mesh.org postmaster at open-mesh.org
Sat Mar 9 13:02:38 CET 2019


Repository : ssh://git@open-mesh.org/openwrt-feed-devel

On branch  : master

>---------------------------------------------------------------

commit fc8e2c44bc079fdcea594899451388352c98e780
Author: Sven Eckelmann <sven at narfation.org>
Date:   Sun Jan 6 13:23:42 2019 +0100

    batctl-devel: Provide different build variants
    
    The batctl binary is currently optional for batman-adv installations. But
    new configuration settings will only be exposed via generic netlink. The
    batctl tool will therefore be required to modify them.
    
    To also fit batctl in some of the smaller devices, a new variant tiny is
    build which only provides the settings subcommands. The default variant is
    equal to the old batctl package and full also provides the commands which
    were disabled until now.
    
    There are no actual variant package builds but only a configuration
    settings. The actual openwrt-routing package requires variant package
    builds but this would conflict with the per package build settings of the
    batctl-devel package.
    
    Signed-off-by: Sven Eckelmann <sven at narfation.org>


>---------------------------------------------------------------

fc8e2c44bc079fdcea594899451388352c98e780
 batctl-devel/Config.devel.in |  35 ++++++++-----
 batctl-devel/Makefile        | 121 ++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 141 insertions(+), 15 deletions(-)

diff --git a/batctl-devel/Config.devel.in b/batctl-devel/Config.devel.in
index fbdd9a9..5aa9810 100644
--- a/batctl-devel/Config.devel.in
+++ b/batctl-devel/Config.devel.in
@@ -1,6 +1,24 @@
-if PACKAGE_batctl-devel
+choice
+	depends on PACKAGE_batctl-devel
+
+	prompt "Build variant"
+	default default
+
+	config batctl-devel_tiny
+		bool "tiny"
+
+	config batctl-devel_default
+		bool "default"
+
+	config batctl-devel_full
+		bool "full"
+
+endchoice
+
 
 choice
+	depends on PACKAGE_batctl-devel
+
 	prompt "Selected batctl-devel download method"
 	default batctl-devel_SOURCE_GIT
 
@@ -12,14 +30,11 @@ choice
 
 endchoice
 
-endif
-
-if batctl-devel_SOURCE_GIT
 
 config batctl-devel_REPOSITORY
 	string
 	prompt "batctl-devel repository to build"
-	depends on PACKAGE_batctl-devel
+	depends on batctl-devel_SOURCE_GIT
 	default "https://git.open-mesh.org/batctl.git"
 	help
 		Enter a batctl-devel repository url
@@ -27,24 +42,18 @@ config batctl-devel_REPOSITORY
 config batctl-devel_BRANCH
 	string
 	prompt "batctl-devel branch to build"
-	depends on PACKAGE_batctl-devel
+	depends on batctl-devel_SOURCE_GIT
 	default "master"
 	help
 		Enter a batctl branch name or git tag to override package
 		default value. This allows to build from non-master branches
 		to test unreleased features.
 
-endif
-
-
-if batctl-devel_SOURCE_DIRECTORY
 
 config batctl-devel_DIRECTORY
 	string
 	prompt "batctl-devel source directory"
-	depends on PACKAGE_batctl-devel
+	depends on batctl-devel_SOURCE_DIRECTORY
 	default "/tmp/batctl-devel"
 	help
 		Enter a batctl-devel source directory
-
-endif
diff --git a/batctl-devel/Makefile b/batctl-devel/Makefile
index 45d61f5..340c316 100644
--- a/batctl-devel/Makefile
+++ b/batctl-devel/Makefile
@@ -33,6 +33,8 @@ PKG_LICENSE:=GPL-2.0
 PKG_REV?=0
 PKG_VERSION?=0.$(PKG_REV)
 
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/batctl-devel
@@ -40,8 +42,9 @@ define Package/batctl-devel
   SECTION:=net
   CATEGORY:=Network
   DEPENDS:=+kmod-batman-adv-devel +libnl-tiny +libc +librt
-  TITLE:=B.A.T.M.A.N. Advanced user space configuration tool batctl
+  PROVIDES:=batctl-devel
   MAINTAINER:=Simon Wunderlich <sw at simonwunderlich.de>
+  TITLE:=B.A.T.M.A.N. Advanced user space configuration tool (Default)
 endef
 
 define Package/batctl-devel/description
@@ -82,6 +85,119 @@ MAKE_BATCTL_ARGS += \
         batctl install \
         REVISION="openwrt-$(PKG_VERSION)"
 
+config-n := \
+	aggregation \
+	ap_isolation \
+	backbonetable \
+	bisect_iv \
+	bonding \
+	bridge_loop_avoidance \
+	claimtable \
+	dat_cache \
+	distributed_arp_table \
+	event \
+	fragmentation \
+	gateways \
+	gw_mode \
+	hop_penalty \
+	interface \
+	isolation_mark \
+	log \
+	loglevel \
+	mcast_flags \
+	multicast_mode \
+	nc_nodes \
+	neighbors \
+	network_coding \
+	orig_interval \
+	originators \
+	ping \
+	routing_algo \
+	statistics \
+	tcpdump \
+	throughputmeter \
+	traceroute \
+	transglobal \
+	translate \
+	translocal \
+
+config-settings := \
+	aggregation \
+	ap_isolation \
+	bonding \
+	bridge_loop_avoidance \
+	distributed_arp_table \
+	fragmentation \
+	gw_mode \
+	hop_penalty \
+	interface \
+	isolation_mark \
+	loglevel \
+	multicast_mode \
+	network_coding \
+	orig_interval \
+	routing_algo \
+
+config-tables := \
+	backbonetable \
+	claimtable \
+	dat_cache \
+	gateways \
+	loglevel \
+	nc_nodes \
+	neighbors \
+	originators \
+	statistics \
+	transglobal \
+	translocal \
+
+config-tools := \
+	event \
+	log \
+	ping \
+	tcpdump \
+	throughputmeter \
+	traceroute \
+	translate \
+
+config-extratools := \
+	bisect_iv \
+
+ifdef CONFIG_batctl-devel_tiny
+
+config-y := \
+	$(config-settings) \
+
+endif
+
+ifdef CONFIG_batctl-devel_default
+
+config-y := \
+	$(config-settings) \
+	$(config-tables) \
+	$(config-tools) \
+
+endif
+
+ifdef CONFIG_batctl-devel_full
+
+config-y := \
+	$(config-settings) \
+	$(config-tables) \
+	$(config-tools) \
+	$(config-extratools) \
+
+endif
+
+define ConfigVars
+$(subst $(space),,$(foreach opt,$(config-$(1)),CONFIG_$(opt)=$(1)
+))
+endef
+
+define batctl_config
+$(call ConfigVars,n)$(call ConfigVars,y)
+endef
+$(eval $(call shexport,batctl_config))
 
 ifdef CONFIG_batctl-devel_SOURCE_DIRECTORY
 
@@ -94,7 +210,8 @@ endef
 endif
 
 define Build/Compile
-	$(MAKE_BATCTL_ENV) $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_BATCTL_ARGS)
+	$(MAKE_BATCTL_ENV) $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_BATCTL_ARGS) \
+		$$$$$(call shvar,batctl_config)
 endef
 
 define Package/batctl-devel/install



More information about the commits mailing list