From: Saul Wold <saul.wold@intel.com>
To: Patches and discussions about the oe-core layer
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 4/4] dbus: use useradd class to allow use in read-only filesystems
Date: Fri, 21 Oct 2011 10:03:29 -0700 [thread overview]
Message-ID: <4EA1A5E1.8080508@intel.com> (raw)
In-Reply-To: <889826463264f3a2aeb5062afb5b2f24b5dc75a0.1319206126.git.otavio@ossystems.com.br>
On 10/21/2011 07:10 AM, Otavio Salvador wrote:
> Move creation of required user/groups to useradd class thus allowing
> use with read-only filesystems and booting the initial boot.
>
> Signed-off-by: Otavio Salvador<otavio@ossystems.com.br>
> ---
> meta/recipes-core/dbus/dbus.inc | 48 +++++++++++++++++----------------------
> 1 files changed, 21 insertions(+), 27 deletions(-)
>
> diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
> index a8ecda8..2a97c02 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
> DEPENDS_virtclass-native = "expat-native virtual/libintl-native"
> DEPENDS_virtclass-nativesdk = "expat-nativesdk virtual/libintl-nativesdk virtual/libx11"
>
> +PR = "r1"
> +
> SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
> file://tmpdir.patch; \
> file://dbus-1.init"
>
> -inherit autotools pkgconfig gettext update-rc.d
> +inherit useradd autotools pkgconfig gettext update-rc.d
>
> INITSCRIPT_NAME = "dbus-1"
> INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
>
> +USERADD_PACKAGES = "${PN}"
> +GROUPADD_PARAM_${PN} = "-r netdev"
I thought netdev was going to be removed from this recipe?
Sau!
> +USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \
> + --no-create-home --user-group messagebus"
> +
> CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
>
> DEBIANNAME_${PN} = "dbus-1"
> @@ -44,32 +51,7 @@ RRECOMMENDS_${PN}-lib = "${PN}"
> FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool"
>
> pkg_postinst_dbus() {
> - # can't do adduser stuff offline
> - if [ "x$D" != "x" ]; then
> - exit 1
> - fi
> -
> - MESSAGEUSER=messagebus
> - MESSAGEHOME=/var/run/dbus
> - UUIDDIR=/var/lib/dbus
> -
> - mkdir -p $MESSAGEHOME
> - mkdir -p $UUIDDIR
> - chgrp "$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || addgroup "$MESSAGEUSER"
> - chown "$MESSAGEUSER":"$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || \
> - adduser --system --home "$MESSAGEHOME" --no-create-home --disabled-password \
> - --ingroup "$MESSAGEUSER" "$MESSAGEUSER"
> -
> - chown "$MESSAGEUSER":"$MESSAGEUSER" "$UUIDDIR"
> -
> - grep -q netdev: /etc/group || addgroup netdev
> -
> - chown root:"$MESSAGEUSER" /usr/libexec/dbus-daemon-launch-helper
> - chmod 4754 /usr/libexec/dbus-daemon-launch-helper
> -
> - # add volatile after new user/grp are created
> - echo "d messagebus messagebus 0755 /var/run/dbus none"> /etc/default/volatiles/99_dbus
> - if [ -e /etc/init.d/populate-volatile.sh ] ; then
> + if [ -z "${D}" ]&& [ -e /etc/init.d/populate-volatile.sh ] ; then
> /etc/init.d/populate-volatile.sh update
> fi
> }
> @@ -92,6 +74,18 @@ do_install() {
> install -d ${D}${sysconfdir}/init.d
> install -m 0755 ${WORKDIR}/dbus-1.init ${D}${sysconfdir}/init.d/dbus-1
>
> + install -d ${D}${sysconfdir}/default/volatiles
> + echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
> + > ${D}${sysconfdir}/default/volatiles/99_dbus
> +
> +
> + mkdir -p ${D}${localstatedir}/run/dbus ${D}${localstatedir}/lib/dbus
> +
> + chown messagebus:messagebus ${D}${localstatedir}/run/dbus ${D}${localstatedir}/lib/dbus
> +
> + chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
> + chmod 4754 ${D}${libexecdir}/dbus-daemon-launch-helper
> +
> # disable dbus-1 sysv script on systemd installs
> # nearly all distros call the initscript plain 'dbus', but OE-core is different
> ln -sf /dev/null ${D}/${base_libdir}/systemd/system/dbus-1.service
next prev parent reply other threads:[~2011-10-21 17:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-21 14:10 [PATCH 0/4 v2] Fixes and improvements Otavio Salvador
2011-10-21 14:10 ` [PATCH 1/4] bootimg.bbclass: add support to disable HDD image building Otavio Salvador
2011-10-21 14:10 ` [PATCH 2/4] useradd.bbclass: check if a group already exists manually Otavio Salvador
2011-10-21 14:10 ` [PATCH 3/4] base-passwd: move initial criation of group and passwd to preinst Otavio Salvador
2011-10-21 14:52 ` Mark Hatle
2011-10-21 16:01 ` Otavio Salvador
2011-10-21 14:10 ` [PATCH 4/4] dbus: use useradd class to allow use in read-only filesystems Otavio Salvador
2011-10-21 17:03 ` Saul Wold [this message]
2011-10-21 17:07 ` Koen Kooi
-- strict thread matches above, loose matches on Subject: below --
2011-10-21 3:31 [PATCH 0/4] Fixes and improvements from O.S. Systems Otavio Salvador
2011-10-21 3:31 ` [PATCH 4/4] dbus: use useradd class to allow use in read-only filesystems Otavio Salvador
2011-10-21 6:54 ` Phil Blundell
2011-10-21 7:05 ` Koen Kooi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EA1A5E1.8080508@intel.com \
--to=saul.wold@intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox