[email protected] wrote: > From: Carsten Schlote <[email protected]> > > This packet provides IPV6 networking with the > tereodo protocol. > > Signed-off-by: Carsten Schlote <[email protected]> > --- > generic/etc/init.d/miredo-server | 89 +++++++++++++++++ > generic/etc/miredo/client-hook | 70 +++++++++++++ > generic/etc/miredo/miredo-server.conf | 22 ++++ > generic/etc/miredo/miredo.conf | 35 +++++++ > patches/miredo-1.2.2/autogen.sh | 16 +++ > patches/miredo-1.2.2/mireo-autogen.sh.patch | 81 +++++++++++++++ > patches/miredo-1.2.2/series | 1 + > rules/miredo.in | 16 +++ > rules/miredo.make | 144 > +++++++++++++++++++++++++++ > 9 files changed, 474 insertions(+), 0 deletions(-) > create mode 100644 generic/etc/init.d/miredo-server > create mode 100644 generic/etc/miredo/client-hook > create mode 100644 generic/etc/miredo/miredo-server.conf > create mode 100644 generic/etc/miredo/miredo.conf > create mode 100644 patches/miredo-1.2.2/autogen.sh > create mode 100644 patches/miredo-1.2.2/mireo-autogen.sh.patch > create mode 100644 patches/miredo-1.2.2/series > create mode 100644 rules/miredo.in > create mode 100644 rules/miredo.make > > diff --git a/generic/etc/init.d/miredo-server > b/generic/etc/init.d/miredo-server > new file mode 100644 > index 0000000..271d173 > --- /dev/null > +++ b/generic/etc/init.d/miredo-server > @@ -0,0 +1,89 @@ > +#! /bin/sh > +# $Id: miredo-server.init 1754 2006-09-18 14:25:04Z remi $ > +# > +# miredo-server start/stop script for Debian GNU/Linux > +# Author: Rémi Denis-Courmont <rdenis (at) simphalempin (dot) com> > +# > +# chkconfig: 345 17 83 > +# description: Starts and stops the miredo-server daemon \ > +# used to provide a Teredo server. > +# > +### BEGIN INIT INFO > +# Provides: > +# Required-Start: $local_fs $remote_fs $network $syslog $time > +# Required-Stop: $local_fs $remote_fs $syslog > +# Short-Description: Teredo server > +# Description: miredo-server daemon to provide a Teredo server > +# Default-Start: 3 4 5 > +# Default-Stop: 0 1 2 6 > +### END INIT INFO > + > + > +PATH=/usr/sbin:/usr/bin:/sbin:/bin > +DESC="Teredo server daemon" > +NAME=miredo-server > +DAEMON=/usr/sbin/$NAME > +DAEMON_ARGS="" > +PIDFILE=/var/run/$NAME.pid > +SCRIPTNAME=/etc/init.d/$NAME > + > +[ -x "$DAEMON" ] || exit 0 > + > +# Source defaults. > +[ -r /etc/default/$NAME ] && . /etc/default/$NAME > + > +# Ensure configuration is readable. > +[ -r /etc/$NAME.conf ] || exit 0 > + > +. /lib/lsb/init-functions > + > +check_start() { > + if [ "x$START_MIREDO_SERVER" != "xtrue" ]; then > + echo "START_MIREDO_SERVER is set to false in > /etc/default/$NAME" > + echo "$DAEMON not starting" > + exit 0 > + fi > +} > + > +check_chroot_dir() { > + if [ -d "/var/run/$NAME" ]; then > + mkdir -p "/var/run/$NAME" > + chmod 0755 "/var/run/$NAME" > + fi > +} > + > + > +case "$1" in > + start) > + check_start > + check_chroot_dir > + log_daemon_msg "Starting $DESC" "$NAME" > + start-stop-daemon --start --quiet --pidfile "$PIDFILE" \ > + --exec "$DAEMON" --oknodo -- $DAEMON_ARGS > + log_end_msg $? > + ;; > + stop) > + log_daemon_msg "Stopping $DESC" "$NAME" > + start-stop-daemon --stop --quiet --pidfile "$PIDFILE" \ > + --retry 1 --oknodo > + log_end_msg $? > + ;; > + reload|force-reload) > + log_daemon_msg "Reloading $DESC" "$NAME" > + start-stop-daemon --stop --signal 1 --quiet --pidfile "$PIDFILE" \ > + --exec "$DAEMON" > + log_end_msg $? > + ;; > + restart) > + check_start # avoid stopping if would not restart > + $0 stop > + sleep 1 > + $0 start > + ;; > + *) > + echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" > >&2 > + exit 1 > + ;; > +esac > + > +exit $? > diff --git a/generic/etc/miredo/client-hook b/generic/etc/miredo/client-hook > new file mode 100644 > index 0000000..87ae405 > --- /dev/null > +++ b/generic/etc/miredo/client-hook > @@ -0,0 +1,70 @@ > +#! /bin/sh > +# > +# Miredo client hook script for Linux/iproute2 > +# Copyright © 2007 Rémi Denis-Courmont. > +# Distributed under the terms of the GNU General Public License version 2. > + > +# Linux iproute2 path: > +IP="/sbin/ip" > + > +# Linux default route default metric is 1024 > +# (we put 1029 so that Teredo is used as a last resort): > +METRIC=1029 > + > +# Linux routing table ID > +# (possible values: 1-252 from /etc/iproute/rt_tables): > +TABLE="teredo" > + > +# Linux routing rule priority > +# (possible values: 1-32765, lowest number is highest priority): > +PRIO=32765 > + > +# MTU for the tunnel interface > +# (default: specified by the Teredo server, or 1280) > +#MTU=1400 > + > +if ! test -x "$IP"; then > + echo "$0: iproute2 is required! Please install it." >&2 > + exit 1 > +fi > + > +# Nothing to do with destroy event > +if test "$STATE" = "destroy"; then exit 0; fi > + > +# If the source routing table is not configured, ignore it. > +if ! "$IP" route show table "$TABLE" >/dev/null 2>&1; then > + unset TABLE > +else > + if test "$OLD_ADDRESS"; then > + "$IP" -6 rule del from "$OLD_ADDRESS" \ > + prio "$PRIO" table "$TABLE" 2>/dev/null > + fi > + "$IP" -6 route flush table "$TABLE" 2>/dev/null > +fi > + > +"$IP" -6 route flush dev "$IFACE" 2>/dev/null > +"$IP" -6 address flush dev "$IFACE" 2>/dev/null > + > +"$IP" -6 link set dev "$IFACE" "$STATE" > +if test "$MTU"; then > + "$IP" link set dev "$IFACE" mtu "$MTU" > +fi > + > +case "$STATE" in > + up) > + "$IP" -6 address add "${LLADDRESS}/64" dev "$IFACE" > + "$IP" -6 address add "${ADDRESS}/32" dev "$IFACE" > + "$IP" -6 route add default dev "$IFACE" metric "$METRIC" > + > + if test "$TABLE"; then > + "$IP" -6 route add default dev "$IFACE" table "$TABLE" > + "$IP" -6 rule add from "$ADDRESS" \ > + prio "$PRIO" table "$TABLE" > + fi > +esac > + > +# This should be required when changing policy routing rules, but it > +# seems to confuse certain kernels into removing our default route! > +#"$IP" -6 route flush cache 2>/dev/null > + > +exit 0 > diff --git a/generic/etc/miredo/miredo-server.conf > b/generic/etc/miredo/miredo-server.conf > new file mode 100644 > index 0000000..b2e2613 > --- /dev/null > +++ b/generic/etc/miredo/miredo-server.conf > @@ -0,0 +1,22 @@ > +#! /usr/sbin/miredo-server -f -c > +# > +# Sample configuration file for miredo-server > + > +# Please refer to the miredo-server.conf(5) manpage for details. > + > +# Server primary IPv4 address. > +# Two public IPv4 addresses are needed to operate a Teredo server. > +# Miredo will open UDP port 3544 on both addresses. > +ServerBindAddress 192.0.2.221 > + > +# Server secondary IPv4 address. > +# The Microsoft Windows Teredo client implementation assumes that the > +# secondary address is the primary address plus one. This is the > +# default unless uncommented. > +#ServerBindAddress2 192.0.2.222 > + > +#SyslogFacility user > + > +# Think twice before modifying the settings above. > +#Prefix 2001:0:: > +#InterfaceMTU 1280 > diff --git a/generic/etc/miredo/miredo.conf b/generic/etc/miredo/miredo.conf > new file mode 100644 > index 0000000..732de88 > --- /dev/null > +++ b/generic/etc/miredo/miredo.conf > @@ -0,0 +1,35 @@ > +#! /usr/sbin/miredo -f -c > +# > +# Sample configuration file for Miredo > + > +# Please refer to the miredo.conf(5) man page for details. > + > +# Miredo can safely run as a Teredo client, which is the default. > +#RelayType client > + > +# Name of the network tunneling interface. > +InterfaceName teredo > + > +# Depending on the local firewall/NAT rules, you might need to force > +# Miredo to use a fixed UDP port and or IPv4 address. > +#BindPort 3545 > +#BindAddress 192.0.2.100 > + > +#SyslogFacility user > + > +## CLIENT-SPECIFIC OPTIONS > +# The hostname or primary IPv4 address of the Teredo server. > +# This setting is required if Miredo runs as a Teredo client. > +#**************************************************************************# > +# teredo.remlab.net is an experimental service for testing only. # > +# Please use another server for production and/or large scale deployments. # > +#**************************************************************************# > +#ServerAddress teredo.ipv6.microsoft.com > +#ServerAddress teredo.ginzado.ne.jp > +#ServerAddress teredo.iks-jena.de > +ServerAddress teredo.remlab.net > +#ServerAddress2 teredo2.remlab.net > + > +## RELAY-SPECIFIC OPTIONS > +#Prefix 2001:0:: > +#InterfaceMTU 1280 > diff --git a/patches/miredo-1.2.2/autogen.sh b/patches/miredo-1.2.2/autogen.sh > new file mode 100644 > index 0000000..cd5c6d6 > --- /dev/null > +++ b/patches/miredo-1.2.2/autogen.sh > @@ -0,0 +1,16 @@ > +#!/bin/bash > + > +aclocal $ACLOCAL_FLAGS > + > +libtoolize \ > + --force \ > + --copy > + > +autoreconf \ > + --force \ > + --install \ > + --warnings=cross \ > + --warnings=syntax \ > + --warnings=obsolete \ > + --warnings=unsupported > +
can you use the generic autogen.sh provided by ptxdist? > diff --git a/patches/miredo-1.2.2/mireo-autogen.sh.patch > b/patches/miredo-1.2.2/mireo-autogen.sh.patch > new file mode 100644 > index 0000000..653a6d4 > --- /dev/null > +++ b/patches/miredo-1.2.2/mireo-autogen.sh.patch > @@ -0,0 +1,81 @@ > +--- > + autogen.sh | 69 > +++++++++++-------------------------------------------------- > + 1 file changed, 13 insertions(+), 56 deletions(-) > + > +Index: miredo-1.2.2/autogen.sh > +=================================================================== > +--- miredo-1.2.2.orig/autogen.sh 2009-12-03 13:41:32.000000000 +0100 > ++++ miredo-1.2.2/autogen.sh 2009-12-03 13:41:42.000000000 +0100 > +@@ -1,59 +1,16 @@ > +-#! /bin/sh > +-# GIT package rebuild script > +-# > +-# *********************************************************************** > +-# * Copyright © 2002-2008 Rémi Denis-Courmont. * > +-# * This program is free software; you can redistribute and/or modify * > +-# * it under the terms of the GNU General Public License as published * > +-# * by the Free Software Foundation; version 2 of the license. * > +-# * * > +-# * This program is distributed in the hope that it will be useful, * > +-# * but WITHOUT ANY WARRANTY; without even the implied warranty of * > +-# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * > +-# * See the GNU General Public License for more details. * > +-# * * > +-# * You should have received a copy of the GNU General Public License * > +-# * along with this program; if not, you can get it from: * > +-# * http://www.gnu.org/copyleft/gpl.html * > +-# *********************************************************************** > ++#!/bin/bash > + > +-set -xe > ++aclocal $ACLOCAL_FLAGS > + > +-if test -f doc/miredo.8-in ; then > +- true > +-elif test -f ../doc/miredo.8-in; then > +- cd .. > +-else > +- echo "You must run this script from your miredo SVN directory." > +- false > +-fi > +- > +-echo "Autoreconf in $PWD ..." > +- > +-autoreconf -sfi > +-unlink po/Makevars.template > +- > +-for d in /usr /usr/local /opt/gettext /opt/local/share/gettext \ > +- /usr/pkg "$HOME"; do > +- if test -f "$d/share/gettext/gettext.h" ; then > +- cp -f -- "$d/share/gettext/gettext.h" include/gettext.h > +- fi > +-done > +- > +-set +x > +- > +-test -f "include/gettext.h" || { > +-echo "Error: can't find <gettext.h> convenience C header." > +-echo "Please put a link to it by hand as include/gettext.h" > +-exit 1 > +-} > +-sed \ > +- -e 's,!__STRICT_ANSI__,!defined(__STRICT_ANSI__),g' \ > +- -e 's,if ENABLE_NLS,ifdef ENABLE_NLS,g' \ > +- -i include/gettext.h > +- > +-echo "" > +-echo "Type \`./configure' to configure the package for your system" > +-echo "(type \`./configure -- help' for help)." > +-echo "Then you can use the usual \`make', \`make install', etc." > ++libtoolize \ > ++ --force \ > ++ --copy > ++ > ++autoreconf \ > ++ --force \ > ++ --install \ > ++ --warnings=cross \ > ++ --warnings=syntax \ > ++ --warnings=obsolete \ > ++ --warnings=unsupported > + > diff --git a/patches/miredo-1.2.2/series b/patches/miredo-1.2.2/series > new file mode 100644 > index 0000000..770b180 > --- /dev/null > +++ b/patches/miredo-1.2.2/series > @@ -0,0 +1 @@ > +mireo-autogen.sh.patch > diff --git a/rules/miredo.in b/rules/miredo.in > new file mode 100644 > index 0000000..771a63b > --- /dev/null > +++ b/rules/miredo.in > @@ -0,0 +1,16 @@ > +## SECTION=networking > +menuconfig MIREDO > + tristate > + prompt "miredo" > + help > + Miredo is an open-source implementation of the Teredo: Tunneling IPv6 > over UDP > + through NATs Internet proposed standard (RFC 4380), targetting the > Linux kernel > + and BSD operating systems. The purpose of Teredo IPv6 tunneling is to > provide > + IPv6 connectivity to users behind NAT devices, such as most broadband > routers, > + most of which do not support IPv6. > + > +if MIREDO > + > + > + > +endif please don't add a menu, if it doesn't have options > diff --git a/rules/miredo.make b/rules/miredo.make > new file mode 100644 > index 0000000..f091b25 > --- /dev/null > +++ b/rules/miredo.make > @@ -0,0 +1,144 @@ > +# -*-makefile-*- > +# $Id$ please remove that line > +# > +# Copyright (C) 2008 by Carsten Schlote <[email protected]> > +# > +# 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_MIREDO) += miredo > + > +# > +# Paths and names > +# > +MIREDO_VERSION := 1.2.2 > +MIREDO := miredo-$(MIREDO_VERSION) > +MIREDO_SUFFIX := tar.bz2 > +MIREDO_URL := > http://www.remlab.net/files/miredo//$(MIREDO).$(MIREDO_SUFFIX) ^^ one / should be enough > +MIREDO_SOURCE := $(SRCDIR)/$(MIREDO).$(MIREDO_SUFFIX) > +MIREDO_DIR := $(BUILDDIR)/$(MIREDO) > + > +# > ---------------------------------------------------------------------------- > +# Get > +# > ---------------------------------------------------------------------------- > + > +$(MIREDO_SOURCE): > + @$(call targetinfo) > + @$(call get, MIREDO) > + > +# > ---------------------------------------------------------------------------- > +# Extract > +# > ---------------------------------------------------------------------------- > + > +$(STATEDIR)/miredo.extract: > + @$(call targetinfo) > + @$(call clean, $(MIREDO_DIR)) > + @$(call extract, MIREDO) > + @$(call patchin, MIREDO) > + @$(call touch) please remove that rule > + > +# > ---------------------------------------------------------------------------- > +# Prepare > +# > ---------------------------------------------------------------------------- > + > +MIREDO_PATH := PATH=$(CROSS_PATH) > +MIREDO_ENV := $(CROSS_ENV) > + > +# > +# autoconf > +# > +MIREDO_AUTOCONF := $(CROSS_AUTOCONF_USR) \ > + --localstatedir=/var \ > + --without-Judy > + > +$(STATEDIR)/miredo.prepare: > + @$(call targetinfo) > + @$(call clean, $(MIREDO_DIR)/config.cache) > + @cd $(MIREDO_DIR) && \ > + $(MIREDO_PATH) $(MIREDO_ENV) \ > + ./configure $(MIREDO_AUTOCONF) > + @$(call touch) please remove that rule > + > +# > ---------------------------------------------------------------------------- > +# Compile > +# > ---------------------------------------------------------------------------- > + > +$(STATEDIR)/miredo.compile: > + @$(call targetinfo) > + cd $(MIREDO_DIR) && $(MIREDO_PATH) $(MAKE) $(PARALLELMFLAGS) > + @$(call touch) please remove that rule > + > +# > ---------------------------------------------------------------------------- > +# Install > +# > ---------------------------------------------------------------------------- > + > +$(STATEDIR)/miredo.install: > + @$(call targetinfo) > + @$(call install, MIREDO) > + @$(call touch) please remove that rule > + > +# > ---------------------------------------------------------------------------- > +# Target-Install > +# > ---------------------------------------------------------------------------- > + > +$(STATEDIR)/miredo.targetinstall: > + @$(call targetinfo) > + > + @$(call install_init, miredo) > + @$(call install_fixup, miredo,PACKAGE,miredo) > + @$(call install_fixup, miredo,PRIORITY,optional) > + @$(call install_fixup, miredo,VERSION,$(MIREDO_VERSION)) > + @$(call install_fixup, miredo,SECTION,base) > + @$(call install_fixup, miredo,AUTHOR,"Carsten Schlote > <[email protected]>") > + @$(call install_fixup, miredo,DEPENDS,) > + @$(call install_fixup, miredo,DESCRIPTION,missing) > + > + # -- Library section > + > + @$(call install_copy, miredo, 0, 0, 0644, -, > /usr/lib/libteredo.so.5.0.0) > + @$(call install_link, miredo, libteredo.so.5.0.0, > /usr/lib/libteredo.so.5) > + > + @$(call install_copy, miredo, 0, 0, 0644, -, /usr/lib/libtun6.so.0.1.1) > + @$(call install_link, miredo, libtun6.so.0.1.1, /usr/lib/libtun6.so.0.1) > + @$(call install_link, miredo, libtun6.so.0.1.1, /usr/lib/libtun6.so.0) > + > + @$(call install_copy, miredo, 0, 0, 0755, -, > /usr/lib/miredo/miredo-privproc) > + > + # -- Executables > + > + @$(call install_copy, miredo, 0, 0, 0755, -, /usr/bin/teredo-mire) > + > + @$(call install_copy, miredo, 0, 0, 0755, -, /usr/sbin/miredo) > + @$(call install_copy, miredo, 0, 0, 0755, -, /usr/sbin/miredo-server) > + @$(call install_copy, miredo, 0, 0, 0755, -, /usr/sbin/miredo-checkconf) > + > + # -- Configs > + > + @$(call install_copy, miredo, 0, 0, 0755, -, /etc/miredo/client-hook) > + @$(call install_copy, miredo, 0, 0, 0644, -, /etc/miredo/miredo.conf) > + > + @$(call install_copy, miredo, 0, 0, 0644, > $(MIREDO_DIR)/misc/miredo-server.conf, /etc/miredo/miredo-server.conf) please consider copying miredo-server.conf to generic/etc and use install_alternative, here > + > + #...@$(call install_alternate, miredo, 0, 0, 0644, > /etc/init.d/miredo-server, n) > + > + @$(call install_finish, miredo) > + > + @$(call touch) > + > + > +# > ---------------------------------------------------------------------------- > +# Clean > +# > ---------------------------------------------------------------------------- > + > +miredo_clean: > + rm -rf $(STATEDIR)/miredo.* > + rm -rf $(PKGDIR)/miredo_* > + rm -rf $(MIREDO_DIR) > + > +# vim: syntax=make > > > ------------------------------------------------------------------------ > > -- > ptxdist mailing list > [email protected] cheers, Marc -- Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
signature.asc
Description: OpenPGP digital signature
-- ptxdist mailing list [email protected]
