[commits] [openwrt-feed-batman-adv] master: batman-adv: split kmod and userland into separate packages (bc2d116)

postmaster at open-mesh.org postmaster at open-mesh.org
Sun Feb 16 10:09:35 CET 2014


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

On branch  : master

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

commit bc2d11655a94112687e5e43bd547561d3e22ce41
Author: Russell Senior <russell at personaltelco.net>
Date:   Thu Feb 13 16:40:38 2014 -0800

    batman-adv: split kmod and userland into separate packages
    
    Creates a new package, batctl, split out from batman-adv package.
    Simplifies the Makefiles, allows QUILT patch management wto work,
    removes the quirky patch naming requirement.  Modified Config.in to
    work as before with batctl, except now with PACKAGE_batctl.
    
    Signed-off-by: Russell Senior <russell at personaltelco.net>
    Signed-off-by: Marek Lindner <mareklindner at neomailbox.ch>


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

bc2d11655a94112687e5e43bd547561d3e22ce41
 batctl-devel/Makefile      |   80 ++++++++++++++++++++++++++++++++++++++++++++
 batman-adv-devel/Config.in |   18 ----------
 batman-adv-devel/Makefile  |   70 ++------------------------------------
 3 files changed, 83 insertions(+), 85 deletions(-)

diff --git a/batctl-devel/Makefile b/batctl-devel/Makefile
new file mode 100644
index 0000000..e119851
--- /dev/null
+++ b/batctl-devel/Makefile
@@ -0,0 +1,80 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=batctl-devel
+
+PKG_VERSION:=abe78a50dd868167121e11f37b166c8193816999
+PKG_BATCTL_SHORTREV:=$(shell echo $(PKG_VERSION) | cut -c1-7)
+PKG_BATCTL_FNAME:=batctl-devel-$(PKG_BATCTL_SHORTREV).tar.gz
+PKG_BATCTL_DIR:=batctl-$(PKG_BATCTL_SHORTREV)
+
+PKG_SOURCE_URL:=http://git.open-mesh.org/snapshot/
+PKG_SOURCE:=$(PKG_BATCTL_FNAME)
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_BATCTL_DIR)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/batctl-devel
+  URL:=http://www.open-mesh.org/
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+kmod-batman-adv-devel +libnl-tiny +libc
+  TITLE:=B.A.T.M.A.N. Advanced user space configuration tool batctl
+  MAINTAINER:=Marek Lindner <mareklindner at neomailbox.ch>
+endef
+
+define Package/batctl-devel/description
+batctl is a more intuitive managment utility for B.A.T.M.A.N.-Advanced.
+It is an easier method for configuring batman-adv and provides some
+additional tools for debugging as well. This package builds the latest
+development version ($(PKG_BATCTL_SHORTREV)).
+endef
+
+# The linker can identify unused sections of a binary when each symbol is stored
+# in a separate section. This mostly removes unused linker sections and reduces
+# the size by ~3% on mipsel.
+
+TARGET_CFLAGS  += -ffunction-sections -fdata-sections
+TARGET_LDFLAGS += -Wl,--gc-sections
+
+# Link-time optimization allows to move parts of the optimization from the single
+# source file to the global source view. This is done by emitting the GIMPLE
+# representation in each object file and analyzing it again during the link step.
+
+TARGET_CFLAGS  += -flto
+TARGET_LDFLAGS += -fuse-linker-plugin
+
+MAKE_BATCTL_ENV += \
+        CPPFLAGS="$(TARGET_CPPFLAGS)" \
+        CFLAGS="$(TARGET_CFLAGS)" \
+        LDFLAGS="$(TARGET_LDFLAGS)" \
+        LIBNL_NAME="libnl-tiny"
+
+MAKE_BATCTL_ARGS += \
+        REVISION="$(PKG_BATCTL_SHORTREV)" \
+        CC="$(TARGET_CC)" \
+        DESTDIR="$(PKG_INSTALL_DIR)" \
+        batctl install
+
+
+define Build/Compile
+	$(MAKE_BATCTL_ENV) $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_BATCTL_ARGS)
+endef
+
+define Build/Clean
+	rm -rf $(BUILD_DIR)/$(PKG_NAME)/
+endef
+
+define Package/batctl-devel/install
+	$(INSTALL_DIR) $(1)/usr/sbin
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/batctl $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,batctl-devel))
diff --git a/batman-adv-devel/Config.in b/batman-adv-devel/Config.in
index 67b4c8a..82f0905 100644
--- a/batman-adv-devel/Config.in
+++ b/batman-adv-devel/Config.in
@@ -19,15 +19,6 @@ config KMOD_BATMAN_ADV_DEVEL_NC
 	depends on PACKAGE_kmod-batman-adv-devel
 	default n
 
-config KMOD_BATMAN_ADV_DEVEL_BATCTL
-	bool "enable batctl"
-	depends on PACKAGE_kmod-batman-adv-devel
-	default y
-	help
-		batctl is a more intuitive managment utility for B.A.T.M.A.N.-Advanced.
-		It is an easier method for configuring batman-adv and
-		provides some additional tools for debugging as well.
-
 config KMOD_BATMAN_ADV_DEVEL_BATMAN_REV
 	string
 	prompt "batman-adv git revision to build package with"
@@ -38,12 +29,3 @@ config KMOD_BATMAN_ADV_DEVEL_BATMAN_REV
 		default value. This allows to build from non-master branches
 		to test unreleased features.
 
-config KMOD_BATMAN_ADV_DEVEL_BATCTL_REV
-	string
-	prompt "batctl git revision to build package with"
-	depends on PACKAGE_kmod-batman-adv-devel
-	default "abe78a5"
-	help
-		Enter the full or shortened git revision to override package
-		default value. This allows to build from non-master branches
-		to test unreleased features.
diff --git a/batman-adv-devel/Makefile b/batman-adv-devel/Makefile
index 25699fe..39bbb2f 100644
--- a/batman-adv-devel/Makefile
+++ b/batman-adv-devel/Makefile
@@ -11,29 +11,24 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=batman-adv-devel
 
 PKG_BATMAN_REV:=$(CONFIG_KMOD_BATMAN_ADV_DEVEL_BATMAN_REV)
-PKG_BATCTL_REV:=$(CONFIG_KMOD_BATMAN_ADV_DEVEL_BATCTL_REV)
 
 PKG_BATMAN_SHORTREV:=$(shell echo $(PKG_BATMAN_REV) | cut -c1-7)
 PKG_BATMAN_FNAME:=batman-adv-devel-$(PKG_BATMAN_SHORTREV).tar.gz
 PKG_BATMAN_DIR:=batman-adv-$(PKG_BATMAN_SHORTREV)
-PKG_BATCTL_SHORTREV:=$(shell echo $(PKG_BATCTL_REV) | cut -c1-7)
-PKG_BATCTL_FNAME:=batctl-devel-$(PKG_BATCTL_SHORTREV).tar.gz
-PKG_BATCTL_DIR:=batctl-$(PKG_BATCTL_SHORTREV)
 
 PKG_SOURCE_URL:=http://git.open-mesh.org/snapshot/
 PKG_SOURCE:=$(PKG_BATMAN_FNAME)
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_BATMAN_DIR)
-PKG_BATCTL_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_BATCTL_DIR)
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 define KernelPackage/batman-adv-devel
   URL:=http://www.open-mesh.org/
-  MAINTAINER:=Marek Lindner <lindner_marek at yahoo.de>
+  MAINTAINER:=Marek Lindner <mareklindner at neomailbox.ch>
   SUBMENU:=Network Support
-  DEPENDS:=+KMOD_BATMAN_ADV_DEVEL_BLA:kmod-lib-crc16 +kmod-crypto-core +kmod-crypto-crc32c +kmod-lib-crc32c +libc +KMOD_BATMAN_ADV_DEVEL_BATCTL:libnl-tiny
+  DEPENDS:=+KMOD_BATMAN_ADV_DEVEL_BLA:kmod-lib-crc16 +kmod-crypto-core +kmod-crypto-crc32c +kmod-lib-crc32c
   TITLE:=B.A.T.M.A.N. Adv devel
   FILES:=$(PKG_BUILD_DIR)/batman-adv.$(LINUX_KMOD_SUFFIX)
   AUTOLOAD:=$(call AutoLoad,50,batman-adv)
@@ -42,8 +37,7 @@ endef
 define KernelPackage/batman-adv-devel/description
 B.A.T.M.A.N. advanced is a kernel module which allows to
 build layer 2 mesh networks. This package builds the latest
-development version ($(PKG_BATMAN_SHORTREV)) of the kernel module plus 
-its user space configuration & managerment tool batctl.
+development version ($(PKG_BATMAN_SHORTREV)).
 endef
 
 define KernelPackage/batman-adv-devel/config
@@ -64,62 +58,6 @@ MAKE_BATMAN_ADV_ARGS += \
 	CONFIG_BATMAN_ADV_NC=$(if $(CONFIG_KMOD_BATMAN_ADV_DEVEL_NC),y,n) \
 	REVISION="$(PKG_BATMAN_SHORTREV)" all
 
-# The linker can identify unused sections of a binary when each symbol is stored
-# in a separate section. This mostly removes unused linker sections and reduces
-# the size by ~3% on mipsel.
-
-TARGET_CFLAGS  += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections
-
-# Link-time optimization allows to move parts of the optimization from the single
-# source file to the global source view. This is done by emitting the GIMPLE
-# representation in each object file and analyzing it again during the link step.
-
-TARGET_CFLAGS  += -flto
-TARGET_LDFLAGS += -fuse-linker-plugin
-
-MAKE_BATCTL_ENV += \
-	CPPFLAGS="$(TARGET_CPPFLAGS)" \
-	CFLAGS="$(TARGET_CFLAGS)" \
-	LDFLAGS="$(TARGET_LDFLAGS)" \
-	LIBNL_NAME="libnl-tiny" \
-	LIBNL_CFLAGS="-I$(STAGING_DIR)/usr/include/libnl-tiny" \
-	LIBNL_LDLIBS="-lnl-tiny"
-
-MAKE_BATCTL_ARGS += \
-	REVISION="$(PKG_BATCTL_SHORTREV)" \
-	CC="$(TARGET_CC)" \
-	DESTDIR="$(PKG_INSTALL_DIR)" \
-	batctl install
-
-ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_DEVEL_BATCTL),)
-define Download/batctl
-  FILE:=$(PKG_BATCTL_FNAME)
-  URL:=$(PKG_SOURCE_URL)
-endef
-$(eval $(call Download,batctl))
-
-BATCTL_EXTRACT = tar xzf "$(DL_DIR)/$(PKG_BATCTL_FNAME)" -C "$(BUILD_DIR)/$(PKG_NAME)"
-BATCTL_PATCH = $(call Build/DoPatch,"$(PKG_BATCTL_BUILD_DIR)","$(PATCH_DIR)","*batctl*")
-BATCTL_BUILD = $(MAKE_BATCTL_ENV) $(MAKE) -C $(PKG_BATCTL_BUILD_DIR) $(MAKE_BATCTL_ARGS)
-BATCTL_INSTALL = $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/sbin/batctl $(1)/usr/sbin/
-endif
-
-KPATCH ?= $(PATCH)
-define Build/DoPatch
-	@if [ -d "$(2)" ]; then \
-		if [ "$$$$(ls $(2) | grep -Ec $(3))" -gt 0 ]; then \
-			$(KPATCH) "$(1)" "$(2)" "$(3)"; \
-		fi; \
-	fi
-endef
-
-define Build/Patch
-	$(call Build/DoPatch,"$(PKG_BUILD_DIR)","$(PATCH_DIR)","*batman*")
-	$(BATCTL_EXTRACT)
-	$(BATCTL_PATCH)
-endef
-
 define Build/Prepare
 	$(call Build/Prepare/Default)
 	$(SED) '/#define _NET_BATMAN_ADV_MAIN_H_/a\#undef CONFIG_MODULE_STRIPPED' \
@@ -128,7 +66,6 @@ endef
 
 define Build/Compile
 	$(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_BATMAN_ADV_ARGS)
-	$(BATCTL_BUILD)
 endef
 
 define Build/Clean
@@ -141,7 +78,6 @@ define KernelPackage/batman-adv-devel/install
 	$(INSTALL_DATA) ./files/lib/batman-adv/config.sh $(1)/lib/batman-adv
 	$(INSTALL_BIN) ./files/etc/hotplug.d/net/99-batman-adv $(1)/etc/hotplug.d/net
 	$(INSTALL_BIN) ./files/lib/netifd/proto/batadv.sh $(1)/lib/netifd/proto
-	$(BATCTL_INSTALL)
 endef
 
 $(eval $(call KernelPackage,batman-adv-devel))



More information about the commits mailing list