From 4b06c42f97a0d45eaf41a42c065c2dba4d643408 Mon Sep 17 00:00:00 2001 From: Alessio Caiazza Date: Wed, 28 May 2014 12:28:14 +0200 Subject: [PATCH] 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 --- olsrd/Makefile | 13 +++++++++---- olsrd/files/olsrd.init | 13 +++---------- olsrd/files/{olsrd.config => olsrd4.config} | 0 olsrd/files/olsrd4.init | 14 ++++++++++++++ olsrd/files/olsrd6.config | 13 +++++++++++++ olsrd/files/olsrd6.init | 14 ++++++++++++++ 6 files changed, 53 insertions(+), 14 deletions(-) rename olsrd/files/{olsrd.config => olsrd4.config} (100%) create mode 100644 olsrd/files/olsrd4.init create mode 100644 olsrd/files/olsrd6.config create mode 100644 olsrd/files/olsrd6.init diff --git a/olsrd/Makefile b/olsrd/Makefile index 2faadd8..5004b5f 100644 --- a/olsrd/Makefile +++ b/olsrd/Makefile @@ -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 diff --git a/olsrd/files/olsrd.init b/olsrd/files/olsrd.init index c8f1df5..d0c4e00 100644 --- a/olsrd/files/olsrd.init +++ b/olsrd/files/olsrd.init @@ -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 } diff --git a/olsrd/files/olsrd.config b/olsrd/files/olsrd4.config similarity index 100% rename from olsrd/files/olsrd.config rename to olsrd/files/olsrd4.config diff --git a/olsrd/files/olsrd4.init b/olsrd/files/olsrd4.init new file mode 100644 index 0000000..eb13eee --- /dev/null +++ b/olsrd/files/olsrd4.init @@ -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 diff --git a/olsrd/files/olsrd6.config b/olsrd/files/olsrd6.config new file mode 100644 index 0000000..a71a2dc --- /dev/null +++ b/olsrd/files/olsrd6.config @@ -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' diff --git a/olsrd/files/olsrd6.init b/olsrd/files/olsrd6.init new file mode 100644 index 0000000..71d5dbd --- /dev/null +++ b/olsrd/files/olsrd6.init @@ -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 -- 2.30.2