Package: olsrd
Version: 0.6.2-1
Severity: minor
Tags: patch

The attach patch changes both the olsrd binary and the documentation to
point to the Debian-standard location for the config file:
/etc/olsrd/olsrd.conf.  That means if you run just 'olsrd' from the
terminal, it will find its Debian-installed conf file.

This patch assumes the patches in bug #658560 are already applied:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=658560

It could be easily modified to be applied directly to 0.6.2-1.
From 5b923c1efa849ce651040dfd65743a7c9f7558f6 Mon Sep 17 00:00:00 2001
From: Hans-Christoph Steiner <h...@eds.org>
Date: Fri, 3 Feb 2012 22:12:28 -0500
Subject: [PATCH 1/1] hardcode conf file to /etc/olsrd/olsrd.conf and update
 docs

---
 .../290-hardcode-etc-olsrd-olsrd-conf.patch        |  161 ++++++++++++++++++++
 debian/patches/series                              |    1 +
 debian/rules                                       |    2 +-
 3 files changed, 163 insertions(+), 1 deletions(-)
 create mode 100644 debian/patches/290-hardcode-etc-olsrd-olsrd-conf.patch

diff --git a/debian/patches/290-hardcode-etc-olsrd-olsrd-conf.patch b/debian/patches/290-hardcode-etc-olsrd-olsrd-conf.patch
new file mode 100644
index 0000000..ecb6f68
--- /dev/null
+++ b/debian/patches/290-hardcode-etc-olsrd-olsrd-conf.patch
@@ -0,0 +1,161 @@
+diff --git a/Makefile.inc b/Makefile.inc
+index 34af527..17027b6 100644
+--- a/Makefile.inc
++++ b/Makefile.inc
+@@ -57,7 +57,7 @@ DOCDIR   ?= $(SHAREDIR)/doc
+ MANDIR   ?= $(SHAREDIR)/man
+ EXENAME  ?= olsrd
+ CFGNAME  ?= $(EXENAME).conf
+-CFGFILE  ?= $(ETCDIR)/$(CFGNAME)
++CFGFILE  ?= $(ETCDIR)/$(EXENAME)/$(CFGNAME)
+ 
+ CPPFLAGS =	-Isrc
+ ifneq ($(TOPDIR),.)
+diff --git a/lib/arprefresh/README_ARPREFRESH b/lib/arprefresh/README_ARPREFRESH
+index 8308d51..16fdc3c 100644
+--- a/lib/arprefresh/README_ARPREFRESH
++++ b/lib/arprefresh/README_ARPREFRESH
+@@ -21,7 +21,7 @@ None.
+ SAMPLE CONFIG
+ ---------------------------------------------------------------------
+ 
+-add in /etc/olsrd.conf:
++add in /etc/olsrd/olsrd.conf:
+ 
+ LoadPlugin "arprefresh.so.0.1"
+ {
+diff --git a/lib/bmf/README_BMF b/lib/bmf/README_BMF
+index ec313da..efcc4b2 100644
+--- a/lib/bmf/README_BMF
++++ b/lib/bmf/README_BMF
+@@ -44,7 +44,7 @@ Set permissions, e.g.:
+ 
+   chmod 0700 /dev/net/tun
+ 
+-To configure BMF in OLSR, you must edit the file /etc/olsrd.conf
++To configure BMF in OLSR, you must edit the file /etc/olsrd/olsrd.conf
+ to load the BMF plugin. For example, add the following lines:
+ 
+   LoadPlugin "olsrd_bmf.so.1.7.0"
+@@ -184,7 +184,7 @@ the forwarding towards non-OLSR enabled hosts are omitted):
+ -------------------------
+ 
+ All configuration of BMF is done via the "LoadPlugin" section in
+-the /etc/olsrd.conf file.
++the /etc/olsrd/olsrd.conf file.
+ 
+ The following gives an overview of all plugin parameters that can be
+ configured. Unless otherwise stated, settings may differ for each node in the
+@@ -348,7 +348,7 @@ non-OLSR interfaces.
+ If you have network interfaces on which OLSR is *not* running, but you *do*
+ want to forward multicast and local-broadcast IP packets, specify these
+ interfaces one by one as "NonOlsrIf" parameters in the BMF plugin section
+-of /etc/olsrd.conf. For example:
++of /etc/olsrd/olsrd.conf. For example:
+ 
+   LoadPlugin "olsrd_bmf.so.1.7.0"
+   {
+@@ -368,7 +368,7 @@ as an OLSR-enabled interface.
+ In a typical interworking configuration there is a network of OLSR hosts
+ in which one host acts as a gateway to a fixed infrastructure network.
+ Usually that host will be advertising a default route via the HNA
+-mechanism, e.g. by adding the following lines to its /etc/olsrd.conf
++mechanism, e.g. by adding the following lines to its /etc/olsrd/olsrd.conf
+ file:
+ 
+   Hna4
+@@ -405,7 +405,7 @@ add the following line /etc/mrouted.conf :
+ 
+ Finally, mrouted does not accept interfaces with prefix length 32.
+ Therefore, override the default IP address and prefix length of
+-the BMF network interface, by editing the /etc/olsrd.conf file.
++the BMF network interface, by editing the /etc/olsrd/olsrd.conf file.
+ For example:
+ 
+   LoadPlugin "olsrd_bmf.so.1.7.0"
+diff --git a/lib/mini/README_MINI b/lib/mini/README_MINI
+index 625f994..ff47b3f 100644
+--- a/lib/mini/README_MINI
++++ b/lib/mini/README_MINI
+@@ -24,7 +24,7 @@ PlParam "test" "anything"
+ SAMPLE CONFIG
+ ---------------------------------------------------------------------
+ 
+-add in /etc/olsrd.conf:
++add in /etc/olsrd/olsrd.conf:
+ 
+ LoadPlugin "olsrd_mini.so.0.1"
+ {
+diff --git a/lib/nameservice/README_NAMESERVICE b/lib/nameservice/README_NAMESERVICE
+index 59f3c69..b27eb59 100644
+--- a/lib/nameservice/README_NAMESERVICE
++++ b/lib/nameservice/README_NAMESERVICE
+@@ -142,7 +142,7 @@ PlParam "macs-change-script" "/path/to/script"
+ SAMPLE CONFIG
+ ---------------------------------------------------------------------
+ 
+-add in /etc/olsrd.conf:
++add in /etc/olsrd/olsrd.conf:
+ 
+ LoadPlugin "olsrd_nameservice.so.0.2"
+ {
+diff --git a/lib/pgraph/README_PGRAPH b/lib/pgraph/README_PGRAPH
+index bc73f69..57b40e7 100644
+--- a/lib/pgraph/README_PGRAPH
++++ b/lib/pgraph/README_PGRAPH
+@@ -39,7 +39,7 @@ Usage:
+            run "make" and "make install"
+ 	   This will create the "olsrd_pgraph.so.1.1" file and install it. 
+ 
+-	3) Modify the "/etc/olsrd.conf" file of the system you wish to
++	3) Modify the "/etc/olsrd/olsrd.conf" file of the system you wish to
+ 	   monitor from to load the plugin. 
+ 	   Add the line: "LoadPlugin "olsrd_pgraph.so.1.1" {}"
+ 
+@@ -51,7 +51,7 @@ Usage:
+            # By default only localhost will be able to connect to the IPC
+ 	   # system of the olsrd process so if you are not going to be 
+ 	   # running pgraph locally, modify the "Host" variable of the 
+-	   # "IpcConnect" structure in the "/etc/olsrd.conf" file to 
++	   # "IpcConnect" structure in the "/etc/olsrd/olsrd.conf" file to 
+ 	   # reflect the IP address of the host you will be connecting from. 
+ 
+ 	5) Start olsrd and make sure that the plugin has loaded correctly.
+diff --git a/lib/quagga/README_QUAGGA b/lib/quagga/README_QUAGGA
+index 8e44f8d..c8efeaf 100644
+--- a/lib/quagga/README_QUAGGA
++++ b/lib/quagga/README_QUAGGA
+@@ -55,7 +55,7 @@ PlParam "Version" "<version>"
+ SAMPLE CONFIG
+ ---------------------------------------------------------------------
+ 
+-add in /usr/local/etc/olsrd.conf:
++add in /etc/olsrd/olsrd.conf:
+ 
+ LoadPlugin "olsrd_quagga.so.0.2.2"
+ {
+diff --git a/lib/watchdog/README_WATCHDOG b/lib/watchdog/README_WATCHDOG
+index f5eac1d..8397cb2 100644
+--- a/lib/watchdog/README_WATCHDOG
++++ b/lib/watchdog/README_WATCHDOG
+@@ -21,7 +21,7 @@ PlParam "interval" "5"
+ SAMPLE CONFIG
+ ---------------------------------------------------------------------
+ 
+-add in /etc/olsrd.conf:
++add in /etc/olsrd/olsrd.conf:
+ 
+ LoadPlugin "olsrd_watchdog.so.0.1"
+ {
+diff --git a/make/Makefile.linux b/make/Makefile.linux
+index 3fb19b9..03e1527 100644
+--- a/make/Makefile.linux
++++ b/make/Makefile.linux
+@@ -10,6 +10,7 @@ SRCS += 	$(wildcard src/linux/*.c src/unix/*.c)
+ HDRS +=		$(wildcard src/linux/*.h src/unix/*.h)
+ 
+ CPPFLAGS += 	-Dlinux -DLINUX_NETLINK_ROUTING
++CPPFLAGS +=	-DOLSRD_GLOBAL_CONF_FILE=\"$(CFGFILE)\"
+ LIBS +=		
+ 
+ PLUGIN_SONAME ?= lib$(PLUGIN_NAME).so
diff --git a/debian/patches/series b/debian/patches/series
index 5493688..8ae3563 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
 260-quagga-plugin-detect-protocol-version.patch
 270-gui-linux-gtk-align-olsr_ip_addr-to-olsr-definition-of-it.patch
 280-fix-linux-gtk-build.patch
+290-hardcode-etc-olsrd-olsrd-conf.patch
diff --git a/debian/rules b/debian/rules
index a67cfa8..1bc481e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -37,7 +37,7 @@ override_dh_auto_install:
 		$(CURDIR)/debian/olsrd-gui/usr/share/doc/olsrd-gui/changelog
 	gzip -9 $(CURDIR)/debian/olsrd-gui/usr/share/doc/olsrd-gui/changelog
 	# provide better default config
-	rm $(CURDIR)/debian/olsrd/etc/olsrd.conf
+	rm $(CURDIR)/debian/olsrd/etc/olsrd/olsrd.conf
 	cp $(CURDIR)/debian/olsrd.conf $(CURDIR)/debian/olsrd/etc/olsrd/olsrd.conf
 	cp  $(CURDIR)/debian/olsrd-default $(CURDIR)/debian/olsrd/etc/default/olsrd
 
-- 
1.7.5.4

Reply via email to