summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <hrw@openedhand.com>2008-10-13 13:02:35 +0000
committerMarcin Juszkiewicz <hrw@openedhand.com>2008-10-13 13:02:35 +0000
commit4c7fc919401ac29174e40d794e85d4d6c20de270 (patch)
tree44cad42c90119101d1d4086ecbc1c289fadb1d8e /meta
parent5c7adfa4aad0755582561c3469d6848f115d8168 (diff)
downloadopenembedded-core-4c7fc919401ac29174e40d794e85d4d6c20de270.tar.gz
openembedded-core-4c7fc919401ac29174e40d794e85d4d6c20de270.tar.bz2
openembedded-core-4c7fc919401ac29174e40d794e85d4d6c20de270.zip
avahi: create/remove 'avahi-autoipd' user (from OE)
Patch from Cyril Humbert <cyril.humbert@martec.fr> git-svn-id: https://svn.o-hand.com/repos/poky/trunk@5483 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta')
-rw-r--r--meta/packages/avahi/avahi.inc27
-rw-r--r--meta/packages/avahi/avahi_0.6.23.bb2
-rw-r--r--meta/packages/avahi/files/00avahi-autoipd10
-rw-r--r--meta/packages/avahi/files/99avahi-autoipd10
4 files changed, 46 insertions, 3 deletions
diff --git a/meta/packages/avahi/avahi.inc b/meta/packages/avahi/avahi.inc
index 67029b30b0..419b787b5f 100644
--- a/meta/packages/avahi/avahi.inc
+++ b/meta/packages/avahi/avahi.inc
@@ -9,6 +9,8 @@ RRECOMMENDS = "libnss-mdns"
RRECOMMENDS_avahi-daemon = "libnss-mdns"
SRC_URI = "http://avahi.org/download/avahi-${PV}.tar.gz \
+ file://00avahi-autoipd \
+ file://99avahi-autoipd \
file://initscript.patch;patch=1"
inherit autotools pkgconfig update-rc.d
@@ -64,8 +66,8 @@ pkg_postinst_avahi-daemon () {
if [ "x$D" != "x" ]; then
exit 1
fi
- grep avahi /etc/group || addgroup avahi
- grep avahi /etc/passwd || adduser --disabled-password --system --home /var/run/avahi-daemon --no-create-home avahi --ingroup avahi -g Avahi
+ grep "^avahi:" /etc/group > /dev/null || addgroup avahi
+ grep "^avahi:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/run/avahi-daemon --no-create-home avahi --ingroup avahi -g Avahi
DBUSPID=`pidof dbus-daemon`
@@ -74,7 +76,28 @@ pkg_postinst_avahi-daemon () {
fi
}
+pkg_postinst_avahi-autoipd () {
+ # can't do this offline
+ if [ "x$D" != "x" ]; then
+ exit 1
+ fi
+ grep "^avahi-autoipd:" /etc/group > /dev/null || addgroup avahi-autoipd
+ grep "^avahi-autoipd:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/lib/avahi-autoipd --no-create-home avahi-autoipd --ingroup avahi-autoipd -g "Avahi autoip daemon"
+}
+
pkg_postrm_avahi-daemon () {
deluser avahi || true
delgroup avahi || true
}
+
+pkg_postrm_avahi-autoipd () {
+ deluser avahi-autoipd || true
+ delgroup avahi-autoipd || true
+}
+
+do_install_avahi-autoipd() {
+ autotools_do_install
+ install -d ${D}${sysconfdir}/udhcpc.d
+ install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d
+ install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d
+}
diff --git a/meta/packages/avahi/avahi_0.6.23.bb b/meta/packages/avahi/avahi_0.6.23.bb
index febd7f0760..642b6b916c 100644
--- a/meta/packages/avahi/avahi_0.6.23.bb
+++ b/meta/packages/avahi/avahi_0.6.23.bb
@@ -1,7 +1,7 @@
require avahi.inc
RDEPENDS_avahi-daemon = "sysvinit-pidof"
-PR = "r7"
+PR = "r8"
FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \
${sysconfdir}/avahi/avahi-autoipd.action \
diff --git a/meta/packages/avahi/files/00avahi-autoipd b/meta/packages/avahi/files/00avahi-autoipd
new file mode 100644
index 0000000000..a0ab814603
--- /dev/null
+++ b/meta/packages/avahi/files/00avahi-autoipd
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
+
+case "$1" in
+
+ deconfig|renew|bound)
+ /usr/sbin/avahi-autoipd -k $interface 2> /dev/null
+ ;;
+esac
diff --git a/meta/packages/avahi/files/99avahi-autoipd b/meta/packages/avahi/files/99avahi-autoipd
new file mode 100644
index 0000000000..234cdaa3eb
--- /dev/null
+++ b/meta/packages/avahi/files/99avahi-autoipd
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
+
+case "$1" in
+
+ leasefail)
+ /usr/sbin/avahi-autoipd -wD $interface 2> /dev/null
+ ;;
+esac