Dibbler is an IPv6 DHCP package Signed-off-by: Remy Bohmer <li...@bohmer.net> Signed-off-by: Bart vdr. Meulen <bartvdrmeu...@gmail.com> --- generic/etc/init.d/dibbler-client | 50 +++++++++ generic/etc/init.d/dibbler-relay | 50 +++++++++ generic/etc/init.d/dibbler-server | 50 +++++++++ patches/dibbler-0.7.3/fix-compile.patch | 31 ++++++ patches/dibbler-0.7.3/fix-incremental-build.patch | 24 ++++ patches/dibbler-0.7.3/merge-dns-search.patch | 36 +++++++ patches/dibbler-0.7.3/series | 3 + rules/dibbler.in | 68 ++++++++++++ rules/dibbler.make | 117 +++++++++++++++++++++ rules/initmethod-bbinit.in | 18 +++ rules/initmethod-bbinit.make | 18 +++ 11 files changed, 465 insertions(+), 0 deletions(-) create mode 100644 generic/etc/init.d/dibbler-client create mode 100644 generic/etc/init.d/dibbler-relay create mode 100644 generic/etc/init.d/dibbler-server create mode 100644 patches/dibbler-0.7.3/fix-compile.patch create mode 100644 patches/dibbler-0.7.3/fix-incremental-build.patch create mode 100644 patches/dibbler-0.7.3/merge-dns-search.patch create mode 100644 patches/dibbler-0.7.3/series create mode 100644 rules/dibbler.in create mode 100644 rules/dibbler.make
diff --git a/generic/etc/init.d/dibbler-client b/generic/etc/init.d/dibbler-client new file mode 100644 index 0000000..11d2b17 --- /dev/null +++ b/generic/etc/init.d/dibbler-client @@ -0,0 +1,50 @@ +#! /bin/sh +# +# Starts/stops dibbler-client +# + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/dibbler-client +NAME=dibbler-client +DESC="DHCPv6 client" +DAEMON_OPTS=run + +test -x $DAEMON || exit 0 + +# Include dibbler defaults if available +if [ -f /etc/default/dibbler ] ; then + . /etc/default/dibbler +fi + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + $DAEMON start 2>&1 > /dev/null + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + ($DAEMON stop 2>&1 > /dev/null; true) + echo "$NAME." + ;; + status) + echo "Status $DESC: $NAME" + $DAEMON status + ;; + restart|force-reload) + echo -n "Restarting $DESC: " + ($DAEMON stop 2>&1 > /dev/null; true) + sleep 1 + $DAEMON start 2>&1 > /dev/null + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/generic/etc/init.d/dibbler-relay b/generic/etc/init.d/dibbler-relay new file mode 100644 index 0000000..2925358 --- /dev/null +++ b/generic/etc/init.d/dibbler-relay @@ -0,0 +1,50 @@ +#! /bin/sh +# +# Starts/stops dibbler-relay +# + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/dibbler-relay +NAME=dibbler-relay +DESC="DHCPv6 relay" +DAEMON_OPTS=run + +test -x $DAEMON || exit 0 + +# Include dibbler defaults if available +if [ -f /etc/default/dibbler ] ; then + . /etc/default/dibbler +fi + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + $DAEMON start 2>&1 > /dev/null + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + ($DAEMON stop 2>&1 > /dev/null; true) + echo "$NAME." + ;; + status) + echo "Status $DESC: $NAME" + $DAEMON status + ;; + restart|force-reload) + echo -n "Restarting $DESC: " + ($DAEMON stop 2>&1 > /dev/null; true) + sleep 1 + $DAEMON start 2>&1 > /dev/null + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/generic/etc/init.d/dibbler-server b/generic/etc/init.d/dibbler-server new file mode 100644 index 0000000..d03c0c0 --- /dev/null +++ b/generic/etc/init.d/dibbler-server @@ -0,0 +1,50 @@ +#! /bin/sh +# +# Starts/stops dibbler-client +# + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/usr/sbin/dibbler-server +NAME=dibbler-server +DESC="DHCPv6 server" +DAEMON_OPTS=run + +test -x $DAEMON || exit 0 + +# Include dibbler defaults if available +if [ -f /etc/default/dibbler ] ; then + . /etc/default/dibbler +fi + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + $DAEMON start 2>&1 > /dev/null + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + ($DAEMON stop 2>&1 > /dev/null; true) + echo "$NAME." + ;; + status) + echo "Status $DESC: $NAME" + $DAEMON status + ;; + restart|force-reload) + echo -n "Restarting $DESC: " + ($DAEMON stop 2>&1 > /dev/null; true) + sleep 1 + $DAEMON start 2>&1 > /dev/null + echo "$NAME." + ;; + *) + N=/etc/init.d/$NAME + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/patches/dibbler-0.7.3/fix-compile.patch b/patches/dibbler-0.7.3/fix-compile.patch new file mode 100644 index 0000000..66a4cf5 --- /dev/null +++ b/patches/dibbler-0.7.3/fix-compile.patch @@ -0,0 +1,31 @@ +Fix compilation of dibbler package + +A header file is included that is not needed, and even breaks +compilation on recent kernels. Remove it. + +Signed-off-by: Remy Bohmer <li...@bohmer.net> +--- + Port-linux/utils.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +Index: dibbler-0.7.3/Port-linux/utils.c +=================================================================== +--- dibbler-0.7.3.orig/Port-linux/utils.c ++++ dibbler-0.7.3/Port-linux/utils.c +@@ -14,6 +14,7 @@ + * Rani Assaf <r...@magic.metawire.com> 980929: resolve addresses + */ + ++#define GNU_SOURCE + #include <stdio.h> + #include <stdlib.h> + #include <unistd.h> +@@ -26,7 +27,7 @@ + #include <arpa/inet.h> + #include <resolv.h> + #include <asm/types.h> +-#include <linux/pkt_sched.h> ++/*#include <linux/pkt_sched.h>*/ + #include <time.h> + #include <sys/time.h> + diff --git a/patches/dibbler-0.7.3/fix-incremental-build.patch b/patches/dibbler-0.7.3/fix-incremental-build.patch new file mode 100644 index 0000000..cf56d96 --- /dev/null +++ b/patches/dibbler-0.7.3/fix-incremental-build.patch @@ -0,0 +1,24 @@ +Fix incremental build of dibbler package + +The make install fails if the changelog.gz already exists. +So, the repair incremental builds make sure the changelog.gz +file does not exist before generating a new one. + +Signed-off-by: Remy Bohmer <li...@bohmer.net> +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: dibbler-0.7.3/Makefile +=================================================================== +--- dibbler-0.7.3.orig/Makefile ++++ dibbler-0.7.3/Makefile +@@ -428,7 +428,7 @@ install: + $(INSTALL) -m 644 doc/dibbler-devel.pdf $(INST_DOCDIR)/dibbler/dibbler-devel.pdf + @echo "[INSTALL] CHANGELOG" + $(INSTALL) -m 644 CHANGELOG $(INST_DOCDIR)/dibbler/changelog +- gzip -9 $(INST_DOCDIR)/dibbler/changelog ++ gzip -f -9 $(INST_DOCDIR)/dibbler/changelog + + DIR=`basename $(PWD)` + diff --git a/patches/dibbler-0.7.3/merge-dns-search.patch b/patches/dibbler-0.7.3/merge-dns-search.patch new file mode 100644 index 0000000..0792843 --- /dev/null +++ b/patches/dibbler-0.7.3/merge-dns-search.patch @@ -0,0 +1,36 @@ +Merge DNS search tables between IPv4 and IPv6 + +Without this patch the IPv4 search tables will be overwritten +once an IPv6 domain is added. With this patch both tables +will be merged. + +Signed-off-by: Bart vdr. Meulen <bartvdrmeu...@gmail.com> +Signed-off-by: Remy Bohmer <li...@bohmer.net> +--- + Port-linux/lowlevel-options-linux.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +Index: dibbler-0.7.3/Port-linux/lowlevel-options-linux.c +=================================================================== +--- dibbler-0.7.3.orig/Port-linux/lowlevel-options-linux.c ++++ dibbler-0.7.3/Port-linux/lowlevel-options-linux.c +@@ -199,11 +199,14 @@ int domain_add(const char* ifname, int i + return LOWLEVEL_ERROR_FILE; + while (fgets(buf,511,f)) { + if ( (!found) && (strstr(buf, "search")) ) { +- if (strlen(buf)) +- buf[strlen(buf)-1]=0; +- fprintf(f2, "%s %s\n", buf, domain); +- found = 1; +- continue; ++ if (!strstr(buf,domain)) { ++ if (strlen(buf)) ++ buf[strlen(buf)-1]=0; ++ fprintf(f2, "%s %s\n", buf, domain); ++ found = 1; ++ continue; ++ } ++ + } + fprintf(f2,"%s",buf); + } diff --git a/patches/dibbler-0.7.3/series b/patches/dibbler-0.7.3/series new file mode 100644 index 0000000..b492525 --- /dev/null +++ b/patches/dibbler-0.7.3/series @@ -0,0 +1,3 @@ +merge-dns-search.patch +fix-compile.patch +fix-incremental-build.patch diff --git a/rules/dibbler.in b/rules/dibbler.in new file mode 100644 index 0000000..f3b2a8a --- /dev/null +++ b/rules/dibbler.in @@ -0,0 +1,68 @@ +## SECTION=networking + +menuconfig DIBBLER + tristate + prompt "dibbler (DHCPv6) " + help + Dibbler is a portable DHCPv6 implementation. + It supports stateful (i.e. IPv6 address granting) as well as + stateless (i.e. option granting) autoconfiguration for IPv6. + +if DIBBLER + +config DIBBLER_SERVER + bool + prompt "Install server" + help + The Dibbler server supports both stateful (i.e. IPv6 address + granting) as well as stateless (i.e. options granting) + auto-configuration modes of the DHCPv6 protocol. Relays are also + supported. This package allows IPv6 hosts to be automatically + configured on the network. + +config DIBBLER_SERVER_STARTSCRIPT + bool + default y + prompt "install /etc/init.d/dibbler-server" + depends on DIBBLER_SERVER + help + Install the startup script for bbinit. + +config DIBBLER_CLIENT + bool + prompt "Install client" + help + The Dibbler client supports both stateful (i.e. IPv6 address + granting) as well as stateless (i.e. option granting) + auto-configuration modes of the DHCPv6 protocol. Besides basic + capabilities, it supports various DHCPv6 extensions, for instance + option renewal. Installing Dibbler allows obtaining IPv6 addresses and + options from a DHCPv6 server. + +config DIBBLER_CLIENT_STARTSCRIPT + bool + default y + prompt "install /etc/init.d/dibbler-client" + depends on DIBBLER_CLIENT + help + Install the startup script for bbinit. + +config DIBBLER_RELAY + bool + prompt "Install relay" + help + Relays are used as proxies between servers and clients. Their main + advantage is the ability to support multiple remote links using only + one server. Installing Dibbler relay allows serving multiple, not + physically connected, links with one DHCPv6 server. + +config DIBBLER_RELAY_STARTSCRIPT + bool + default y + prompt "install /etc/init.d/dibbler-relay" + depends on DIBBLER_RELAY + help + Install the startup script for bbinit. + +endif + diff --git a/rules/dibbler.make b/rules/dibbler.make new file mode 100644 index 0000000..be0e6fa --- /dev/null +++ b/rules/dibbler.make @@ -0,0 +1,117 @@ +# -*-makefile-*- +# +# Copyright (C) 2010 by Remy Bohmer <li...@bohmer.net> +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_DIBBLER) += dibbler + +# +# Paths and names +# +DIBBLER_VERSION := 0.7.3 +DIBBLER := dibbler-$(DIBBLER_VERSION) +DIBBLER_SUFFIX := tar.gz +DIBBLER_URL := http://klub.com.pl/dhcpv6/dibbler/$(DIBBLER)-src.$(DIBBLER_SUFFIX) +DIBBLER_SOURCE := $(SRCDIR)/$(DIBBLER)-src.$(DIBBLER_SUFFIX) +DIBBLER_DIR := $(BUILDDIR)/$(DIBBLER) +DIBBLER_LICENSE := GPLv2 + +# ---------------------------------------------------------------------------- +# Get +# ---------------------------------------------------------------------------- + +$(DIBBLER_SOURCE): + @$(call targetinfo) + @$(call get, DIBBLER) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +DIBBLER_MAKE_ENV := $(CROSS_ENV_CC) $(CROSS_ENV_CXX) +DIBBLER_MAKE_OPT := CHOST=$(PTXCONF_GNU_TARGET) +DIBBLER_MAKE_PAR := NO + +# +# autoconf +# +# Remove the pre-configure of a sub-component, so configure is +# called in make for correct cross-compilation +$(STATEDIR)/dibbler.prepare: + @$(call targetinfo) + @rm -f $(DIBBLER_DIR)/poslib/config.h + @$(call touch) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +DIBBLER_INSTALL_OPT := \ + INST_WORKDIR=$(DIBBLER_PKGDIR)/var/lib/dibbler \ + INST_MANDIR=$(DIBBLER_PKGDIR)/usr/share/man \ + INST_DOCDIR=$(DIBBLER_PKGDIR)/usr/share/doc \ + INST_BINDIR=$(DIBBLER_PKGDIR)/usr/sbin \ + INST_CONFDIR=$(DIBBLER_PKGDIR)/etc/dibbler \ + install + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/dibbler.targetinstall: + @$(call targetinfo) + + @$(call install_init, dibbler) + @$(call install_fixup, dibbler,PACKAGE,dibbler) + @$(call install_fixup, dibbler,PRIORITY,optional) + @$(call install_fixup, dibbler,VERSION,$(DIBBLER_VERSION)) + @$(call install_fixup, dibbler,SECTION,base) + @$(call install_fixup, dibbler,AUTHOR,"Remy Bohmer <li...@bohmer.net>") + @$(call install_fixup, dibbler,DEPENDS,) + @$(call install_fixup, dibbler,DESCRIPTION,missing) + + @$(call install_copy, dibbler, 0, 0, 0755, /etc/dibbler) + @$(call install_copy, dibbler, 0, 0, 0755, /var/lib/dibbler) + @$(call install_copy, dibbler, 0, 0, 0755, /var/log/dibbler) + +ifdef PTXCONF_DIBBLER_SERVER + @$(call install_copy, dibbler, 0, 0, 0755, -, /usr/sbin/dibbler-server) + @$(call install_copy, dibbler, 0, 0, 0644, -, /etc/dibbler/server.conf) + @$(call install_alternative, dibbler, 0, 0, 0644, /etc/dibbler/server-stateless.conf) +endif + +ifdef PTXCONF_DIBBLER_SERVER_STARTSCRIPT + @$(call install_alternative, dibbler, 0, 0, 0755, /etc/init.d/dibbler-server) +endif + +ifdef PTXCONF_DIBBLER_CLIENT + @$(call install_copy, dibbler, 0, 0, 0755, -, /usr/sbin/dibbler-client) + @$(call install_alternative, dibbler, 0, 0, 0644, /etc/dibbler/client.conf) + @$(call install_alternative, dibbler, 0, 0, 0644, /etc/dibbler/client-stateless.conf) +endif + +ifdef PTXCONF_DIBBLER_CLIENT_STARTSCRIPT + @$(call install_alternative, dibbler, 0, 0, 0755, /etc/init.d/dibbler-client) +endif + +ifdef PTXCONF_DIBBLER_RELAY + @$(call install_copy, dibbler, 0, 0, 0755, -, /usr/sbin/dibbler-relay) + @$(call install_alternative, dibbler, 0, 0, 0644, /etc/dibbler/relay.conf) +endif + +ifdef PTXCONF_DIBBLER_RELAY_STARTSCRIPT + @$(call install_alternative, dibbler, 0, 0, 0755, /etc/init.d/dibbler-relay) +endif + + @$(call install_finish, dibbler) + @$(call touch) + +# vim: syntax=make diff --git a/rules/initmethod-bbinit.in b/rules/initmethod-bbinit.in index 274ae66..5c89690 100644 --- a/rules/initmethod-bbinit.in +++ b/rules/initmethod-bbinit.in @@ -303,6 +303,24 @@ config INITMETHOD_BBINIT_LINK_LVM2 prompt "lvm2" default "S20lvm2" +config INITMETHOD_BBINIT_LINK_DIBBLER_SERVER + string + depends on DIBBLER_SERVER_STARTSCRIPT + prompt "dibbler-server" + default "S27dibbler-server" + +config INITMETHOD_BBINIT_LINK_DIBBLER_CLIENT + string + depends on DIBBLER_CLIENT_STARTSCRIPT + prompt "dibbler-client" + default "S27dibbler-client" + +config INITMETHOD_BBINIT_LINK_DIBBLER_RELAY + string + depends on DIBBLER_RELAY_STARTSCRIPT + prompt "dibbler-relay" + default "S27dibbler-relay" + endmenu endif diff --git a/rules/initmethod-bbinit.make b/rules/initmethod-bbinit.make index cdca3cb..e08ee8f 100644 --- a/rules/initmethod-bbinit.make +++ b/rules/initmethod-bbinit.make @@ -363,6 +363,24 @@ ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_LVM2)),) /etc/rc.d/$(PTXCONF_INITMETHOD_BBINIT_LINK_LVM2)) endif +ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_DIBBLER_SERVER)),) + @$(call install_link, initmethod-bbinit, \ + ../init.d/dibbler-server, \ + /etc/rc.d/$(PTXCONF_INITMETHOD_BBINIT_LINK_DIBBLER_SERVER)) +endif + +ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_DIBBLER_CLIENT)),) + @$(call install_link, initmethod-bbinit, \ + ../init.d/dibbler-client, \ + /etc/rc.d/$(PTXCONF_INITMETHOD_BBINIT_LINK_DIBBLER_CLIENT)) +endif + +ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_DIBBLER_RELAY)),) + @$(call install_link, initmethod-bbinit, \ + ../init.d/dibbler-relay, \ + /etc/rc.d/$(PTXCONF_INITMETHOD_BBINIT_LINK_DIBBLER_RELAY)) +endif + ifneq ($(call remove_quotes,$(PTXCONF_INITMETHOD_BBINIT_LINK_FAKE_OVERLAYFS)),) @$(call install_link, initmethod-bbinit, \ ../init.d/fake-overlayfs, \ -- 1.7.0.4 -- ptxdist mailing list ptxdist@pengutronix.de