Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Cc: Phil Blundell <philb@gnu.org>
Subject: Re: [PATCH] dbus: fix paths in startup script, use useradd.bbclass for user creation
Date: Wed, 07 Sep 2011 20:58:22 -0700	[thread overview]
Message-ID: <4E683D5E.70103@linux.intel.com> (raw)
In-Reply-To: <1315427297.4368.4.camel@lenovo.internal.reciva.com>

On 09/07/2011 01:28 PM, Phil Blundell wrote:
> Replace various hard-coded references to /usr, /var and /etc with symbolic equivalents.
>
> Also replace adhoc usage of adduser/addgroup with useradd.bbclass
> functionality.  This should, in theory, remove the need for a postinst
> to be run at boot time.
>
> Signed-off-by: Phil Blundell<philb@gnu.org>

This one seems to have some problems:

ERROR: Function 'useradd_sysroot' failed (see 
/srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86-64/build/build/tmp/work/x86_64-poky-linux/dbus-1.4.12-r6/temp/log.do_install.19825 
for further information)
ERROR: Logfile of failure stored in: 
/srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86-64/build/build/tmp/work/x86_64-poky-linux/dbus-1.4.12-r6/temp/log.do_install.19825
Log data follows:
| DEBUG: SITE files ['endian-little', 'common-linux', 'common-glibc', 
'bit-64', 'x86_64-linux', 'common']
| ERROR: Function 'useradd_sysroot' failed (see 
/srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86-64/build/build/tmp/work/x86_64-poky-linux/dbus-1.4.12-r6/temp/log.do_install.19825 
for further information)
| Running groupadd commands...
| sent invalidate(passwd) request, exiting
| sent invalidate(group) request, exiting
| sent invalidate(group) request, exiting
| sent invalidate(passwd) request, exiting
| sent invalidate(group) request, exiting
| sent invalidate(group) request, exiting
| Running useradd commands...
| useradd: group messagebus exists - if you want to add this user to 
that group, use -g.
NOTE: package dbus-1.4.12-r6: task do_install: Failed
ERROR: Task 1684 
(/srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-x86-64/build/meta/recipes-core/dbus/dbus_1.4.12.bb, 
do_install) failed with exit code '1'

Please rework and let me know how it was tested, this might not make 1.1 
at this point as we are starting to tighten requirements as we go into 
the RC phase.

Thanks
	Sau!


> ---
>   meta/recipes-core/dbus/dbus-1.4.12/dbus-1.init |   14 +++---
>   meta/recipes-core/dbus/dbus.inc                |   58 ++++++++++++------------
>   meta/recipes-core/dbus/dbus_1.4.12.bb          |    1 +
>   3 files changed, 37 insertions(+), 36 deletions(-)
>
> diff --git a/meta/recipes-core/dbus/dbus-1.4.12/dbus-1.init b/meta/recipes-core/dbus/dbus-1.4.12/dbus-1.init
> index 4abc4cb..1917ad3 100644
> --- a/meta/recipes-core/dbus/dbus-1.4.12/dbus-1.init
> +++ b/meta/recipes-core/dbus/dbus-1.4.12/dbus-1.init
> @@ -16,22 +16,22 @@
>
>   set -e
>
> -DAEMON=/usr/bin/dbus-daemon
> +DAEMON=@BINDIR@/dbus-daemon
>   NAME=dbus
>   DAEMONUSER=messagebus
> -PIDDIR=/var/run/dbus
> +PIDDIR=@LOCALSTATEDIR@/run/dbus
>   PIDFILE=$PIDDIR/pid
> -UUIDDIR=/var/lib/dbus
> +UUIDDIR=@LOCALSTATEDIR@/lib/dbus
>   DESC="system message bus"
> -EVENTDIR=/etc/dbus-1/event.d
> +EVENTDIR=@SYSCONFDIR@/dbus-1/event.d
>
>   test -x $DAEMON || exit 0
>
>   # Source defaults file; edit that file to configure this script.
>   ENABLED=1
>   PARAMS=""
> -if [ -e /etc/default/dbus ]; then
> -  . /etc/default/dbus
> +if [ -e @SYSCONFDIR@/default/dbus ]; then
> +  . @SYSCONFDIR@/default/dbus
>   fi
>
>   test "$ENABLED" != "0" || exit 0
> @@ -113,7 +113,7 @@ case "$1" in
>       start_it_up
>     ;;
>     *)
> -    echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload|force-reload}">&2
> +    echo "Usage: @SYSCONFDIR@/init.d/$NAME {start|stop|restart|reload|force-reload}">&2
>       exit 1
>     ;;
>   esac
> diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
> index a8ecda8..34dbe4a 100644
> --- a/meta/recipes-core/dbus/dbus.inc
> +++ b/meta/recipes-core/dbus/dbus.inc
> @@ -14,11 +14,19 @@ 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 autotools pkgconfig gettext update-rc.d useradd
> +
> +USERADD_PACKAGES = "${PN}"
> +USERADD_PARAM_${PN} = "-d ${MESSAGEHOME} -g ${MESSAGEUSER} -r ${MESSAGEUSER}"
> +GROUPADD_PARAM_${PN} = "${MESSAGEUSER}; netdev"
>
>   INITSCRIPT_NAME = "dbus-1"
>   INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
>
> +MESSAGEUSER=messagebus
> +MESSAGEHOME="${localstatedir}/run/dbus"
> +UUIDDIR="${localstatedir}/lib/dbus"
> +
>   CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
>
>   DEBIANNAME_${PN} = "dbus-1"
> @@ -34,42 +42,27 @@ FILES_${PN} = "${bindir}/dbus-daemon* \
>                  ${bindir}/dbus-uuidgen \
>                  ${bindir}/dbus-cleanup-sockets \
>                  ${bindir}/dbus-send \
> -               ${bindir}/dbus-monitor \
> +               ${bindir}/dbus-monitor \	
> +	       ${bindir}/dbus-launch \
>                  ${libexecdir}/dbus* \
>                  ${sysconfdir} \
>                  ${datadir}/dbus-1/services \
> -               ${datadir}/dbus-1/system-services"
> +               ${datadir}/dbus-1/system-services \
> +	       ${MESSAGEHOME} \
> +	       ${UUIDDIR}"
>   FILES_${PN}-lib = "${libdir}/lib*.so.*"
>   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"
> +pkg_postinst_${PN}() {
> +	chgrp "${MESSAGEUSER}" "${MESSAGEHOME}"
> +	chown "${MESSAGEUSER}":"${MESSAGEUSER}" "${MESSAGEHOME}"
> +	chown "${MESSAGEUSER}":"${MESSAGEUSER}" "${UUIDDIR}"
>
> -	chown "$MESSAGEUSER":"$MESSAGEUSER" "$UUIDDIR"
> +	chown root:"${MESSAGEUSER}" $D${libexecdir}/dbus-daemon-launch-helper
> +	chmod 4754 $D${libexecdir}/dbus-daemon-launch-helper
>
> -	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
>   }
> @@ -90,11 +83,18 @@ do_install() {
>   	autotools_do_install
>
>   	install -d ${D}${sysconfdir}/init.d
> -	install -m 0755 ${WORKDIR}/dbus-1.init ${D}${sysconfdir}/init.d/dbus-1
> +	sed 's:@SYSCONFDIR@:${sysconfdir}:;s:@BINDIR@:${bindir}:;s:@LOCALSTATEDIR@:${localstatedir}:'<  ${WORKDIR}/dbus-1.init>  ${D}${sysconfdir}/init.d/dbus-1
> +	chmod 755 ${D}${sysconfdir}/init.d/dbus-1
>
>   	# 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
> +
> +	install -d ${D}${UUIDDIR}
> +	install -d ${D}${MESSAGEHOME}
> +
> +	install -d ${D}${sysconfdir}/default/volatiles
> +	echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none">  ${D}${sysconfdir}/default/volatiles/99_dbus
>   }
>
>   do_install_virtclass-native() {
> diff --git a/meta/recipes-core/dbus/dbus_1.4.12.bb b/meta/recipes-core/dbus/dbus_1.4.12.bb
> index ada53c9..51604aa 100644
> --- a/meta/recipes-core/dbus/dbus_1.4.12.bb
> +++ b/meta/recipes-core/dbus/dbus_1.4.12.bb
> @@ -2,3 +2,4 @@ include dbus.inc
>   SRC_URI[md5sum] = "104f2ea94c10a896dfb1edecb5714cb1"
>   SRC_URI[sha256sum] = "da3c97fd546610558d588799e27c4fa81101e754acbcd34747a42c131f30dbe7"
>
> +PR = "r6"



  reply	other threads:[~2011-09-08  4:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-07 20:28 [PATCH] dbus: fix paths in startup script, use useradd.bbclass for user creation Phil Blundell
2011-09-08  3:58 ` Saul Wold [this message]
2011-09-08  6:54   ` Phil Blundell
2011-09-08 15:44     ` Scott Garman
2011-09-09  8:46       ` Phil Blundell
2011-09-09 17:43         ` Richard Purdie

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=4E683D5E.70103@linux.intel.com \
    --to=sgw@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=philb@gnu.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