batman-adv: adding support for the development branch
authorMarek Lindner <lindner_marek@yahoo.de>
Thu, 28 Jan 2010 05:52:18 +0000 (05:52 +0000)
committerMarek Lindner <lindner_marek@yahoo.de>
Thu, 28 Jan 2010 05:52:18 +0000 (05:52 +0000)
* offer choice between maint/dev branch
* make batctl optional upon user request
* upgrade src version
* fix EXTRA_CLFAGS

Thanks to Linus Luessing for his help.

SVN-Revision: 19356

net/batman-advanced/Config.in
net/batman-advanced/Makefile
net/batman-advanced/files/etc/init.d/batman-adv-kernelland

index 6a12427..07f6095 100644 (file)
@@ -1,4 +1,36 @@
+choice
+       prompt "branch"
+       depends PACKAGE_kmod-batman-adv-kernelland
+       default BATMAN_ADV_MAINTENANCE
+       help
+         This option allows you to select the version of B.A.T.M.A.N.-Advanced.
+
+config BATMAN_ADV_MAINTENANCE
+       bool "maintenance"
+       help
+         This version contains the latest release version plus some additional
+         bug fixes cherrypicked from the batman-adv trunk.
+
+         If unsure, select this.
+
+config BATMAN_ADV_DEV
+       bool "development"
+       help
+         This version contains a version from batman-adv's trunk which offers
+         new, but not that well tested, features.
+
+         If unsure, select "maintenance".
+endchoice
+
 config KMOD_BATMAN_ADV_DEBUG_LOG
        bool "enable verbose debug logging"
        depends PACKAGE_kmod-batman-adv-kernelland
        default n
+config KMOD_BATMAN_ADV_BATCTL
+       bool "enable batctl"
+       depends PACKAGE_kmod-batman-adv-kernelland
+       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.
index 1fd872b..d1e5c75 100644 (file)
@@ -9,29 +9,35 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=batman-adv
-PKG_REV:=1545
+PKG_REV:=1568
 PKG_VERSION:=r$(PKG_REV)
 PKG_RELEASE:=1
 
-PKG_KMOD_VERSION=caf7148e887b57abf37ef89a1b5aedf314893c94
-PKG_KMOD_FNAME=batman-adv-maint-$(PKG_KMOD_VERSION)
-PKG_KMOD_BUILD_DIR:=$(BUILD_DIR)/batman-adv
-
-PKG_SOURCE_PROTO:=svn
-PKG_SOURCE_VERSION:=$(PKG_REV)
-PKG_SOURCE_SUBDIR:=batctl-0.2.x-$(PKG_VERSION)
-PKG_SOURCE_URL:=http://downloads.open-mesh.net/svn/batman/branches/batctl-0.2.x/
-PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+PKG_TOOL_VERSION=$(PKG_REV)
+
+ifneq ($(CONFIG_BATMAN_ADV_DEV),)
+       PKG_KMOD_VERSION=060c4d34077550d57cd57c5375dd5f8758391eb5
+       PKG_KMOD_FNAME=batman-adv-dev-$(PKG_REV).tar.gz
+       PKG_TOOL_URL=http://downloads.open-mesh.org/svn/batman/trunk/batctl
+       PKG_TOOL_FNAME:=batctl-dev-$(PKG_TOOL_VERSION).tar.gz
+else
+       PKG_KMOD_VERSION=1b58d49b4342caabb9624243bc76e037eaac2673
+       PKG_KMOD_FNAME=batman-adv-maint-$(PKG_REV).tar.gz
+       PKG_TOOL_URL=http://downloads.open-mesh.org/svn/batman/branches/batctl-0.2.x/
+       PKG_TOOL_FNAME:=batctl-maint-$(PKG_TOOL_VERSION).tar.gz
+endif
 
-PKG_TOOL_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-batctl-install
-PKG_TOOL_BUILD_DIR:=$(PKG_BUILD_DIR)
+PKG_KMOD_BUILD_DIR:=$(PKG_BUILD_DIR)/batman-adv-kernelland
+PKG_TOOL_BUILD_DIR:=$(PKG_BUILD_DIR)/batctl
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 define Package/batman-adv/Default
-  URL:=http://www.open-mesh.net/
+  URL:=http://www.open-mesh.org/
   MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
 endef
 
@@ -52,17 +58,59 @@ define KernelPackage/batman-adv-kernelland/description
 B.A.T.M.A.N. layer 2
 endef
 
-define Download/batman-adv-maint
+define Download/batman-adv-kernelland
   FILE:=$(PKG_KMOD_FNAME)
-  URL:=http://git.open-mesh.org/snapshot
+  URL:=http://git.open-mesh.org/snapshot/$(PKG_KMOD_VERSION)/
+endef
+$(eval $(call Download,batman-adv-kernelland))
+
+ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
+define Download/batctl
+  FILE:=$(PKG_TOOL_FNAME)
+  URL:=$(PKG_TOOL_URL)
+  PROTO:=svn
+  VERSION:=$(PKG_TOOL_VERSION)
+  SUBDIR:=$(PKG_SOURCE_SUBDIR)/batctl
+endef
+$(eval $(call Download,batctl))
+endif
+
+ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
+ifneq ($(DEVELOPER)$(CONFIG_BATMAN_ADV_DEV),)
+define Download/batman
+  FILE:=batman-$(PKG_REV).tar.gz
+  URL:=http://downloads.open-mesh.org/svn/batman/trunk/batman
+  PROTO:=svn
+  VERSION:=$(PKG_REV)
+  SUBDIR:=$(PKG_SOURCE_SUBDIR)/batman
+endef
+$(eval $(call Download,batman))
+endif
+endif
+
+define Build/Prepare
+       tar xzf "$(DL_DIR)/$(PKG_KMOD_FNAME)" -C "$(PKG_BUILD_DIR)"
+ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
+       tar xzf "$(DL_DIR)/$(PKG_TOOL_FNAME)" -C "$(BUILD_DIR)"
+ifneq ($(DEVELOPER)$(CONFIG_BATMAN_ADV_DEV),)
+       tar xzf "$(DL_DIR)/batman-$(PKG_REV).tar.gz" -C "$(BUILD_DIR)"
+endif
+endif
+       mv "$(PKG_BUILD_DIR)/batman-adv" "$(PKG_KMOD_BUILD_DIR)"
+       cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile
+       $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR),)
+ifneq ($(CONFIG_BATMAN_ADV_DEV),)
+       $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/dev,)
+else
+       $(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/maint,)
+endif
 endef
-$(eval $(call Download,batman-adv-maint))
 
 MAKE_BATADV_KERNELLAND_ARGS += \
        CROSS_COMPILE="$(TARGET_CROSS)" \
        ARCH="$(LINUX_KARCH)" \
        PATH="$(TARGET_PATH)" \
-       $(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),EXTRA_FLAGS="-DCONFIG_BATMAN_ADV_DEBUG") \
+       $(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),EXTRA_CFLAGS="-DCONFIG_BATMAN_ADV_DEBUG") \
        SUBDIRS="$(PKG_KMOD_BUILD_DIR)" \
        LINUX_VERSION="$(LINUX_VERSION)" \
        REVISION="$(PKG_REV)" modules
@@ -84,17 +132,14 @@ endef
 
 ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batman-adv-kernelland),)
         BUILD_KMOD_ADV = $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATADV_KERNELLAND_ARGS)
-endif
-
-ifneq ($(DEVELOPER)$(CONFIG_PACKAGE_kmod-batman-adv-kernelland),)
         BUILD_BATCTL = $(MAKE) -C $(PKG_TOOL_BUILD_DIR) $(MAKE_BATCTL_ARGS)
 endif
 
 define Build/Compile
-       tar xzf "$(DL_DIR)/$(PKG_KMOD_FNAME)" -C "$(BUILD_DIR)"
-       cp $(PKG_KMOD_BUILD_DIR)/Makefile.kbuild $(PKG_KMOD_BUILD_DIR)/Makefile
        $(BUILD_KMOD_ADV)
+ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
        $(BUILD_BATCTL)
+endif
 endef
 
 define Build/Clean
@@ -102,10 +147,13 @@ define Build/Clean
 endef
 
 define KernelPackage/batman-adv-kernelland/install
-       $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d $(1)/usr/sbin
+       $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
        $(INSTALL_BIN) ./files/etc/init.d/batman-adv-kernelland $(1)/etc/init.d
        $(INSTALL_DATA) ./files/etc/config/batman-adv-kernelland $(1)/etc/config
+ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_BATCTL),)
+       $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batctl $(1)/usr/sbin/
+endif
 endef
 
 $(eval $(call KernelPackage,batman-adv-kernelland))
index b8cd1b7..caded3f 100644 (file)
@@ -8,22 +8,22 @@ start () {
                exit
        fi
        
-       batctl interface $interfaces
+       echo $interfaces > /proc/net/batman-adv/interfaces 
        
        originator_interval=$(uci get batman-adv-kernelland.general.originator_interval)
        log_level=$(uci get batman-adv-kernelland.general.log_level)
 
        if [ $originator_interval ]; then
-               batctl interval $originator_interval
+               echo $originator_interval > /proc/net/batman-adv/orig_interval 
        fi
        
        if [ $log_level ]; then
-               batctl loglevel $log_level
+               echo $log_level > /sys/module/batman_adv/parameters/debug 2>&-
        fi
 }
 
 stop () {
-       batctl interface none
+       echo "" > /proc/net/batman-adv/interfaces
 }