olsrd: splitting IPv6/4 configuration and start scripts

As mentioned by zioproto[1] 6and4 is badly broken, this patch will
use 2 different configuration and init scripts.

[1] https://github.com/openwrt-routing/packages/issues/16#issuecomment-32892327
This commit is contained in:
Alessio Caiazza 2014-05-28 12:28:14 +02:00
parent e720d2fb77
commit 4b06c42f97
6 changed files with 53 additions and 14 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=olsrd
PKG_VERSION:=0.6.6.1
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.olsr.org/releases/0.6
@ -37,7 +37,8 @@ define Package/olsrd
endef
define Package/olsrd/conffiles
/etc/config/olsrd
/etc/config/olsrd4
/etc/config/olsrd6
endef
define Package/olsrd-mod-arprefresh
@ -169,12 +170,16 @@ define Build/Compile
endef
define Package/olsrd/install
$(INSTALL_DIR) $(1)/lib/functions
$(INSTALL_DATA) ./files/olsrd.init $(1)/lib/functions/olsrd.sh
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/olsrd.config $(1)/etc/config/olsrd
$(INSTALL_DATA) ./files/olsrd4.config $(1)/etc/config/olsrd4
$(INSTALL_DATA) ./files/olsrd6.config $(1)/etc/config/olsrd6
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/olsrd $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/olsrd.init $(1)/etc/init.d/olsrd
$(INSTALL_BIN) ./files/olsrd4.init $(1)/etc/init.d/olsrd4
$(INSTALL_BIN) ./files/olsrd6.init $(1)/etc/init.d/olsrd6
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) ./files/olsrd.hotplug.sh $(1)/etc/hotplug.d/iface/50-olsrd
endef

View File

@ -6,10 +6,6 @@ START=65
SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
CONF=/var/etc/olsrd.conf
PID=/var/run/olsrd.pid
PID6=/var/run/olsrd.ipv6.pid
OLSRD_OLSRD_SCHEMA='ignore:internal config_file:internal DebugLevel=0 AllowNoInt=yes'
OLSRD_IPCCONNECT_SCHEMA='ignore:internal Host:list Net:list2'
OLSRD_LOADPLUGIN_SCHEMA='ignore:internal library:internal Host4:list Net4:list2 Host:list Net:list2 Host6:list Net6:list2 Ping:list redistribute:list NonOlsrIf:list name:list lat lon latlon_infile HNA:list2 hosts:list2'
@ -766,7 +762,7 @@ start() {
. /lib/functions/network.sh
config_load olsrd
config_load $UCI_CONF_NAME
reset_cb
OLSRD_CONFIG_FILE=
@ -774,9 +770,9 @@ start() {
if [ -z "$OLSRD_CONFIG_FILE" ]; then
mkdir -p -- /var/etc/
olsrd_write_config > /var/etc/olsrd.conf
olsrd_write_config > /var/etc/$UCI_CONF_NAME.conf
if [ "$INTERFACES_COUNT" -gt 0 -a "$OLSRD_COUNT" -gt 0 ]; then
OLSRD_CONFIG_FILE=/var/etc/olsrd.conf
OLSRD_CONFIG_FILE=/var/etc/$UCI_CONF_NAME.conf
fi
fi
@ -837,7 +833,4 @@ start() {
stop() {
SERVICE_PID_FILE="$PID"
service_stop /usr/sbin/olsrd
SERVICE_PID_FILE="$PID6"
service_stop /usr/sbin/olsrd
}

14
olsrd/files/olsrd4.init Normal file
View File

@ -0,0 +1,14 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2013 OpenWrt.org
. /lib/functions/olsrd.sh
START=65
SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
CONF=/var/etc/olsrd4.conf
PID=/var/run/olsrd4.pid
UCI_CONF_NAME=olsrd4

13
olsrd/files/olsrd6.config Normal file
View File

@ -0,0 +1,13 @@
config olsrd
# uncomment the following line to use a custom config file instead:
#option config_file '/etc/olsrd6.conf'
option IpVersion '6'
config LoadPlugin
option library 'olsrd_txtinfo.so.0.1'
option accept '::'
option port '2007'
config Interface
list interface 'wlan'

14
olsrd/files/olsrd6.init Normal file
View File

@ -0,0 +1,14 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2013 OpenWrt.org
. /lib/functions/olsrd.sh
START=65
SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
CONF=/var/etc/olsrd6.conf
PID=/var/run/olsrd6.pid
UCI_CONF_NAME=olsrd6