diff options
author | Marcin Juszkiewicz <hrw@openedhand.com> | 2008-10-13 13:02:35 +0000 |
---|---|---|
committer | Marcin Juszkiewicz <hrw@openedhand.com> | 2008-10-13 13:02:35 +0000 |
commit | 4c7fc919401ac29174e40d794e85d4d6c20de270 (patch) | |
tree | 44cad42c90119101d1d4086ecbc1c289fadb1d8e | |
parent | 5c7adfa4aad0755582561c3469d6848f115d8168 (diff) | |
download | poky-4c7fc919401ac29174e40d794e85d4d6c20de270.tar.gz |
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
-rw-r--r-- | meta/packages/avahi/avahi.inc | 27 | ||||
-rw-r--r-- | meta/packages/avahi/avahi_0.6.23.bb | 2 | ||||
-rw-r--r-- | meta/packages/avahi/files/00avahi-autoipd | 10 | ||||
-rw-r--r-- | meta/packages/avahi/files/99avahi-autoipd | 10 |
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" | |||
9 | RRECOMMENDS_avahi-daemon = "libnss-mdns" | 9 | RRECOMMENDS_avahi-daemon = "libnss-mdns" |
10 | 10 | ||
11 | SRC_URI = "http://avahi.org/download/avahi-${PV}.tar.gz \ | 11 | SRC_URI = "http://avahi.org/download/avahi-${PV}.tar.gz \ |
12 | file://00avahi-autoipd \ | ||
13 | file://99avahi-autoipd \ | ||
12 | file://initscript.patch;patch=1" | 14 | file://initscript.patch;patch=1" |
13 | 15 | ||
14 | inherit autotools pkgconfig update-rc.d | 16 | inherit autotools pkgconfig update-rc.d |
@@ -64,8 +66,8 @@ pkg_postinst_avahi-daemon () { | |||
64 | if [ "x$D" != "x" ]; then | 66 | if [ "x$D" != "x" ]; then |
65 | exit 1 | 67 | exit 1 |
66 | fi | 68 | fi |
67 | grep avahi /etc/group || addgroup avahi | 69 | grep "^avahi:" /etc/group > /dev/null || addgroup avahi |
68 | grep avahi /etc/passwd || adduser --disabled-password --system --home /var/run/avahi-daemon --no-create-home avahi --ingroup avahi -g Avahi | 70 | grep "^avahi:" /etc/passwd > /dev/null || adduser --disabled-password --system --home /var/run/avahi-daemon --no-create-home avahi --ingroup avahi -g Avahi |
69 | 71 | ||
70 | DBUSPID=`pidof dbus-daemon` | 72 | DBUSPID=`pidof dbus-daemon` |
71 | 73 | ||
@@ -74,7 +76,28 @@ pkg_postinst_avahi-daemon () { | |||
74 | fi | 76 | fi |
75 | } | 77 | } |
76 | 78 | ||
79 | pkg_postinst_avahi-autoipd () { | ||
80 | # can't do this offline | ||
81 | if [ "x$D" != "x" ]; then | ||
82 | exit 1 | ||
83 | fi | ||
84 | grep "^avahi-autoipd:" /etc/group > /dev/null || addgroup avahi-autoipd | ||
85 | 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" | ||
86 | } | ||
87 | |||
77 | pkg_postrm_avahi-daemon () { | 88 | pkg_postrm_avahi-daemon () { |
78 | deluser avahi || true | 89 | deluser avahi || true |
79 | delgroup avahi || true | 90 | delgroup avahi || true |
80 | } | 91 | } |
92 | |||
93 | pkg_postrm_avahi-autoipd () { | ||
94 | deluser avahi-autoipd || true | ||
95 | delgroup avahi-autoipd || true | ||
96 | } | ||
97 | |||
98 | do_install_avahi-autoipd() { | ||
99 | autotools_do_install | ||
100 | install -d ${D}${sysconfdir}/udhcpc.d | ||
101 | install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d | ||
102 | install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d | ||
103 | } | ||
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 @@ | |||
1 | require avahi.inc | 1 | require avahi.inc |
2 | 2 | ||
3 | RDEPENDS_avahi-daemon = "sysvinit-pidof" | 3 | RDEPENDS_avahi-daemon = "sysvinit-pidof" |
4 | PR = "r7" | 4 | PR = "r8" |
5 | 5 | ||
6 | FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \ | 6 | FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \ |
7 | ${sysconfdir}/avahi/avahi-autoipd.action \ | 7 | ${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 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | [ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1 | ||
4 | |||
5 | case "$1" in | ||
6 | |||
7 | deconfig|renew|bound) | ||
8 | /usr/sbin/avahi-autoipd -k $interface 2> /dev/null | ||
9 | ;; | ||
10 | 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 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | [ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1 | ||
4 | |||
5 | case "$1" in | ||
6 | |||
7 | leasefail) | ||
8 | /usr/sbin/avahi-autoipd -wD $interface 2> /dev/null | ||
9 | ;; | ||
10 | esac | ||