batman: add kernelland init script & config file

git-svn-id: svn://svn.openwrt.org/openwrt/packages@14803 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
marek 2009-03-09 05:50:38 +00:00
parent 0ac7fa48ca
commit 34ca09c0fc
6 changed files with 65 additions and 18 deletions

View File

@ -30,11 +30,11 @@ include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk
define Package/batman-adv/Default
URL:=https://www.open-mesh.net/
URL:=http://www.open-mesh.net/
MAINTAINER:=Marek Lindner <lindner_marek@yahoo.de>
endef
define Package/batmand-adv
define Package/batmand-adv-userspace
$(call Package/batman-adv/Default)
SECTION:=net
CATEGORY:=Network
@ -42,7 +42,7 @@ $(call Package/batman-adv/Default)
TITLE:=B.A.T.M.A.N. layer 2 routing daemon
endef
define Package/batmand-adv/description
define Package/batmand-adv-userspace/description
B.A.T.M.A.N. layer 2 routing daemon
endef
@ -57,7 +57,7 @@ define Package/battool/description
B.A.T.M.A.N. layer 2 debug tools
endef
define KernelPackage/batman-advanced
define KernelPackage/batman-adv-kernelland
$(call Package/batman-adv/Default)
SUBMENU:=Network Support
DEPENDS:=@LINUX_2_6
@ -67,7 +67,7 @@ $(call Package/batman-adv/Default)
endef
define KernelPackage/batman-advanced/description
define KernelPackage/batman-adv-kernelland/description
Kernel routing module for B.A.T.M.A.N. layer 2
endef
@ -106,11 +106,11 @@ MAKE_TOOL_ARGS += \
define Build/Configure
endef
ifneq ($(CONFIG_PACKAGE_batmand-adv),n)
ifneq ($(CONFIG_PACKAGE_batmand-adv-userspace),n)
BUILD_ADV = $(MAKE) -C $(PKG_BUILD_DIR)/batman-adv-userspace $(MAKE_ARGS)
endif
ifneq ($(CONFIG_PACKAGE_kmod-batman-advanced),n)
ifneq ($(CONFIG_PACKAGE_kmod-batman-adv-kernelland),n)
BUILD_KMOD_ADV = $(MAKE) -C "$(LINUX_DIR)" $(MAKE_KMOD_ARGS)
endif
@ -125,11 +125,17 @@ define Build/Compile
$(BUILD_BATTOOL)
endef
define Package/batmand-adv/install
define Package/batmand-adv-userspace/install
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/batmand-adv $(1)/usr/sbin/
$(INSTALL_BIN) ./files/etc/init.d/batmand-adv $(1)/etc/init.d
$(INSTALL_DATA) ./files/etc/config/batmand-adv $(1)/etc/config
$(INSTALL_BIN) ./files/etc/init.d/batmand-adv-userspace $(1)/etc/init.d
$(INSTALL_DATA) ./files/etc/config/batmand-adv-userspace $(1)/etc/config
endef
define Package/batmand-adv-kernelland/install
$(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/batmand-adv-kernelland $(1)/etc/init.d
$(INSTALL_DATA) ./files/etc/config/batmand-adv-kernelland $(1)/etc/config
endef
define Package/battool/install
@ -137,6 +143,6 @@ define Package/battool/install
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/battool $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,batmand-adv))
$(eval $(call BuildPackage,batmand-adv-userspace))
$(eval $(call BuildPackage,battool))
$(eval $(call KernelPackage,batman-advanced))
$(eval $(call KernelPackage,batman-adv-kernelland))

View File

@ -0,0 +1,4 @@
config batmand-adv-kernelland general
option interface ath0
option originator_interval
option log_level

View File

@ -1,4 +1,4 @@
config batmand-adv general
config batmand-adv-userspace general
option interface ath0
option originator_interval
option visualisation_srv

View File

@ -0,0 +1,37 @@
#!/bin/sh /etc/rc.common
START=90
. /lib/config/uci.sh
uci_load batmand-adv-kernelland
start () {
interfaces=$(uci get batmand-adv-kernalland.general.interface)
if [ "$interface" = "" ]; then
echo $1 Error, you must specify at least a network interface
exit
fi
for interface in interfaces
do
echo $interface > /proc/net/batman-adv/interfaces
done
originator_interval=$(uci get batmand-adv-kernalland.general.originator_interval)
log_level=$(uci get batmand-adv-kernalland.general.log_level)
if [ $originator_interval ]; then
echo $originator_interval > /proc/net/batman-adv/originator_interval
fi
if [ $log_level ]; then
echo $log_level > /proc/net/batman-adv/log_level
fi
}
restart () {
$0 stop
sleep 3
$0 start
}
stop () {
echo "" > /proc/net/batman-adv/interfaces
}

View File

@ -1,15 +1,15 @@
#!/bin/sh /etc/rc.common
START=90
. /lib/config/uci.sh
uci_load batmand-adv
uci_load batmand-adv-userspace
start () {
interface=$(uci get batmand-adv.general.interface)
interface=$(uci get batmand-adv-userspace.general.interface)
if [ "$interface" = "" ]; then
echo $1 Error, you must specify at least a network interface
exit
fi
originator_interval=$(uci get batmand-adv.general.originator_interval)
visualisation_srv=$(uci get batmand-adv.general.visualisation_srv)
originator_interval=$(uci get batmand-adv-userspace.general.originator_interval)
visualisation_srv=$(uci get batmand-adv-space.general.visualisation_srv)
batman_args=""
if [ $originator_interval ]; then

View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=batmand
PKG_REV:=1206
PKG_REV:=1235
PKG_VERSION:=r$(PKG_REV)
PKG_RELEASE:=1
#PKG_BRANCH:=batman-0.3