summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Buerger <b.buerger@pengutronix.de>2009-09-06 15:19:54 +0200
committerBjoern Buerger <b.buerger@pengutronix.de>2009-09-15 11:01:44 +0200
commit06efa6376165f8a8feb28d3af47d23716b670a27 (patch)
tree2703f16e70de81fe895e3f619f8ea42b2332c658
parent7bac12ba5c7343771b4b80f80a8ba1dd33c7e989 (diff)
downloadptxdist-06efa6376165f8a8feb28d3af47d23716b670a27.tar.gz
ptxdist-06efa6376165f8a8feb28d3af47d23716b670a27.tar.xz
[avahi] added basic avahi support (zeroconf,mdns,IPv4)
Signed-off-by: Bjoern Buerger <b.buerger@pengutronix.de>
-rwxr-xr-xgeneric/etc/init.d/avahi-daemon101
-rwxr-xr-xgeneric/etc/init.d/zeroconf103
-rw-r--r--rules/avahi.in141
-rw-r--r--rules/avahi.make128
4 files changed, 437 insertions, 36 deletions
diff --git a/generic/etc/init.d/avahi-daemon b/generic/etc/init.d/avahi-daemon
new file mode 100755
index 000000000..7dc8be67c
--- /dev/null
+++ b/generic/etc/init.d/avahi-daemon
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+# This is a avahi-daemon init.d script which is called by init(1) with [start|stop] as argument
+# Mi 22. Jul 21:46:28 CEST 2009
+
+#set -e
+PATH=/sbin:/bin:/usr/bin
+BINARY=/usr/sbin/avahi-daemon
+OPTIONS="-D"
+
+test -f $BINARY || { echo "$BINARY not found" >&2 ; exit 0; }
+test -f /etc/default/avahi-daemon && . /etc/default/avahi-daemon
+
+start_proc(){
+$BINARY -c && return 0
+$BINARY -D
+case $? in
+ 0)
+ echo " [+] (avahi-daemon)"
+ ;;
+ *)
+ echo " [!] (avahi-daemon)"
+ ;;
+esac
+}
+
+stop_proc(){
+if $BINARY -c ; then
+ $BINARY -k
+ case $? in
+ 0)
+ echo " [-] (avahi-daemon)"
+ ;;
+ *)
+ echo " [!] (avahi-daemon)"
+ ;;
+ esac
+fi
+}
+
+refresh_proc(){
+if $BINARY -c ; then
+ $BINARY -r
+ case $? in
+ 0)
+ echo " [*] (avahi-daemon)"
+ ;;
+ *)
+ echo " [!] (avahi-daemon)"
+ ;;
+ esac
+fi
+}
+
+check_proc(){
+$BINARY -c
+case $? in
+ 0)
+ echo " [+] (avahi-daemon)"
+ ;;
+ *)
+ echo " [-] (avahi-daemon)"
+ ;;
+esac
+}
+
+
+
+case "$1" in
+ start)
+ start_proc
+ ;;
+ stop)
+ stop_proc
+ ;;
+ restart|force-reload)
+ stop_proc
+ sleep 2
+ start_proc
+ ;;
+ reload)
+ refresh_proc
+ ;;
+ status)
+ check_proc
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|reload|restart|force-reload}"
+ echo ""
+ echo "Status Flags:"
+ echo "[+] -> started"
+ echo "[-] -> not started"
+ echo "[*] -> reloaded"
+ echo "[!] -> error - please debug without -D option"
+ echo ""
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/generic/etc/init.d/zeroconf b/generic/etc/init.d/zeroconf
new file mode 100755
index 000000000..ad4ebc135
--- /dev/null
+++ b/generic/etc/init.d/zeroconf
@@ -0,0 +1,103 @@
+#!/bin/sh
+#
+# This is a zeroconf init.d script which ist called by init(1) with [start|stop] as argument
+# Mi 22. Jul 21:46:28 CEST 2009
+
+PATH=/sbin:/bin:/usr/bin
+BINARY=/usr/sbin/avahi-autoipd
+OPTIONS="--force-bind -D"
+INTERFACES="eth0"
+
+test -f $BINARY || { echo "$BINARY not found" >&2 ; exit 0; }
+
+start_proc(){
+ for i in $INTERFACES; do
+ $BINARY $OPTIONS $i
+ case $? in
+ 0)
+ echo " [+] $i (zeroconf)"
+ ;;
+ *)
+ echo " [!] $i (zeroconf)"
+ ;;
+ esac
+ done
+}
+
+stop_proc(){
+ for i in $INTERFACES; do
+ $BINARY --kill $i
+ case $? in
+ 0)
+ echo " [-] $i (zeroconf)"
+ ;;
+ *)
+ echo " [!] $i (zeroconf)"
+ ;;
+ esac
+ done
+}
+
+refresh_proc(){
+ for i in $INTERFACES; do
+ $BINARY --refresh $i
+ case $? in
+ 0)
+ echo " [*] $i (zeroconf)"
+ ;;
+ *)
+ echo " [!] $i (zeroconf)"
+ ;;
+ esac
+ done
+}
+
+check_proc(){
+ for i in $INTERFACES; do
+ $BINARY --check $i
+ case $? in
+ 0)
+ echo " [+] $i (zeroconf)"
+ ;;
+ *)
+ echo " [-] $i (zeroconf)"
+ ;;
+ esac
+ done
+}
+
+
+
+case "$1" in
+ start)
+ start_proc
+ ;;
+ stop)
+ stop_proc
+ ;;
+ restart|force-reload)
+ stop_proc
+ sleep 2
+ start_proc
+ ;;
+ reload)
+ refresh_proc
+ ;;
+ status)
+ check_proc
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|reload|restart|force-reload}"
+ echo ""
+ echo "Status Flags:"
+ echo "[+] -> started"
+ echo "[-] -> not started"
+ echo "[*] -> reloaded"
+ echo "[!] -> error - please debug without -D option"
+ echo ""
+ exit 1
+ ;;
+esac
+
+exit 0
+
diff --git a/rules/avahi.in b/rules/avahi.in
index ecf6a47a5..a5d6fb1b7 100644
--- a/rules/avahi.in
+++ b/rules/avahi.in
@@ -1,8 +1,143 @@
## SECTION=networking
-config AVAHI
+menuconfig AVAHI
tristate
- depends on BROKEN
- prompt "avahi"
+ select HOST_INTLTOOL
+ select LIBDAEMON
+ select EXPAT
+ prompt "avahi "
help
Avahi is a system which facilitates service discovery on a local network.
+
+if AVAHI
+
+config AVAHI_GLIB
+ bool
+ prompt "enable glib support"
+ help
+ --enable-glib
+
+config AVAHI_GOBJECT
+ bool
+ prompt "enable gobject support"
+ help
+ --enable-gobject
+
+config AVAHI_QT3
+ bool
+ prompt "enable qt3 support"
+ help
+ --enable-qt3
+
+config AVAHI_QT4
+ bool
+ prompt "enable qt4 support"
+ help
+ --enable-qt4
+
+config AVAHI_GTK
+ bool
+ prompt "enable gtk support"
+ help
+ --enable-gtk
+
+config AVAHI_DBUS
+ bool
+ prompt "enable dbus support"
+ help
+ --enable-dbus
+
+if AVAHI_DBUS
+config AVAHI_DBUS_SYS
+ string
+ prompt "Path to D-Bus system.d directory"
+ default "unconfigured"
+ help
+ Enter the Path to the D-Bus system.d directory
+
+config AVAHI_DBUS_SOCKET
+ string
+ prompt "Path to the D-Bus system socket"
+ default "unconfigured"
+ help
+ Enter the Path to the D-Bus system socket, you probably want
+ to put unix:path= at the start. Only needed for very
+ old D-Bus releases
+endif
+
+config AVAHI_DAEMON
+ bool
+ prompt "avahi-daemon"
+ help
+ Install the avahi-daemon program
+
+if AVAHI_DAEMON
+config AVAHI_USER
+ string
+ prompt "user for running the avahi (mDNS/DNS-SD) daemon"
+ default "avahi"
+ help
+ Enter the user name to run the avahi (mDNS/DNS-SD) daemon with.
+ The PTXdist standard configuration has only root, so if you want
+ to use the avahi default user "avahi" you have to create
+ a related user yourself.
+
+config AVAHI_GROUP
+ string
+ prompt "group for running the avahi (mDNS/DNS-SD) daemon"
+ default "avahi"
+ help
+ Enter the group name to run the avahi (mDNS/DNS-SD) daemon with.
+ The PTXdist standard configuration has only root, so if you want
+ to use the avahi default group "avahi" you have to create
+ a related group yourself.
+
+config AVAHI_SERVICES
+ bool
+ depends on AVAHI_DAEMON
+ prompt "avahi services"
+ help
+ install avahi service descriptions
+endif
+
+config AVAHI_DNSCONFD
+ bool
+ select AVAHI_DAEMON
+ prompt "avahi-dnsconfd"
+ help
+ avahi-dnsconfd connects to a running avahi-daemon and runs the
+ script /etc/avahi/dnsconfd.action for each unicast DNS server
+ that is announced on the local LAN. This is useful for
+ configuring unicast DNS servers in a DHCP-like fashion
+ with mDNS.
+
+config AVAHI_AUTOIP
+ bool
+ prompt "avahi-autoipd"
+ help
+ Install the avahi-autoipd daemon (IPv4 link-local address autoconfiguration)
+ Please check: You need CONFIG_FILE_LOCKING=y in your Kernel Config.
+
+if AVAHI_AUTOIP
+config AVAHI_AUTOIP_USER
+ string
+ prompt "user for running the avahi autoip (IPv4LL) daemon"
+ default "avahi-autoipd"
+ help
+ Enter the user name to run the avahi autoip (IPv4LL) daemon with.
+ The PTXdist standard configuration has only root, so if you want
+ to use the avahi default user "avahi-autoipd" you have to create
+ a related user yourself.
+
+config AVAHI_AUTOIP_GROUP
+ string
+ prompt "group for running the avahi autoip (IPv4LL) daemon"
+ default "avahi-autoipd"
+ help
+ Enter the group name to run the avahi autoip (IPv4LL) daemon with.
+ The PTXdist standard configuration has only root, so if you want
+ to use the avahi default group "avahi-autoipd" you have to create
+ a related group yourself.
+endif
+
+endif
diff --git a/rules/avahi.make b/rules/avahi.make
index 332c56370..b2528baeb 100644
--- a/rules/avahi.make
+++ b/rules/avahi.make
@@ -48,13 +48,13 @@ AVAHI_AUTOCONF := \
--disable-nls \
--disable-dbm \
--disable-gdbm \
- --disable-libdaemon \
+ --enable-libdaemon \
--disable-python \
--disable-pygtk \
--disable-python-dbus \
--disable-mono \
--disable-monodoc \
- --disable-autoipd \
+ --enable-autoipd \
--disable-doxygen-doc \
--disable-doxygen-dot \
--disable-doxygen-man \
@@ -72,33 +72,62 @@ AVAHI_AUTOCONF := \
--disable-compat-libdns_sd \
--disable-compat-howl \
--with-distro=none \
- --with-xml=none \
- --with-avahi-user=avahi \
- --with-avahi-group=avahi \
+ --with-xml=expat \
--with-avahi-priv-access-group=netdev \
- --with-autoipd-user=avahi-autoipd \
- --with-autoipd-group=avahi-autoipd
+ --localstatedir=/var \
+ --disable-stack-protector
+
+ifdef PTXCONF_AVAHI_DAEMON
+AVAHI_AUTOCONF += \
+ --with-avahi-user=$(PTXCONF_AVAHI_USER) \
+ --with-avahi-group=$(PTXCONF_AVAHI_USER)
+endif
+
+ifdef PTXCONF_AVAHI_AUTOIP
+AVAHI_AUTOCONF += \
+ --with-autoipd-user=$(PTXCONF_AVAHI_AUTOIP_USER) \
+ --with-autoipd-group=$(PTXCONF_AVAHI_AUTOIP_GROUP)
+endif
+
+ifdef PTXCONF_AVAHI_GLIB
+AVAHI_AUTOCONF += --enable-glib
+else
+AVAHI_AUTOCONF += --disable-glib
+endif
+
+ifdef PTXCONF_AVAHI_GOBJECT
+AVAHI_AUTOCONF += --enable-gobject
+else
+AVAHI_AUTOCONF += --disable-gobject
+endif
+
+ifdef PTXCONF_AVAHI_QT3
+AVAHI_AUTOCONF += --enable-qt3
+else
+AVAHI_AUTOCONF += --disable-qt3
+endif
+
+ifdef PTXCONF_AVAHI_QT4
+AVAHI_AUTOCONF += --enable-qt4
+else
+AVAHI_AUTOCONF += --disable-qt4
+endif
+
+ifdef PTXCONF_AVAHI_GTK
+AVAHI_AUTOCONF += --enable-gtk
+else
+AVAHI_AUTOCONF += --disable-gtk
+endif
+
+ifdef PTXCONF_AVAHI_DBUS
+AVAHI_AUTOCONF += \
+ --enable-dbus \
+ --with-dbus-sys=$(PTXCONF_AVAHI_DBUS_SYS) \
+ --with-dbus-system-address=$(PTXCONF_AVAHI_DBUS_SOCKET)
+else
+AVAHI_AUTOCONF += --disable-dbus
+endif
-#
-# FIXME: make these configurable
-#
-
-AVAHI_AUTOCONF += \
- --disable-glib \
- --disable-gobject \
- --disable-qt3 \
- --disable-qt4 \
- --disable-gtk \
- --disable-dbus
-
-#
-# FIXME:
-#
-# --with-dbus-sys=<dir> Path to D-Bus system.d directory
-# --with-dbus-system-address=<address>
-# Path to the D-Bus system socket, you probably want
-# to put unix:path= at the start. Only needed for very
-# old D-Bus releases
# ----------------------------------------------------------------------------
# Target-Install
@@ -117,18 +146,51 @@ $(STATEDIR)/avahi.targetinstall:
@$(call install_fixup, avahi,DESCRIPTION,missing)
@$(call install_copy, avahi, 0, 0, 0644, -, /usr/share/avahi/service-types)
+ @$(call install_copy, avahi, 0, 0, 0644, -, /usr/share/avahi/avahi-service.dtd)
+# avahi core libs
@$(call install_copy, avahi, 0, 0, 0644, -, /usr/lib/libavahi-core.so.6.0.1)
@$(call install_link, avahi, libavahi-core.so.6.0.1, /usr/lib/libavahi-core.so.6)
@$(call install_link, avahi, libavahi-core.so.6.0.1, /usr/lib/libavahi-core.so)
@$(call install_copy, avahi, 0, 0, 0644, -, /usr/lib/libavahi-common.so.3.5.1)
- @$(call install_link, avahi, libavahi-common.so.6.0.1, /usr/lib/libavahi-common.so.3)
- @$(call install_link, avahi, libavahi-common.so.6.0.1, /usr/lib/libavahi-common.so)
-
-# # FIXME: looks like wrong prefix? Untested anyway...
-# #/usr/var/run
-# #/usr/lib/avahi
+ @$(call install_link, avahi, libavahi-common.so.3.5.1, /usr/lib/libavahi-common.so.3)
+ @$(call install_link, avahi, libavahi-common.so.3.5.1, /usr/lib/libavahi-common.so)
+
+ifdef PTXCONF_AVAHI_DAEMON
+# avahi daemon (avahi mDNS/DNS-SD Implementation)
+# depends on expat
+ @$(call install_copy, avahi, 0, 0, 0755, -, /usr/sbin/avahi-daemon)
+ @$(call install_copy, avahi, 0, 0, 0644, -, /etc/avahi/avahi-daemon.conf)
+ @$(call install_copy, avahi, 0, 0, 0644, -, /etc/avahi/hosts)
+ @$(call install_alternative, avahi, 0, 0, 0755, /etc/init.d/avahi-daemon)
+ @$(call install_link, avahi, ../init.d/avahi-daemon, /etc/rc.d/S35avahi-daemon)
+endif
+
+ifdef AVAHI_SERVICES
+# avahi service descriptions
+# depends on avahi-daemon
+ @$(call install_copy, avahi, 0, 0, 0644, -, /etc/avahi/services/sftp-ssh.service)
+ @$(call install_copy, avahi, 0, 0, 0644, -, /etc/avahi/services/ssh.service)
+endif
+
+ifdef AVAHI_DNSCONFD
+# avahi dnsconfd (Unicast DNS server from mDNS/DNS-SD configuration daemon)
+# depends on avahi-daemon
+ @$(call install_copy, avahi, 0, 0, 0755, -, /usr/sbin/avahi-dnsconfd)
+ @$(call install_copy, avahi, 0, 0, 0755, -, /etc/avahi/avahi-dnsconfd.action)
+endif
+
+ifdef PTXCONF_AVAHI_AUTOIP
+# avahi autoip daemon (avahi IPv4LL Implementation)
+# this component is needed for rfc3927 style link local adressing
+# depends on libdaemon
+# be shure to set CONFIG_FILE_LOCKING=y in your Kernel Config
+ @$(call install_copy, avahi, 0, 0, 0755, -, /usr/sbin/avahi-autoipd)
+ @$(call install_copy, avahi, 0, 0, 0755, -, /etc/avahi/avahi-autoipd.action)
+ @$(call install_alternative, avahi, 0, 0, 0755, /etc/init.d/zeroconf)
+ @$(call install_link, avahi, ../init.d/zeroconf, /etc/rc.d/S30zeroconf)
+endif
@$(call install_finish, avahi)