summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-core/dbus
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2011-03-17 21:41:22 +0100
committerKoen Kooi <koen@dominion.thruhere.net>2011-03-17 21:41:22 +0100
commitc58cc7d3796dcee6e93885c835ed04cb566abeb2 (patch)
tree3eea4d4ef6a4ef79e0f4e025d7012c1a5cc38835 /meta-oe/recipes-core/dbus
parenteec6ab97f712e06eb52c9f7c99e19ffab3ce9d74 (diff)
downloadmeta-openembedded-c58cc7d3796dcee6e93885c835ed04cb566abeb2.tar.gz
move layer into meta-oe in preparation for future splits
As per TSC decision Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/recipes-core/dbus')
-rw-r--r--meta-oe/recipes-core/dbus/dbus-1.2.24/0001-Make-the-default-DBus-reply-timeout-configurable.patch78
-rw-r--r--meta-oe/recipes-core/dbus/dbus-1.2.24/fix-install-daemon.patch13
-rw-r--r--meta-oe/recipes-core/dbus/dbus-c++-native_git.bb17
-rw-r--r--meta-oe/recipes-core/dbus/dbus-c++/fix-linking.patch13
-rw-r--r--meta-oe/recipes-core/dbus/dbus-c++_git.bb23
-rw-r--r--meta-oe/recipes-core/dbus/dbus-daemon-proxy_git.bb19
-rw-r--r--meta-oe/recipes-core/dbus/dbus.inc104
-rw-r--r--meta-oe/recipes-core/dbus/dbus/add-configurable-reply-timeouts.patch48
-rw-r--r--meta-oe/recipes-core/dbus/dbus/anon.patch13
-rw-r--r--meta-oe/recipes-core/dbus/dbus/dbus-1.init111
-rw-r--r--meta-oe/recipes-core/dbus/dbus/reuseaddr01.patch64
-rw-r--r--meta-oe/recipes-core/dbus/dbus/reuseaddr02.patch38
-rw-r--r--meta-oe/recipes-core/dbus/dbus/tmpdir.patch30
-rw-r--r--meta-oe/recipes-core/dbus/dbus_1.2.24.bb19
-rw-r--r--meta-oe/recipes-core/dbus/dbus_1.4.0.bb18
15 files changed, 608 insertions, 0 deletions
diff --git a/meta-oe/recipes-core/dbus/dbus-1.2.24/0001-Make-the-default-DBus-reply-timeout-configurable.patch b/meta-oe/recipes-core/dbus/dbus-1.2.24/0001-Make-the-default-DBus-reply-timeout-configurable.patch
new file mode 100644
index 000000000..a38e3db0d
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus-1.2.24/0001-Make-the-default-DBus-reply-timeout-configurable.patch
@@ -0,0 +1,78 @@
1From fb546488e93a1638d377b228bbb0d2ab58462168 Mon Sep 17 00:00:00 2001
2From: Daniel Willmann <daniel@totalueberwachung.de>
3Date: Thu, 2 Oct 2008 15:50:17 +0800
4Subject: [PATCH] Make the default DBus reply timeout configurable
5
6This patch adds an option --with-dbus-default-reply-timeout to configure
7that will set the default reply timeout used by libdbus in milliseconds.
8autoconf and autoheader need to be rerun in order to regenerate the
9correct configure and config.h.in files.
10---
11 configure.in | 9 +++++++++
12 dbus/dbus-connection-internal.h | 3 ---
13 dbus/dbus-pending-call.c | 1 +
14 3 files changed, 10 insertions(+), 3 deletions(-)
15
16diff --git a/configure.in b/configure.in
17index 62ac387..5c912d7 100644
18--- a/configure.in
19+++ b/configure.in
20@@ -88,6 +88,7 @@ AC_ARG_WITH(console-auth-dir, AS_HELP_STRING([--with-console-auth-dir=[dirname]]
21 AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filename]],[file whose owner determines current console owner]))
22 AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
23 AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon]))
24+AC_ARG_WITH(dbus_default_reply_timeout, AS_HELP_STRING([--with-dbus-default-reply-timeout=[milliseconds]],[Default reply timeout for DBus method calls]))
25
26 AC_DEFINE(DBUS_UNIX,1,[dbus on unix])
27
28@@ -986,6 +987,13 @@ if test x$have_libaudit = xyes ; then
29 AC_DEFINE(HAVE_LIBAUDIT,1,[audit daemon SELinux support])
30 fi
31
32+if test -z "$with_dbus_default_reply_timeout" ; then
33+ DBUS_DEFAULT_REPLY_TIMEOUT=25000
34+else
35+ DBUS_DEFAULT_REPLY_TIMEOUT=$with_dbus_default_reply_timeout
36+fi
37+AC_DEFINE_UNQUOTED(_DBUS_DEFAULT_TIMEOUT_VALUE,$DBUS_DEFAULT_REPLY_TIMEOUT,[default timeout value for dbus calls])
38+
39 #### Set up final flags
40 DBUS_CLIENT_CFLAGS=
41 DBUS_CLIENT_LIBS="$THREAD_LIBS"
42@@ -1348,6 +1356,7 @@ echo "
43 Gettext libs (empty OK): ${INTLLIBS}
44 Using XML parser: ${with_xml}
45 Init scripts style: ${with_init_scripts}
46+ Default reply timeout: ${DBUS_DEFAULT_REPLY_TIMEOUT}
47 Abstract socket names: ${ac_cv_have_abstract_sockets}
48 System bus socket: ${DBUS_SYSTEM_SOCKET}
49 System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
50diff --git a/dbus/dbus-connection-internal.h b/dbus/dbus-connection-internal.h
51index df54412..5fe536b 100644
52--- a/dbus/dbus-connection-internal.h
53+++ b/dbus/dbus-connection-internal.h
54@@ -41,9 +41,6 @@ typedef enum
55 DBUS_ITERATION_BLOCK = 1 << 2 /**< Block if nothing to do. */
56 } DBusIterationFlags;
57
58-/** default timeout value when waiting for a message reply, 25 seconds */
59-#define _DBUS_DEFAULT_TIMEOUT_VALUE (25 * 1000)
60-
61 void _dbus_connection_lock (DBusConnection *connection);
62 void _dbus_connection_unlock (DBusConnection *connection);
63 DBusConnection * _dbus_connection_ref_unlocked (DBusConnection *connection);
64diff --git a/dbus/dbus-pending-call.c b/dbus/dbus-pending-call.c
65index 51b9378..5a7a5f4 100644
66--- a/dbus/dbus-pending-call.c
67+++ b/dbus/dbus-pending-call.c
68@@ -21,6 +21,7 @@
69 *
70 */
71
72+#include <config.h>
73 #include "dbus-internals.h"
74 #include "dbus-connection-internal.h"
75 #include "dbus-pending-call-internal.h"
76--
771.5.6.4
78
diff --git a/meta-oe/recipes-core/dbus/dbus-1.2.24/fix-install-daemon.patch b/meta-oe/recipes-core/dbus/dbus-1.2.24/fix-install-daemon.patch
new file mode 100644
index 000000000..5e25d1227
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus-1.2.24/fix-install-daemon.patch
@@ -0,0 +1,13 @@
1Index: dbus-0.94/bus/Makefile.am
2===================================================================
3--- dbus-0.94.orig/bus/Makefile.am 2006-10-01 17:36:18.000000000 +0200
4+++ dbus-0.94/bus/Makefile.am 2006-10-14 21:40:05.000000000 +0200
5@@ -110,7 +110,7 @@
6 $(mkinstalldirs) $(DESTDIR)$(DBUS_DAEMONDIR); \
7 chmod 755 $(DESTDIR)$(DBUS_DAEMONDIR); \
8 fi
9- $(INSTALL_PROGRAM) dbus-daemon $(DESTDIR)$(DBUS_DAEMONDIR)
10+ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) dbus-daemon $(DESTDIR)$(DBUS_DAEMONDIR)
11 $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus
12 $(mkinstalldirs) $(DESTDIR)$(configdir)/system.d
13 $(mkinstalldirs) $(DESTDIR)$(datadir)/dbus-1/services
diff --git a/meta-oe/recipes-core/dbus/dbus-c++-native_git.bb b/meta-oe/recipes-core/dbus/dbus-c++-native_git.bb
new file mode 100644
index 000000000..eba80b2e9
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus-c++-native_git.bb
@@ -0,0 +1,17 @@
1require dbus-c++_git.bb
2inherit native
3
4FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/dbus-c++"
5# actually dbus-native and expat-native, but even the bearest build machine should have that nowadays...
6DEPENDS = ""
7
8do_compile() {
9 oe_runmake -C src libdbus-c++-1.la
10 oe_runmake -C tools dbusxx-xml2cpp
11 install -m 0755 tools/dbusxx-xml2cpp ${STAGING_BINDIR_NATIVE}
12}
13
14do_install() {
15 :
16}
17
diff --git a/meta-oe/recipes-core/dbus/dbus-c++/fix-linking.patch b/meta-oe/recipes-core/dbus/dbus-c++/fix-linking.patch
new file mode 100644
index 000000000..822216916
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus-c++/fix-linking.patch
@@ -0,0 +1,13 @@
1Index: dbus/tools/Makefile.am
2===================================================================
3--- dbus.orig/tools/Makefile.am
4+++ dbus/tools/Makefile.am
5@@ -16,7 +16,7 @@ endif
6 bin_PROGRAMS = dbusxx-xml2cpp dbusxx-introspect
7
8 dbusxx_xml2cpp_SOURCES = xml.h xml.cpp xml2cpp.h xml2cpp.cpp
9-dbusxx_xml2cpp_LDADD = $(libdbus_cxx_la)
10+dbusxx_xml2cpp_LDADD = $(libdbus_cxx_la) -lexpat
11
12 dbusxx_introspect_SOURCES = introspect.h introspect.cpp
13 dbusxx_introspect_LDADD = $(libdbus_cxx_la)
diff --git a/meta-oe/recipes-core/dbus/dbus-c++_git.bb b/meta-oe/recipes-core/dbus/dbus-c++_git.bb
new file mode 100644
index 000000000..64598238d
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus-c++_git.bb
@@ -0,0 +1,23 @@
1DESCRIPTION = "C++ bindings for dbus"
2LICENSE = "LGPLv2.1+"
3SECTION = "libs"
4DEPENDS = "dbus dbus-c++-native expat"
5SRCREV = "530a887913d3b0dd7091eabb8eef8e3c279e3bb8"
6
7PE = "1"
8PV = "0.5.0+gitr${SRCPV}"
9
10SRC_URI = "git://gitorious.org/dbus-cplusplus/mainline.git;protocol=git"
11# file://fix-linking.patch"
12S = "${WORKDIR}/git"
13
14inherit autotools pkgconfig
15
16do_compile_prepend() {
17 find . -name "Makefile.am" |xargs sed -i -e 's,$(top_builddir)/tools/dbusxx-xml2cpp,dbusxx-xml2cpp,'
18}
19
20FILES_${PN}-dbg += "${bindir}/dbusxx-xml2cpp ${bindir}/dbusxx-introspect"
21FILES_${PN}-dev += "${bindir}/.dev"
22FILES_${PN} = "${libdir}/*.so.*"
23
diff --git a/meta-oe/recipes-core/dbus/dbus-daemon-proxy_git.bb b/meta-oe/recipes-core/dbus/dbus-daemon-proxy_git.bb
new file mode 100644
index 000000000..32ed7dbfd
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus-daemon-proxy_git.bb
@@ -0,0 +1,19 @@
1DESCRIPTION = "dbus forwarding daemon"
2LICENSE = "LGPLv2.1+"
3DEPENDS = "dbus dbus-glib"
4SRCREV = "1226a0a1374628ff191f6d8a56000be5e53e7608"
5PV = "0.0.0+gitr${SRCPV}"
6PR = "r1"
7
8SRC_URI = "git://git.collabora.co.uk/git/user/alban/dbus-daemon-proxy;protocol=git"
9S = "${WORKDIR}/git"
10
11do_compile() {
12 ${CC} ${LDFLAGS} `pkg-config --cflags --libs dbus-glib-1` -o dbus-daemon-proxy dbus-daemon-proxy.c
13}
14
15do_install() {
16 install -d ${D}${bindir}
17 install -m 0755 dbus-daemon-proxy ${D}${bindir}
18}
19
diff --git a/meta-oe/recipes-core/dbus/dbus.inc b/meta-oe/recipes-core/dbus/dbus.inc
new file mode 100644
index 000000000..40a670aac
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus.inc
@@ -0,0 +1,104 @@
1DESCRIPTION = "A message bus system for inter-process communication"
2HOMEPAGE = "http://dbus.freedesktop.org"
3SECTION = "base"
4LICENSE = "AFL2.1 | GPLv2+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
6 file://dbus/dbus.h;firstline=6;endline=20;md5=6eea2e0c7750dd8e620dcb1437312fa5"
7DEPENDS = "expat virtual/libintl libsm libice virtual/libx11"
8
9INC_PR = "r20"
10
11SRC_URI = "\
12 http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz;name=dbus \
13 file://cross.patch \
14 file://tmpdir.patch \
15 file://fix-install-daemon.patch \
16 file://0001-Make-the-default-DBus-reply-timeout-configurable.patch \
17 file://dbus-1.init \
18"
19
20S = "${WORKDIR}/dbus-${PV}"
21
22inherit autotools pkgconfig update-rc.d gettext
23
24EXTRA_OECONF_X = "--with-x"
25
26EXTRA_OECONF = "\
27 --disable-qt \
28 --disable-qt3 \
29 --disable-gtk \
30 --disable-tests \
31 --disable-checks \
32 --disable-xml-docs \
33 --disable-doxygen-docs \
34 --disable-libaudit \
35 --with-xml=expat \
36 --with-dbus-default-reply-timeout=200000 \
37 ${EXTRA_OECONF_X} \
38"
39
40# On mipsel, D-Bus fails to link with --gc-sections and segfaults before main()
41# when built with -fPIE/-pie.
42do_configure_prepend_mipsel() {
43 sed -i -e 's/\-fPIE//' \
44 -e 's/\-pie\ \-Wl\,\-z\,relro//' \
45 -e 's/-Wl,--gc-sections//' \
46 ${S}/configure.in
47}
48
49do_install_append() {
50 install -d ${D}${sysconfdir}/init.d
51 install -m 0755 ${WORKDIR}/dbus-1.init ${D}${sysconfdir}/init.d/dbus-1
52 # the stock install seems to install the libtool wrapper script, so we have to copy this manually :M:
53 if [ -e bus/.libs/dbus-daemon-launch-helper ]; then
54 install -d ${D}${libexecdir}/
55 install -m 0755 bus/.libs/dbus-daemon-launch-helper ${D}${libexecdir}/
56 fi
57}
58
59RDEPENDS_${PN}-x11 = "${PN}"
60RRECOMMENDS_${PN}-lib = "${PN}"
61RCONFLICTS_${PN} = "dbus-1"
62RREPLACES_${PN} = "dbus-1"
63RPROVIDES_${PN} = "dbus-1"
64
65PACKAGES =+ "${PN}-lib ${PN}-x11"
66
67FILES_${PN} = "\
68${bindir}/dbus-daemon* \
69${bindir}/dbus-uuidgen \
70${bindir}/dbus-cleanup-sockets \
71${bindir}/dbus-send \
72${bindir}/dbus-monitor \
73${libexecdir}/dbus* \
74${sysconfdir} \
75${datadir}/dbus-1/services \
76${datadir}/dbus-1/system-services \
77"
78FILES_${PN}-lib = "${libdir}/lib*.so.*"
79FILES_${PN}-x11 = "\
80${bindir}/dbus-launch \
81"
82FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool ${libdir}/"
83
84pkg_postinst_${PN}() {
85#!/bin/sh
86# can't do adduser stuff offline
87if [ "x$D" != "x" ]; then
88 exit 1
89fi
90MESSAGEUSER=messagebus
91MESSAGEHOME=/var/run/dbus
92mkdir -p $MESSAGEHOME || true
93grep -q ^$MESSAGEUSER: /etc/group || addgroup "$MESSAGEUSER"
94chgrp "$MESSAGEUSER" "$MESSAGEHOME"
95grep -q ^$MESSAGEUSER: /etc/passwd || adduser --system --home "$MESSAGEHOME" --no-create-home --disabled-password --ingroup "$MESSAGEUSER" "$MESSAGEUSER"
96chown "$MESSAGEUSER"."$MESSAGEUSER" "$MESSAGEHOME"
97grep -q netdev: /etc/group || addgroup netdev
98chmod u+s /usr/libexec/dbus-daemon-launch-helper
99}
100
101CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
102
103INITSCRIPT_NAME = "dbus-1"
104INITSCRIPT_PARAMS = "start 02 5 2 . stop 20 0 1 6 ."
diff --git a/meta-oe/recipes-core/dbus/dbus/add-configurable-reply-timeouts.patch b/meta-oe/recipes-core/dbus/dbus/add-configurable-reply-timeouts.patch
new file mode 100644
index 000000000..9cca38ddc
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus/add-configurable-reply-timeouts.patch
@@ -0,0 +1,48 @@
1Index: dbus-1.3.1/configure.in
2===================================================================
3--- dbus-1.3.1.orig/configure.in
4+++ dbus-1.3.1/configure.in
5@@ -137,6 +137,7 @@
6 AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filename]],[file whose owner determines current console owner]))
7 AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
8 AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon]))
9+AC_ARG_WITH(dbus_default_reply_timeout, AS_HELP_STRING([--with-dbus-default-reply-timeout=[milliseconds]],[Default reply timeout for DBus method calls]))
10
11 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
12 dnl and also some stuff in the test/ subdir
13@@ -984,6 +985,13 @@
14 fi
15 fi
16
17+if test -z "$with_dbus_default_reply_timeout" ; then
18+ DBUS_DEFAULT_REPLY_TIMEOUT=25000
19+else
20+ DBUS_DEFAULT_REPLY_TIMEOUT=$with_dbus_default_reply_timeout
21+fi
22+AC_DEFINE_UNQUOTED(_DBUS_DEFAULT_TIMEOUT_VALUE,$DBUS_DEFAULT_REPLY_TIMEOUT,[default timeout value for dbus calls])
23+
24 #### Set up final flags
25 DBUS_CLIENT_CFLAGS=
26 DBUS_CLIENT_LIBS="$THREAD_LIBS $NETWORK_libs"
27@@ -1625,6 +1633,7 @@
28 Gettext libs (empty OK): ${INTLLIBS}
29 Using XML parser: ${with_xml}
30 Init scripts style: ${with_init_scripts}
31+ Default reply timeout: ${DBUS_DEFAULT_REPLY_TIMEOUT}
32 Abstract socket names: ${ac_cv_have_abstract_sockets}
33 System bus socket: ${DBUS_SYSTEM_SOCKET}
34 System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
35Index: dbus-1.3.1/dbus/dbus-connection-internal.h
36===================================================================
37--- dbus-1.3.1.orig/dbus/dbus-connection-internal.h
38+++ dbus-1.3.1/dbus/dbus-connection-internal.h
39@@ -41,9 +41,6 @@
40 DBUS_ITERATION_BLOCK = 1 << 2 /**< Block if nothing to do. */
41 } DBusIterationFlags;
42
43-/** default timeout value when waiting for a message reply, 25 seconds */
44-#define _DBUS_DEFAULT_TIMEOUT_VALUE (25 * 1000)
45-
46 void _dbus_connection_lock (DBusConnection *connection);
47 void _dbus_connection_unlock (DBusConnection *connection);
48 DBusConnection * _dbus_connection_ref_unlocked (DBusConnection *connection);
diff --git a/meta-oe/recipes-core/dbus/dbus/anon.patch b/meta-oe/recipes-core/dbus/dbus/anon.patch
new file mode 100644
index 000000000..c9bf7bfa6
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus/anon.patch
@@ -0,0 +1,13 @@
1diff -Naur dbus-1.2.1.orig/dbus/dbus-transport.c dbus-1.2.1/dbus/dbus-transport.c
2--- dbus-1.2.1.orig/dbus/dbus-transport.c 2008-09-16 15:10:02.000000000 +0000
3+++ dbus-1.2.1/dbus/dbus-transport.c 2008-09-16 15:10:10.000000000 +0000
4@@ -747,6 +747,9 @@
5 dbus_bool_t allow;
6 DBusCredentials *auth_identity;
7
8+ // allow anonymous connections
9+ _dbus_transport_set_allow_anonymous(transport, TRUE);
10+
11 auth_identity = _dbus_auth_get_identity (transport->auth);
12 _dbus_assert (auth_identity != NULL);
13
diff --git a/meta-oe/recipes-core/dbus/dbus/dbus-1.init b/meta-oe/recipes-core/dbus/dbus/dbus-1.init
new file mode 100644
index 000000000..a70e7a237
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus/dbus-1.init
@@ -0,0 +1,111 @@
1#! /bin/sh
2# -*- coding: utf-8 -*-
3# Debian init.d script for D-BUS
4# Copyright © 2003 Colin Walters <walters@debian.org>
5# Copyright 2008 OE Team
6
7set -e
8
9DAEMON=/usr/bin/dbus-daemon
10NAME=dbus
11DAEMONUSER=messagebus
12RUNDIR=/var/run/dbus
13PIDFILE=/var/run/dbus/pid
14UUIDDIR=/var/lib/dbus
15DESC="system message bus"
16EVENTDIR=/etc/dbus-1/event.d
17
18test -x $DAEMON || exit 0
19
20# Source defaults file; edit that file to configure this script.
21ENABLED=1
22PARAMS=""
23if [ -e /etc/default/dbus ]; then
24 . /etc/default/dbus
25fi
26
27test "$ENABLED" != "0" || exit 0
28
29start_it_up()
30{
31 if [ ! -d $RUNDIR ]; then
32 mkdir -p $RUNDIR
33 chown $DAEMONUSER $RUNDIR
34 chgrp $DAEMONUSER $RUNDIR
35 fi
36 if [ -e $PIDFILE ]; then
37 PIDDIR=/proc/$(cat $PIDFILE)
38 if [ -d ${PIDDIR} -a "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then
39 echo "$DESC already started; not starting."
40 else
41 echo "Removing stale PID file $PIDFILE."
42 rm -f $PIDFILE
43 fi
44 fi
45
46 if [ ! -d $UUIDDIR ]; then
47 mkdir -p $UUIDDIR
48 chown $DAEMONUSER $UUIDDIR
49 chgrp $DAEMONUSER $UUIDDIR
50 fi
51
52 dbus-uuidgen --ensure
53
54 echo -n "Starting $DESC: "
55 start-stop-daemon --start --pidfile $PIDFILE \
56 --user $DAEMONUSER --exec $DAEMON -- --system $PARAMS
57 echo "$NAME."
58 if [ -d $EVENTDIR ]; then
59 run-parts --arg=start $EVENTDIR
60 fi
61}
62
63shut_it_down()
64{
65 if [ -d $EVENTDIR ]; then
66 # TODO: --reverse when busybox supports it
67 run-parts --arg=stop $EVENTDIR
68 fi
69 echo -n "Stopping $DESC: "
70 start-stop-daemon --stop --oknodo --pidfile $PIDFILE \
71 --user $DAEMONUSER
72 # We no longer include these arguments so that start-stop-daemon
73 # can do its job even given that we may have been upgraded.
74 # We rely on the pidfile being sanely managed
75 # --exec $DAEMON -- --system $PARAMS
76 echo "$NAME."
77 rm -f $PIDFILE
78}
79
80reload_it()
81{
82 echo -n "Reloading $DESC config: "
83 dbus-send --print-reply --system --type=method_call \
84 --dest=org.freedesktop.DBus \
85 / org.freedesktop.DBus.ReloadConfig > /dev/null
86 # hopefully this is enough time for dbus to reload it's config file.
87 echo "done."
88}
89
90case "$1" in
91 start)
92 start_it_up
93 ;;
94 stop)
95 shut_it_down
96 ;;
97 reload|force-reload)
98 reload_it
99 ;;
100 restart)
101 shut_it_down
102 sleep 1
103 start_it_up
104 ;;
105 *)
106 echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}" >&2
107 exit 1
108 ;;
109esac
110
111exit 0
diff --git a/meta-oe/recipes-core/dbus/dbus/reuseaddr01.patch b/meta-oe/recipes-core/dbus/dbus/reuseaddr01.patch
new file mode 100644
index 000000000..e291bb894
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus/reuseaddr01.patch
@@ -0,0 +1,64 @@
1From 8f5f340b77b51fed1f036a9ee9f70a31b201f2c9 Mon Sep 17 00:00:00 2001
2From: Sledz <sledz@MOBIL-400-586.intern.dresearch.de>
3Date: Tue, 29 Jun 2010 21:04:15 +0000
4Subject: sysdeps-unix: enable address reuse on TCP sockets
5
6This helps to avoid 'Address already in use' problems if server has been shut
7down, and then restarted while sockets are still active on its port.
8
9Signed-off-by: Steffen Sledz <sledz@dresearch.de>
10---
11diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
12index ce3475a..b58d09a 100644
13--- a/dbus/dbus-sysdeps-unix.c
14+++ b/dbus/dbus-sysdeps-unix.c
15@@ -623,6 +623,7 @@ _dbus_listen_unix_socket (const char *path,
16 int listen_fd;
17 struct sockaddr_un addr;
18 size_t path_len;
19+ unsigned int reuseaddr;
20
21 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
22
23@@ -696,7 +697,15 @@ _dbus_listen_unix_socket (const char *path,
24
25 strncpy (addr.sun_path, path, path_len);
26 }
27-
28+
29+ reuseaddr = 1;
30+ if (setsockopt (listen_fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr))==-1)
31+ {
32+ dbus_set_error (error, _dbus_error_from_errno (errno),
33+ "Failed to set socket option\"%s\": %s",
34+ path, _dbus_strerror (errno));
35+ }
36+
37 if (bind (listen_fd, (struct sockaddr*) &addr, _DBUS_STRUCT_OFFSET (struct sockaddr_un, sun_path) + path_len) < 0)
38 {
39 dbus_set_error (error, _dbus_error_from_errno (errno),
40@@ -870,6 +879,7 @@ _dbus_listen_tcp_socket (const char *host,
41 int nlisten_fd = 0, *listen_fd = NULL, res, i;
42 struct addrinfo hints;
43 struct addrinfo *ai, *tmp;
44+ unsigned int reuseaddr;
45
46 *fds_p = NULL;
47 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
48@@ -915,6 +925,14 @@ _dbus_listen_tcp_socket (const char *host,
49 }
50 _DBUS_ASSERT_ERROR_IS_CLEAR(error);
51
52+ reuseaddr = 1;
53+ if (setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr))==-1)
54+ {
55+ dbus_set_error (error, _dbus_error_from_errno (errno),
56+ "Failed to set socket option \"%s:%s\": %s",
57+ host ? host : "*", port, _dbus_strerror (errno));
58+ }
59+
60 if (bind (fd, (struct sockaddr*) tmp->ai_addr, tmp->ai_addrlen) < 0)
61 {
62 _dbus_close(fd, NULL);
63--
64cgit v0.8.3-6-g21f6
diff --git a/meta-oe/recipes-core/dbus/dbus/reuseaddr02.patch b/meta-oe/recipes-core/dbus/dbus/reuseaddr02.patch
new file mode 100644
index 000000000..10bc7edfd
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus/reuseaddr02.patch
@@ -0,0 +1,38 @@
1From d365dd8141e709222f3a619d7b04ec4ded6429fd Mon Sep 17 00:00:00 2001
2From: Havoc Pennington <hp@pobox.com>
3Date: Tue, 31 Aug 2010 15:59:09 +0000
4Subject: Change failure of setsockopt SO_REUSEADDR to be a warning, not set an error
5
6It was previously setting an error but then continuing, which is
7not allowed since errors can't be "piled up"
8---
9diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
10index e4ff6ee..3205bed 100644
11--- a/dbus/dbus-sysdeps-unix.c
12+++ b/dbus/dbus-sysdeps-unix.c
13@@ -980,9 +980,8 @@ _dbus_listen_unix_socket (const char *path,
14 reuseaddr = 1;
15 if (setsockopt (listen_fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr))==-1)
16 {
17- dbus_set_error (error, _dbus_error_from_errno (errno),
18- "Failed to set socket option\"%s\": %s",
19- path, _dbus_strerror (errno));
20+ _dbus_warn ("Failed to set socket option\"%s\": %s",
21+ path, _dbus_strerror (errno));
22 }
23
24 if (bind (listen_fd, (struct sockaddr*) &addr, _DBUS_STRUCT_OFFSET (struct sockaddr_un, sun_path) + path_len) < 0)
25@@ -1335,9 +1334,8 @@ _dbus_listen_tcp_socket (const char *host,
26 reuseaddr = 1;
27 if (setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(reuseaddr))==-1)
28 {
29- dbus_set_error (error, _dbus_error_from_errno (errno),
30- "Failed to set socket option \"%s:%s\": %s",
31- host ? host : "*", port, _dbus_strerror (errno));
32+ _dbus_warn ("Failed to set socket option \"%s:%s\": %s",
33+ host ? host : "*", port, _dbus_strerror (errno));
34 }
35
36 if (bind (fd, (struct sockaddr*) tmp->ai_addr, tmp->ai_addrlen) < 0)
37--
38cgit v0.8.3-6-g21f6
diff --git a/meta-oe/recipes-core/dbus/dbus/tmpdir.patch b/meta-oe/recipes-core/dbus/dbus/tmpdir.patch
new file mode 100644
index 000000000..838b903f0
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus/tmpdir.patch
@@ -0,0 +1,30 @@
1--- dbus-0.22/configure.in.orig 2004-08-13 00:57:16.000000000 +0200
2+++ dbus-0.22/configure.in 2004-12-30 21:15:57.000000000 +0100
3@@ -1047,15 +1048,18 @@
4 AC_SUBST(ABSOLUTE_TOP_BUILDDIR)
5
6 #### Find socket directories
7-if ! test -z "$TMPDIR" ; then
8- DEFAULT_SOCKET_DIR=$TMPDIR
9-elif ! test -z "$TEMP" ; then
10- DEFAULT_SOCKET_DIR=$TEMP
11-elif ! test -z "$TMP" ; then
12- DEFAULT_SOCKET_DIR=$TMP
13-else
14- DEFAULT_SOCKET_DIR=/tmp
15-fi
16+#if ! test -z "$TMPDIR" ; then
17+# DEFAULT_SOCKET_DIR=$TMPDIR
18+#elif ! test -z "$TEMP" ; then
19+# DEFAULT_SOCKET_DIR=$TEMP
20+#elif ! test -z "$TMP" ; then
21+# DEFAULT_SOCKET_DIR=$TMP
22+#else
23+# DEFAULT_SOCKET_DIR=/tmp
24+#fi
25+
26+# checks disabled to avoid expanding this at build time
27+DEFAULT_SOCKET_DIR=/tmp
28
29 if ! test -z "$with_test_socket_dir" ; then
30 TEST_SOCKET_DIR="$with_test_socket_dir"
diff --git a/meta-oe/recipes-core/dbus/dbus_1.2.24.bb b/meta-oe/recipes-core/dbus/dbus_1.2.24.bb
new file mode 100644
index 000000000..75825514b
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus_1.2.24.bb
@@ -0,0 +1,19 @@
1include dbus.inc
2
3PR = "${INC_PR}.1"
4
5SRC_URI = "\
6 http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz;name=dbus \
7 file://tmpdir.patch \
8 file://fix-install-daemon.patch \
9 file://0001-Make-the-default-DBus-reply-timeout-configurable.patch \
10 file://dbus-1.init \
11 file://reuseaddr01.patch \
12 file://reuseaddr02.patch \
13"
14
15SRC_URI_append_hipox = "file://anon.patch"
16
17SRC_URI[dbus.md5sum] = "565346cecd9cfecf1463540c6086cc2c"
18SRC_URI[dbus.sha256sum] = "f12c748f4a703655e3d4c3db94cdf5a752a0cd0b36958c715804373bd3595c48"
19
diff --git a/meta-oe/recipes-core/dbus/dbus_1.4.0.bb b/meta-oe/recipes-core/dbus/dbus_1.4.0.bb
new file mode 100644
index 000000000..2c4943b4f
--- /dev/null
+++ b/meta-oe/recipes-core/dbus/dbus_1.4.0.bb
@@ -0,0 +1,18 @@
1include dbus.inc
2PR = "${INC_PR}.0"
3
4BBCLASSEXTEND = "native"
5
6SRC_URI = "\
7 http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
8 \
9 file://tmpdir.patch \
10 file://add-configurable-reply-timeouts.patch \
11 file://dbus-1.init \
12"
13
14# This needs more testing before pushing as default dbus
15DEFAULT_PREFERENCE = "-1"
16
17SRC_URI[md5sum] = "f59618b18d2fb2bd1fce9e1c5a2a3282"
18SRC_URI[sha256sum] = "c96d2f86d40e158e2bf405925a0a42cce0533a8466098e2f2238aa1614926652"