From ec48d0fc00b7a7924970b643a7584b6c8494ba67 Mon Sep 17 00:00:00 2001 From: Marek Lindner Date: Mon, 16 Apr 2012 17:36:28 +0000 Subject: [PATCH] batman-adv: upgrade package to latest release 2012.1.0 Also fix hotplug scripts to load batman-adv module when necessary. Signed-off-by: Marek Lindner git-svn-id: svn://svn.openwrt.org/openwrt/packages/net/batman-adv@31317 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- Makefile | 17 +++++++++-------- files/etc/hotplug.d/net/99-batman-adv | 1 + files/lib/batman-adv/config.sh | 17 ++++++++++++++--- files/usr/sbin/batman-adv | 1 + 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 8a40994..3f2737e 100644 --- a/Makefile +++ b/Makefile @@ -10,10 +10,10 @@ include $(TOPDIR)/rules.mk PKG_NAME:=batman-adv -PKG_VERSION:=2012.0.0 -BATCTL_VERSION:=2012.0.0 -PKG_MD5SUM:=f1de23457a47ca4369ee1f0e0b7fc405 -BATCTL_MD5SUM:=27991c2921e18657c7262e917d45106a +PKG_VERSION:=2012.1.0 +BATCTL_VERSION:=2012.1.0 +PKG_MD5SUM:=a66fdc92c677aadae339073c560a454e +BATCTL_MD5SUM:=afdc15c886f27f7740212db50db47190 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION) @@ -47,12 +47,14 @@ endef MAKE_BATMAN_ADV_ARGS += \ CROSS_COMPILE="$(TARGET_CROSS)" \ + KERNELPATH="$(LINUX_DIR)" \ ARCH="$(LINUX_KARCH)" \ PATH="$(TARGET_PATH)" \ - $(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),EXTRA_CFLAGS="-DCONFIG_BATMAN_ADV_DEBUG") \ SUBDIRS="$(PKG_BUILD_DIR)" \ + PWD="$(PKG_BUILD_DIR)" \ LINUX_VERSION="$(LINUX_VERSION)" \ - REVISION="" modules + CONFIG_BATMAN_ADV_DEBUG=$(if $(CONFIG_KMOD_BATMAN_ADV_DEVEL_DEBUG_LOG),y,n) \ + REVISION="" all MAKE_BATCTL_ARGS += \ CFLAGS="$(TARGET_CFLAGS)" \ @@ -96,8 +98,7 @@ define Build/Patch endef define Build/Compile - cp $(PKG_BUILD_DIR)/Makefile.kbuild $(PKG_BUILD_DIR)/Makefile - $(MAKE) -C "$(LINUX_DIR)" $(MAKE_BATMAN_ADV_ARGS) + $(MAKE) -C "$(PKG_BUILD_DIR)" $(MAKE_BATMAN_ADV_ARGS) $(BATCTL_BUILD) endef diff --git a/files/etc/hotplug.d/net/99-batman-adv b/files/etc/hotplug.d/net/99-batman-adv index fe19e64..42d4c29 100644 --- a/files/etc/hotplug.d/net/99-batman-adv +++ b/files/etc/hotplug.d/net/99-batman-adv @@ -2,6 +2,7 @@ . /lib/batman-adv/config.sh +bat_load_module config_load batman-adv case "$ACTION" in diff --git a/files/lib/batman-adv/config.sh b/files/lib/batman-adv/config.sh index 044c2f6..24037b0 100644 --- a/files/lib/batman-adv/config.sh +++ b/files/lib/batman-adv/config.sh @@ -1,6 +1,15 @@ #!/bin/sh -bat_config(){ +bat_load_module() +{ + [ -d "/sys/module/batman_adv/" ] && return + + . /etc/functions.sh + load_modules /etc/modules.d/*-lib-crc16 /etc/modules.d/*-batman-adv +} + +bat_config() +{ local mesh="$1" local aggregated_ogms bonding fragmentation gw_bandwidth gw_mode gw_sel_class log_level orig_interval hop_penalty vis_mode @@ -30,7 +39,8 @@ bat_config(){ } -bat_add_interface(){ +bat_add_interface() +{ local mesh="$1" local interface="$2" local interfaces @@ -47,7 +57,8 @@ bat_add_interface(){ done } -bat_del_interface(){ +bat_del_interface() +{ local mesh="$1" local interface="$2" local interfaces diff --git a/files/usr/sbin/batman-adv b/files/usr/sbin/batman-adv index 6580756..93ae1b5 100644 --- a/files/usr/sbin/batman-adv +++ b/files/usr/sbin/batman-adv @@ -26,6 +26,7 @@ stop_mesh() { # can also be used with "batman-adv start bat0" start() { + bat_load_module config_load batman-adv if [ -n "$1" ]; then -- 2.30.2