From patchwork Thu Oct 25 16:22:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17594 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 1F06A83228; Thu, 25 Oct 2018 18:24:49 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="abVKbTzk"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver= Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id 7EA44831AC for ; Thu, 25 Oct 2018 18:23:47 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593D355EE7FED32DEE9F3DCBB.dip0.t-ipconnect.de [IPv6:2003:c5:93d3:55ee:7fed:32de:e9f3:dcbb]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 273E4110139; Thu, 25 Oct 2018 18:23:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1540484624; bh=g4d4hqCjYRWKIMaIdeaQXpH5Dn4hhIup/BJf4jkcnyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=abVKbTzkIEpKL3RsKdH5F5of4dy5HEnIHU4bPVkFmGi3ygtFdZ1wtWobjQrfThGkC 7aVyjIRRlhb0PkZj+L8ott24EGuJA725qN62rBldiFZnYYqOnX50WVOcc+HcRoqugk OzwhjfB4p9LbkDDxyrUGBxSeemhgMfxIlceabQqQ= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Thu, 25 Oct 2018 18:22:45 +0200 Message-Id: <20181025162245.19389-43-sven@narfation.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181025162245.19389-1-sven@narfation.org> References: <20181025162245.19389-1-sven@narfation.org> Subject: [B.A.T.M.A.N.] [PATCH v3 42/42] batctl: Allow to enable/disable subcommands X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" Systems with limited space are usually not using all the functionality of batman-adv and of batctl. Still, most of the batctl is still build even when the corresponding batman-adv functionality would not be available. This becomes especially important for subcommands which implement most functionality in userspace when it was previously completely handled by the kernel. An external build system for such system can now just select the commands it really needs. Combining this with link-time-optimizationa and/or function/data-section garbage collection allows to find the right mix between size and functionality. Signed-off-by: Sven Eckelmann --- Makefile | 83 +++++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 48 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index dfcfbd9..e6b2412 100755 --- a/Makefile +++ b/Makefile @@ -20,56 +20,69 @@ # # License-Filename: LICENSES/preferred/GPL-2.0 -# changing the CONFIG_* line to 'y' enables the related feature -# batctl advanced debugging tool bisect: +# just for backward compatibility - please use CONFIG_bisect_iv instead export CONFIG_BATCTL_BISECT=n # batctl build BINARY_NAME = batctl -obj-y += aggregation.o -obj-y += ap_isolation.o obj-y += bat-hosts.o -obj-y += backbonetable.o -obj-$(CONFIG_BATCTL_BISECT) += bisect_iv.o -obj-y += bonding.o -obj-y += bridge_loop_avoidance.o -obj-y += claimtable.o -obj-y += dat_cache.o obj-y += debugfs.o obj-y += debug.o -obj-y += distributed_arp_table.o -obj-y += event.o -obj-y += fragmentation.o obj-y += functions.o -obj-y += gateways.o obj-y += genl.o -obj-y += gw_mode.o obj-y += hash.o obj-y += icmp_helper.o -obj-y += interface.o -obj-y += isolation_mark.o -obj-y += loglevel.o -obj-y += log.o obj-y += main.o -obj-y += mcast_flags.o -obj-y += multicast_mode.o -obj-y += nc_nodes.o -obj-y += neighbors.o obj-y += netlink.o -obj-y += network_coding.o -obj-y += ping.o -obj-y += originators.o -obj-y += orig_interval.o -obj-y += routing_algo.o -obj-y += statistics.o obj-y += sys.o -obj-y += tcpdump.o -obj-y += throughputmeter.o -obj-y += traceroute.o -obj-y += transglobal.o -obj-y += translate.o -obj-y += translocal.o + +define add_command + CONFIG_$(1):=$(2) + ifneq ($$(CONFIG_$(1)),y) + ifneq ($$(CONFIG_$(1)),n) + $$(warning invalid value for parameter CONFIG_$(1): $$(CONFIG_$(1))) + endif + endif + + obj-$$(CONFIG_$(1)) += $(1).o +endef # add_command + +# using the make parameter CONFIG_* (e.g. CONFIG_bisect_iv) with the value 'y' +# enables the related feature and 'n' disables it +$(eval $(call add_command,aggregation,y)) +$(eval $(call add_command,ap_isolation,y)) +$(eval $(call add_command,backbonetable,y)) +$(eval $(call add_command,bisect_iv,$(CONFIG_BATCTL_BISECT))) +$(eval $(call add_command,bonding,y)) +$(eval $(call add_command,bridge_loop_avoidance,y)) +$(eval $(call add_command,claimtable,y)) +$(eval $(call add_command,dat_cache,y)) +$(eval $(call add_command,distributed_arp_table,y)) +$(eval $(call add_command,event,y)) +$(eval $(call add_command,fragmentation,y)) +$(eval $(call add_command,gateways,y)) +$(eval $(call add_command,gw_mode,y)) +$(eval $(call add_command,interface,y)) +$(eval $(call add_command,isolation_mark,y)) +$(eval $(call add_command,log,y)) +$(eval $(call add_command,loglevel,y)) +$(eval $(call add_command,mcast_flags,y)) +$(eval $(call add_command,multicast_mode,y)) +$(eval $(call add_command,nc_nodes,y)) +$(eval $(call add_command,neighbors,y)) +$(eval $(call add_command,network_coding,y)) +$(eval $(call add_command,orig_interval,y)) +$(eval $(call add_command,originators,y)) +$(eval $(call add_command,ping,y)) +$(eval $(call add_command,routing_algo,y)) +$(eval $(call add_command,statistics,y)) +$(eval $(call add_command,tcpdump,y)) +$(eval $(call add_command,throughputmeter,y)) +$(eval $(call add_command,traceroute,y)) +$(eval $(call add_command,transglobal,y)) +$(eval $(call add_command,translate,y)) +$(eval $(call add_command,translocal,y)) MANPAGE = man/batctl.8