From 2d3444ffa6eff4af43ecc19c26c5a330889cde2b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 22 Nov 2009 04:02:17 +0000 Subject: [PATCH] Upgrade the babel package to 0.97, renaming it to babeld - adds librt dependency to the Makefile, - removes duplicated content from the sample babeld.conf file. Signed-off-by: Gabriel Kerneis SVN-Revision: 18462 --- net/babel/Makefile | 24 ++++---- net/babel/files/babel.conf | 56 ------------------- net/babel/files/babeld.conf | 28 ++++++++++ .../files/{babel.config => babeld.config} | 2 +- net/babel/files/{babel.init => babeld.init} | 28 ++++++++++ 5 files changed, 70 insertions(+), 68 deletions(-) delete mode 100644 net/babel/files/babel.conf create mode 100644 net/babel/files/babeld.conf rename net/babel/files/{babel.config => babeld.config} (64%) rename net/babel/files/{babel.init => babeld.init} (54%) diff --git a/net/babel/Makefile b/net/babel/Makefile index e66104650e..144bf9e1d1 100644 --- a/net/babel/Makefile +++ b/net/babel/Makefile @@ -8,24 +8,24 @@ include $(TOPDIR)/rules.mk PKG_NAME:=babeld -PKG_VERSION:=0.96 +PKG_VERSION:=0.97 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.pps.jussieu.fr/~jch/software/files/ -PKG_MD5SUM:=fdb1949237ec99cd978222fe872c4f0b +PKG_MD5SUM:=be0748c382dfe60bd35aa6b661e6077d include $(INCLUDE_DIR)/package.mk -define Package/babel +define Package/babeld SECTION:=net CATEGORY:=Network TITLE:=A loop-free distance-vector routing protocol URL:=http://www.pps.jussieu.fr/~jch/software/babel/ - DEPENDS:=+kmod-ipv6 + DEPENDS:=+kmod-ipv6 +librt endef -define Package/babel/description +define Package/babeld/description Babel is a loop-avoiding distance-vector routing protocol roughly based on DSDV and AODV, but with provisions for link cost estimation and redistribution of routes from other routing protocols. @@ -35,21 +35,23 @@ define Package/babel/description never counting to infinity. endef -define Package/babel/conffiles -/etc/babel.conf +define Package/babeld/conffiles +/etc/babeld.conf endef MAKE_FLAGS += \ CC="$(TARGET_CC)" \ CFLAGS="$(TARGET_CFLAGS)" \ -define Package/babel/install +define Package/babeld/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/babeld $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc - $(INSTALL_CONF) ./files/babel.conf $(1)/etc/ + $(INSTALL_CONF) ./files/babeld.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/babeld.config $(1)/etc/config/babeld $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/babel.init $(1)/etc/init.d/babel + $(INSTALL_BIN) ./files/babeld.init $(1)/etc/init.d/babeld endef -$(eval $(call BuildPackage,babel)) +$(eval $(call BuildPackage,babeld)) diff --git a/net/babel/files/babel.conf b/net/babel/files/babel.conf deleted file mode 100644 index 4f6eb93ec5..0000000000 --- a/net/babel/files/babel.conf +++ /dev/null @@ -1,56 +0,0 @@ -# babel config file -# Copyright (C) 2008 Juliusz Chroboczek, L. Aaron Kaplan -# , -# -# This config file simply docuements sample entries. -# "redistribute" means: redistribute routes from other -# routing protocols into babel. "local" means addresses assigned to local interfaces. -# -# the default rules are: -# -## redistribute local -## redistribute deny -# -# this says, redistribute local addresses but no other routes - - - -# redistribute IPv4 default route into babel -## redistribute local ip 0.0.0.0/0 le 0 metric 128 - -# same but for IPv6 -## redistribute local ip ::/0 le 0 metric 128 - -# don't redistribute all local addresses, only selected ones -# after the first line, the "deny" rules kicks in. After the "deny" -# no redistribute local rules are going to match -## redistribute local ip 192.160.4.0/24 -## redistribute local deny -# babel config file -# Copyright (C) 2008 Juliusz Chroboczek, L. Aaron Kaplan -# , -# -# This config file simply docuements sample entries. -# "redistribute" means: redistribute routes from other -# routing protocols into babel. "local" means addresses assigned to local interfaces. -# -# the default rules are: -# -## redistribute local -## redistribute deny -# -# this says, redistribute local addresses but no other routes - - - -# redistribute IPv4 default route into babel -## redistribute local ip 0.0.0.0/0 le 0 metric 128 - -# same but for IPv6 -## redistribute local ip ::/0 le 0 metric 128 - -# don't redistribute all local addresses, only selected ones -# after the first line, the "deny" rules kicks in. After the "deny" -# no redistribute local rules are going to match -## redistribute local ip 192.160.4.0/24 -## redistribute local deny diff --git a/net/babel/files/babeld.conf b/net/babel/files/babeld.conf new file mode 100644 index 0000000000..07fcbe122a --- /dev/null +++ b/net/babel/files/babeld.conf @@ -0,0 +1,28 @@ +# babel config file +# Copyright (C) 2008 Juliusz Chroboczek, L. Aaron Kaplan +# , +# +# This config file simply documents sample entries. +# "redistribute" means: redistribute routes from other +# routing protocols into babel. "local" means addresses assigned to local interfaces. +# +# the default rules are: +# +## redistribute local +## redistribute deny +# +# this says, redistribute local addresses but no other routes + + + +# redistribute IPv4 default route into babel +## redistribute local ip 0.0.0.0/0 le 0 metric 128 + +# same but for IPv6 +## redistribute local ip ::/0 le 0 metric 128 + +# don't redistribute all local addresses, only selected ones +# after the first line, the "deny" rules kicks in. After the "deny" +# no redistribute local rules are going to match +## redistribute local ip 192.160.4.0/24 +## redistribute local deny diff --git a/net/babel/files/babel.config b/net/babel/files/babeld.config similarity index 64% rename from net/babel/files/babel.config rename to net/babel/files/babeld.config index 3dee28c371..b512c3a20f 100644 --- a/net/babel/files/babel.config +++ b/net/babel/files/babeld.config @@ -1,2 +1,2 @@ -config babel +config babeld option interfaces "wl0" diff --git a/net/babel/files/babel.init b/net/babel/files/babeld.init similarity index 54% rename from net/babel/files/babel.init rename to net/babel/files/babeld.init index 41c0aa1e80..6d0eb192d1 100755 --- a/net/babel/files/babel.init +++ b/net/babel/files/babeld.init @@ -4,6 +4,34 @@ START=70 pidfile=/var/run/babeld.pid +babeld_config() { + local cfg="$1" + config_get interfaces "$cfg" interfaces +} + +start() { + config_load babeld + config_foreach babeld_config babeld + mkdir -p /var/lib + if [ -e $pidfile ] ; then + echo "$pidfile exists -- not starting babel." >&2 + else + /usr/sbin/babeld -D -I $pidfile $interfaces + fi +} + +stop() { + [ -e $pidfile ] && kill $(cat $pidfile) + [ -e $pidfile ] && sleep 2 + [ -e $pidfile ] && sleep 4 + [ -e $pidfile ] && echo "Failed to stop babel ($pidfile still exists)." +} +#!/bin/sh /etc/rc.common + +START=70 + +pidfile=/var/run/babeld.pid + babel_config() { local cfg="$1" config_get interfaces "$cfg" interfaces -- 2.30.2