summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2011-10-21 02:49:51 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-30 16:38:04 +0000
commit9d086cd1519b95bff27ca1cda4555ffae92c5ce3 (patch)
tree08b1d55e7bdbddab173c709b212fc094f8e4caae
parent2edde1021fd06ea693b395074e358a16be41b244 (diff)
downloadpoky-9d086cd1519b95bff27ca1cda4555ffae92c5ce3.tar.gz
dbus: use useradd class to allow use in read-only filesystems
Move creation of required user/groups to useradd class thus allowing use with read-only filesystems and booting the initial boot. (From OE-Core rev: 46e6c3fa8034b12d178d605f3f5d7efe69671a13) (From OE-Core rev: a115b657ed3df1c9b26b016151881a6c9c26ac2b) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/dbus/dbus.inc48
1 files changed, 21 insertions, 27 deletions
diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
index a8ecda8d4f..2a97c028e6 100644
--- a/meta/recipes-core/dbus/dbus.inc
+++ b/meta/recipes-core/dbus/dbus.inc
@@ -10,15 +10,22 @@ DEPENDS = "expat virtual/libintl ${@base_contains('DISTRO_FEATURES', 'x11', '${X
10DEPENDS_virtclass-native = "expat-native virtual/libintl-native" 10DEPENDS_virtclass-native = "expat-native virtual/libintl-native"
11DEPENDS_virtclass-nativesdk = "expat-nativesdk virtual/libintl-nativesdk virtual/libx11" 11DEPENDS_virtclass-nativesdk = "expat-nativesdk virtual/libintl-nativesdk virtual/libx11"
12 12
13PR = "r1"
14
13SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \ 15SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
14 file://tmpdir.patch; \ 16 file://tmpdir.patch; \
15 file://dbus-1.init" 17 file://dbus-1.init"
16 18
17inherit autotools pkgconfig gettext update-rc.d 19inherit useradd autotools pkgconfig gettext update-rc.d
18 20
19INITSCRIPT_NAME = "dbus-1" 21INITSCRIPT_NAME = "dbus-1"
20INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ." 22INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
21 23
24USERADD_PACKAGES = "${PN}"
25GROUPADD_PARAM_${PN} = "-r netdev"
26USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \
27 --no-create-home --user-group messagebus"
28
22CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf" 29CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
23 30
24DEBIANNAME_${PN} = "dbus-1" 31DEBIANNAME_${PN} = "dbus-1"
@@ -44,32 +51,7 @@ RRECOMMENDS_${PN}-lib = "${PN}"
44FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool" 51FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool"
45 52
46pkg_postinst_dbus() { 53pkg_postinst_dbus() {
47 # can't do adduser stuff offline 54 if [ -z "${D}" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
48 if [ "x$D" != "x" ]; then
49 exit 1
50 fi
51
52 MESSAGEUSER=messagebus
53 MESSAGEHOME=/var/run/dbus
54 UUIDDIR=/var/lib/dbus
55
56 mkdir -p $MESSAGEHOME
57 mkdir -p $UUIDDIR
58 chgrp "$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || addgroup "$MESSAGEUSER"
59 chown "$MESSAGEUSER":"$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || \
60 adduser --system --home "$MESSAGEHOME" --no-create-home --disabled-password \
61 --ingroup "$MESSAGEUSER" "$MESSAGEUSER"
62
63 chown "$MESSAGEUSER":"$MESSAGEUSER" "$UUIDDIR"
64
65 grep -q netdev: /etc/group || addgroup netdev
66
67 chown root:"$MESSAGEUSER" /usr/libexec/dbus-daemon-launch-helper
68 chmod 4754 /usr/libexec/dbus-daemon-launch-helper
69
70 # add volatile after new user/grp are created
71 echo "d messagebus messagebus 0755 /var/run/dbus none" > /etc/default/volatiles/99_dbus
72 if [ -e /etc/init.d/populate-volatile.sh ] ; then
73 /etc/init.d/populate-volatile.sh update 55 /etc/init.d/populate-volatile.sh update
74 fi 56 fi
75} 57}
@@ -92,6 +74,18 @@ do_install() {
92 install -d ${D}${sysconfdir}/init.d 74 install -d ${D}${sysconfdir}/init.d
93 install -m 0755 ${WORKDIR}/dbus-1.init ${D}${sysconfdir}/init.d/dbus-1 75 install -m 0755 ${WORKDIR}/dbus-1.init ${D}${sysconfdir}/init.d/dbus-1
94 76
77 install -d ${D}${sysconfdir}/default/volatiles
78 echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
79 > ${D}${sysconfdir}/default/volatiles/99_dbus
80
81
82 mkdir -p ${D}${localstatedir}/run/dbus ${D}${localstatedir}/lib/dbus
83
84 chown messagebus:messagebus ${D}${localstatedir}/run/dbus ${D}${localstatedir}/lib/dbus
85
86 chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
87 chmod 4754 ${D}${libexecdir}/dbus-daemon-launch-helper
88
95 # disable dbus-1 sysv script on systemd installs 89 # disable dbus-1 sysv script on systemd installs
96 # nearly all distros call the initscript plain 'dbus', but OE-core is different 90 # nearly all distros call the initscript plain 'dbus', but OE-core is different
97 ln -sf /dev/null ${D}/${base_libdir}/systemd/system/dbus-1.service 91 ln -sf /dev/null ${D}/${base_libdir}/systemd/system/dbus-1.service