Skip to contentSkip to conversation

useradd changes to dbus, base-passwd

PATCH Applied James Limbouris 5 participants 20 messages Oct 26, 2011 – Nov 8, 2011

lore
Share & tools
lore
#0 lore raw

Hi,

Recent changes to dbus have broken some sdk building:

Missing or unbuildable dependency chain was: ['meta-toolchain-qte', 'task-qte-toolchain-host-nativesdk', 'qt4-tools-nativesdk', 'dbus-nativesdk', 'base-passwd-nativesdk']

I think the commit introducing the base-passed dependency is 46e6c3fa8034b12d178d605f3f5d7efe69671a13 (dbus: use useradd class to allow use in read-only filesystems).
I'm not too clear on how useradd works, so I can't tell if simply adding BBCLASSEXTEND = "native nativesdk" to base-passwd is sufficient. I'd expect that this would cause dbus to add itself to the sdk sysroot's passwd (which previously didn't exist?). Seems harmless enough... I'm giving it a try now, but any advice or opinions would be appreciated.
Regards,
James Limbouris

#1 lore raw
Quoted 16 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of James Limbouris
Sent: Wednesday, 26 October 2011 9:35 AM
To: [email protected]
Subject: [OE-core] useradd changes to dbus, base-passwd

Hi,

Recent changes to dbus have broken some sdk building:

Missing or unbuildable dependency chain was: ['meta-toolchain-qte', 'task-qte- toolchain-host-nativesdk', 'qt4-tools-nativesdk', 'dbus-nativesdk', 'base-passwd- nativesdk']

Quoted 8 lines

I think the commit introducing the base-passed dependency is 46e6c3fa8034b12d178d605f3f5d7efe69671a13 (dbus: use useradd class to allow use in read-only filesystems).
I'm not too clear on how useradd works, so I can't tell if simply adding BBCLASSEXTEND = "native nativesdk" to base-passwd is sufficient. I'd expect that this would cause dbus to add itself to the sdk sysroot's passwd (which previously didn't exist?). Seems harmless enough... I'm giving it a try now, but any advice or opinions would be appreciated.

It seems that adding BBCLASSEXTEND = "native nativesdk" to base-passwd and shadow-sysroot is not sufficient. dbus itself will not build for nativesdk:

NOTE: package dbus-nativesdk-1.4.12-r1: task do_install: Started
ERROR: Function 'useradd_sysroot' failed (see /home/james/oe/build/tmp-eglibc/work/i686-nativesdk-ricasdk-linux/dbus-nativesdk-1.4.12-r1/temp/log.do_install.1735 for further information)
ERROR: Logfile of failure stored in: /home/james/oe/build/tmp-eglibc/work/i686-nativesdk-ricasdk-linux/dbus-nativesdk-1.4.12-r1/temp/log.do_install.1735 Log data follows:

| DEBUG: SITE files ['endian-little', 'bit-32', 'ix86-common', 'common-linux', 'common-glibc', 'i686-linux', 'common']
| + cd /home/james/oe/build/tmp-eglibc/work/i686-nativesdk-ricasdk-linux/dbus-nativesdk-1.4.12-r1/dbus-1.4.12
| + useradd_sysroot
| + export PSEUDO=/home/james/oe/build/tmp-eglibc/sysroots/i686-linux/usr/local/rica-eglibc-i686-armv5te/sysroots/i686-ricasdk-linux/usr/bin/pseudo
| + PSEUDO=/home/james/oe/build/tmp-eglibc/sysroots/i686-linux/usr/local/rica-eglibc-i686-armv5te/sysroots/i686-ricasdk-linux/usr/bin/pseudo
| + export PSEUDO_LOCALSTATEDIR=/home/james/oe/build/tmp-eglibc/sysroots/i686-nativesdk-ricasdk-linux/usr/local/rica-eglibc-i686-armv5te/sysroots/i686-ricasdk-linux/var/pseudo
| + PSEUDO_LOCALSTATEDIR=/home/james/oe/build/tmp-eglibc/sysroots/i686-nativesdk-ricasdk-linux/usr/local/rica-eglibc-i686-armv5te/sysroots/i686-ricasdk-linux/var/pseudo
| + D=/home/james/oe/build/tmp-eglibc/sysroots/i686-nativesdk-ricasdk-linux
| + useradd_preinst
| + OPT=
| + SYSROOT=
| + test x/home/james/oe/build/tmp-eglibc/sysroots/i686-nativesdk-ricasdk-linux '!=' x
| + SYSROOT=/home/james/oe/build/tmp-eglibc/sysroots/i686-nativesdk-ricasdk-linux
| + OPT='--root /home/james/oe/build/tmp-eglibc/sysroots/i686-nativesdk-ricasdk-linux'
| + GROUPADD_PARAM='-r netdev'
| + USERADD_PARAM='--system --home /usr/local/rica-eglibc-i686-armv5te/sysroots/i686-ricasdk-linux/var/lib/dbus                        --no-create-home --user-group messagebus'
| + test 'x-r netdev' '!=' x
| + echo 'Running groupadd commands...'
| Running groupadd commands...
| ++ echo '-r netdev'
| ++ cut -d ';' -f 1
| + opts='-r netdev'
| ++ echo '-r netdev'
| ++ cut -d ';' -f 2-
| + remaining='-r netdev'
| + test 'x-r netdev' '!=' x
| ++ echo '-r netdev'
| ++ awk '{ print $NF }'
| + groupname=netdev
| ++ grep '^netdev:' /home/james/oe/build/tmp-eglibc/sysroots/i686-nativesdk-ricasdk-linux/etc/group
| grep: /home/james/oe/build/tmp-eglibc/sysroots/i686-nativesdk-ricasdk-linux/etc/group: No such file or directory
| ++ true
| + group_exists=
| + test x = x
| + eval /home/james/oe/build/tmp-eglibc/sysroots/i686-linux/usr/local/rica-eglibc-i686-armv5te/sysroots/i686-ricasdk-linux/usr/bin/pseudo groupadd --root /home/james/oe/build/tmp-eglibc/sysroots/i686-nativesdk-ricasdk-linux -r netdev
| ++ /home/james/oe/build/tmp-eglibc/sysroots/i686-linux/usr/local/rica-eglibc-i686-armv5te/sysroots/i686-ricasdk-linux/usr/bin/pseudo groupadd --root /home/james/oe/build/tmp-eglibc/sysroots/i686-nativesdk-ricasdk-linux -r netdev
| /home/james/oe/build/tmp-eglibc/work/i686-nativesdk-ricasdk-linux/dbus-nativesdk-1.4.12-r1/temp/run.useradd_sysroot.1735: line 129: /home/james/oe/build/tmp-eglibc/sysroots/i686-linux/usr/local/rica-eglibc-i686-armv5te/sysroots/i686-ricasdk-linux/usr/bin/pseudo: No such file or directory
| ERROR: Function 'useradd_sysroot' failed (see /home/james/oe/build/tmp-eglibc/work/i686-nativesdk-ricasdk-linux/dbus-nativesdk-1.4.12-r1/temp/log.do_install.1735 for further information)

NOTE: package dbus-nativesdk-1.4.12-r1: task do_install: Failed
ERROR: Task 1370 (virtual:nativesdk:/home/james/oe/sources/oe-core/meta/recipes-core/dbus/dbus_1.4.12.bb, do_install) failed with exit code '1'

Perhaps we should not inherit useradd when building for nativesdk? After all, the sdk sysroots have not had /etc/passwd in the past.

James

#2 lore raw
Quoted 28 lines · James Limbouris
Quoted 16 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of James Limbouris
Sent: Wednesday, 26 October 2011 9:35 AM
To: [email protected]
Subject: [OE-core] useradd changes to dbus, base-passwd

Hi,

Recent changes to dbus have broken some sdk building:

Missing or unbuildable dependency chain was: ['meta-toolchain-qte', 'task-qte- toolchain-host-nativesdk', 'qt4-tools-nativesdk', 'dbus-nativesdk', 'base-passwd- nativesdk']

Quoted 8 lines

I think the commit introducing the base-passed dependency is 46e6c3fa8034b12d178d605f3f5d7efe69671a13 (dbus: use useradd class to allow use in read-only filesystems).
I'm not too clear on how useradd works, so I can't tell if simply adding BBCLASSEXTEND = "native nativesdk" to base-passwd is sufficient. I'd expect that this would cause dbus to add itself to the sdk sysroot's passwd (which previously didn't exist?). Seems harmless enough... I'm giving it a try now, but any advice or opinions would be appreciated.

It seems that adding BBCLASSEXTEND = "native nativesdk" to base-passwd and shadow-sysroot is not sufficient. dbus itself will not build for nativesdk:

...

Quoted 4 lines

NOTE: package dbus-nativesdk-1.4.12-r1: task do_install: Failed
ERROR: Task 1370 (virtual:nativesdk:/home/james/oe/sources/oe-core/meta/recipes-core/dbus/dbus_1.4.12.bb, do_install) failed with exit code '1'

Perhaps we should not inherit useradd when building for nativesdk? After all, the sdk sysroots have not had /etc/passwd in the past.

The useradd class should only be used in a target build. Neither nativesdk or native have a reasonable set of actions with useradd.

I am a bit confused as to why we are building dbus in a nativesdk situation. I would have thought that we'd be forced to use the host system's version of dbus for compatibility sake. Perhaps this is the root of the problem -- or I'm mistaken and we do need to build it -- in that case we need to avoid including useradd with non-target builds.

--Mark

Quoted 7 lines

James

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 37 lines · Mark Hatle
Quoted 28 lines · James Limbouris
Quoted 16 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of James Limbouris
Sent: Wednesday, 26 October 2011 9:35 AM
To: [email protected]
Subject: [OE-core] useradd changes to dbus, base-passwd

Hi,

Recent changes to dbus have broken some sdk building:

Missing or unbuildable dependency chain was: ['meta-toolchain-qte', 'task-qte- toolchain-host-nativesdk', 'qt4-tools-nativesdk', 'dbus-nativesdk', 'base-passwd- nativesdk']

Quoted 8 lines

I think the commit introducing the base-passed dependency is 46e6c3fa8034b12d178d605f3f5d7efe69671a13 (dbus: use useradd class to allow use in read-only filesystems).
I'm not too clear on how useradd works, so I can't tell if simply adding BBCLASSEXTEND = "native nativesdk" to base-passwd is sufficient. I'd expect that this would cause dbus to add itself to the sdk sysroot's passwd (which previously didn't exist?). Seems harmless enough... I'm giving it a try now, but any advice or opinions would be appreciated.

It seems that adding BBCLASSEXTEND = "native nativesdk" to base-passwd and shadow-sysroot is not sufficient. dbus itself will not build for nativesdk:

...

Quoted 4 lines

NOTE: package dbus-nativesdk-1.4.12-r1: task do_install: Failed
ERROR: Task 1370 (virtual:nativesdk:/home/james/oe/sources/oe-core/meta/recipes-core/dbus/dbus_1.4.12.bb, do_install) failed with exit code '1'

Perhaps we should not inherit useradd when building for nativesdk? After all, the sdk sysroots have not had /etc/passwd in the past.

Quoted 8 lines

The useradd class should only be used in a target build. Neither nativesdk or native have a reasonable set of actions with useradd.

I am a bit confused as to why we are building dbus in a nativesdk situation. I would have thought that we'd be forced to use the host system's version of dbus for compatibility sake. Perhaps this is the root of the problem -- or I'm mistaken and we do need to build it -- in that case we need to avoid including useradd with non-target builds.

Grepping through our classes, it looks like I can detect the nativesdk within useradd.bbclass by checking for bb.data.inherits_class('nativesdk', d).

I've filed a bug for this and will develop a patch to ensure useradd is becomes a no-op for nativesdk builds:

http://bugzilla.pokylinux.org/show_bug.cgi?id=1702

Thanks for reporting this!

Scott

Signature · 3 lines
Scott Garman
Embedded Linux Engineer - Yocto Project
Intel Open Source Technology Center
#4 lore raw

Hi Scott,

Quoted 8 lines · Scott Garman

Grepping through our classes, it looks like I can detect the nativesdk within useradd.bbclass by checking for bb.data.inherits_class('nativesdk', d).

I've filed a bug for this and will develop a patch to ensure useradd is becomes a no-op for nativesdk builds:

http://bugzilla.pokylinux.org/show_bug.cgi?id=1702

here is a patch tentative which allowed me to compile meta-toolchain-qte.
Is that the right way to solve the problem (in which case I'll submit the patch with comment & sob)?

Thanks
Eric

meta/classes/useradd.bbclass +17 -3
index fb70b3e..cbcc9e9 100644
@@ -3,9 +3,16 @@ USERADDPN ?= "${PN}"
 # base-passwd-cross provides the default passwd and group files in the
 # target sysroot, and shadow -native and -sysroot provide the utilities
 # and support files needed to add and modify user and group accounts
-DEPENDS_append = " base-passwd shadow-native shadow-sysroot"
 RDEPENDS_${USERADDPN}_append = " base-passwd shadow"
 
+def useradd_dep_append(d):
+	deps = ' '
+	if not bb.data.inherits_class('nativesdk', d):
+		deps = ' shadow-native shadow-sysroot base-passwd'
+	return deps
+
+DEPENDS_append = "${@useradd_dep_append(d)}"
+
 # This preinstall function will be run in two contexts: once for the
 # native sysroot (as invoked by the useradd_sysroot() wrapper), and
 # also as the preinst script in the target package.
@@ -96,8 +103,17 @@ useradd_sysroot_sstate () {
 	fi
 }
 
-do_install[prefuncs] += "useradd_sysroot"
-SSTATEPOSTINSTFUNCS += "useradd_sysroot_sstate"
+
+python () {
+	if not bb.data.inherits_class('nativesdk', d):
+		funcs = bb.data.getVarFlag('do_install', 'prefuncs', d) or ""
+		funcs += 'useradd_sysroot'
+		bb.data.setVarFlag('do_install', 'prefuncs', funcs, d)
+		d.setVar('SSTATEPOSTINSTFUNCS', (bb.data.getVar('SSTATEPOSTINSTFUNCS', d, True) or "").join("useradd_sysroot_sstate"))
+}
+
 
 # Recipe parse-time sanity checks
 def update_useradd_after_parse(d):
meta/recipes-core/dbus/dbus.inc +4 -0
index caa781c..99b2fc7 100644
@@ -105,4 +105,8 @@ do_install_virtclass-native() {
 	# dbus-glib-native and dbus-glib need this xml file
 	./bus/dbus-daemon --introspect > ${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml
 }
+
+do_install_virtclass-nativesdk() {
+	autotools_do_install
+}
 BBCLASSEXTEND = "native nativesdk"
#5 lore raw
Quoted 7 lines · Eric Bénard

Hi Scott,

Quoted 4 lines · Scott Garman

Grepping through our classes, it looks like I can detect the nativesdk within
useradd.bbclass by checking for bb.data.inherits_class('nativesdk', d).

Quoted 8 lines
Quoted 5 lines

I've filed a bug for this and will develop a patch to ensure useradd is becomes a no-op for nativesdk builds:

http://bugzilla.pokylinux.org/show_bug.cgi?id=1702

here is a patch tentative which allowed me to compile meta-toolchain-qte. Is that the right way to solve the problem (in which case I'll submit the patch with comment & sob)?

Hi Eric,

This looks good, thank you! Two questions though:

When I was testing my own variation of this fix out, I found that testing bb.data.inherits_class('nativesdk', d) did not work as I expected. It returned false for a recipe I was testing with that used BBCLASSEXTEND = "native nativesdk". So instead I was checking if PN ended with -nativesdk. Are you certain the inherits_class test works?

My second question is why the autotools_do_install is needed for the nativesdk case?

Thanks,

Scott

Signature · 3 lines
Scott Garman
Embedded Linux Engineer - Yocto Project
Intel Open Source Technology Center
#6 lore raw

Hi Scott,

Quoted 8 lines · Scott Garman

This looks good, thank you! Two questions though:

When I was testing my own variation of this fix out, I found that testing bb.data.inherits_class('nativesdk', d) did not work as I expected. It returned false for a recipe I was testing with that used BBCLASSEXTEND = "native nativesdk". So instead I was checking if PN ended with -nativesdk. Are you certain the inherits_class test works?

this seems to work as expected in the present case :

$ grep BBCLASSEXTEND sources/openembedded-core/meta/recipes-core/dbus/dbus.inc
BBCLASSEXTEND = "native nativesdk"
$ bitbake dbus -e |grep ^DEPENDS=
DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native libtool-cross gnu-config-native virtual/gettext gettext-native virtual/arm-angstrom-linux-gnueabi-gcc virtual/arm-angstrom-linux-gnueabi-compilerlibs virtual/libc  expat virtual/libintl virtual/libx11 libsm shadow-native shadow-sysroot base-passwd update-rc.d-native"
$ bitbake dbus-native -e |grep ^DEPENDS=
DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native gnu-config-native gettext-minimal-native  expat-native virtual/libintl-native shadow-native shadow-sysroot base-passwd update-rc.d-native"
$ bitbake dbus-nativesdk -e |grep ^DEPENDS=
DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native libtool-cross gnu-config-native virtual/gettext-nativesdk gettext-native virtual/i686-angstromsdk-linux-gcc-crosssdk virtual/i686-angstromsdk-linux-compilerlibs-nativesdk virtual/libc-nativesdk expat-nativesdk virtual/libintl-nativesdk virtual/libx11-nativesdk update-rc.d-native"
$ bitbake dbus-nativesdk -e |grep ^SSTATEPOSTIN
$ bitbake dbus-native -e |grep ^SSTATEPOSTIN
SSTATEPOSTINSTFUNCS="useradd_sysroot_sstate"
$ bitbake dbus -e |grep ^SSTATEPOSTIN
SSTATEPOSTINSTFUNCS="useradd_sysroot_sstate"
Quoted 3 lines

My second question is why the autotools_do_install is needed for the nativesdk case?

because without the do_install_virtclass-nativesdk() , that's the standard do_install which is used which tries to setup some rigths using chown on the files and that fails (and is not very useful for a nativesdk). Maybe we could use a similar do_install as the one used for native.

Eric

#7 lore raw
Quoted 48 lines · Eric Bénard

Hi Scott,

Quoted 10 lines · Scott Garman

This looks good, thank you! Two questions though:

When I was testing my own variation of this fix out, I found that testing bb.data.inherits_class('nativesdk', d) did not work as I expected. It returned
false for a recipe I was testing with that used BBCLASSEXTEND = "native nativesdk". So instead I was checking if PN ended with -nativesdk. Are you
certain the inherits_class test works?

this seems to work as expected in the present case :

$ grep BBCLASSEXTEND
sources/openembedded-core/meta/recipes-core/dbus/dbus.inc
BBCLASSEXTEND = "native nativesdk"
$ bitbake dbus -e |grep ^DEPENDS=
DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native
libtool-cross gnu-config-native virtual/gettext gettext-native
virtual/arm-angstrom-linux-gnueabi-gcc
virtual/arm-angstrom-linux-gnueabi-compilerlibs virtual/libc expat
virtual/libintl virtual/libx11 libsm shadow-native shadow-sysroot
base-passwd update-rc.d-native"
$ bitbake dbus-native -e |grep ^DEPENDS=
DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native
gnu-config-native gettext-minimal-native expat-native
virtual/libintl-native shadow-native shadow-sysroot base-passwd
update-rc.d-native"
$ bitbake dbus-nativesdk -e |grep ^DEPENDS=
DEPENDS="pkgconfig-native autoconf-native automake-native libtool-native
libtool-cross gnu-config-native virtual/gettext-nativesdk gettext-native
virtual/i686-angstromsdk-linux-gcc-crosssdk
virtual/i686-angstromsdk-linux-compilerlibs-nativesdk
virtual/libc-nativesdk expat-nativesdk virtual/libintl-nativesdk
virtual/libx11-nativesdk update-rc.d-native"
$ bitbake dbus-nativesdk -e |grep ^SSTATEPOSTIN
$ bitbake dbus-native -e |grep ^SSTATEPOSTIN
SSTATEPOSTINSTFUNCS="useradd_sysroot_sstate"
$ bitbake dbus -e |grep ^SSTATEPOSTIN
SSTATEPOSTINSTFUNCS="useradd_sysroot_sstate"
Quoted 8 lines
Quoted 4 lines

My second question is why the autotools_do_install is needed for the nativesdk
case?

because without the do_install_virtclass-nativesdk() , that's the standard do_install which is used which tries to setup some rigths using chown on the files and that fails (and is not very useful for a nativesdk). Maybe we could use a similar do_install as the one used for native.

Thanks for the explanation and verifying the inherit_class call.

I'm happy to ack a patch for this, please submit it.

Thanks!

Scott

Signature · 3 lines
Scott Garman
Embedded Linux Engineer - Yocto Project
Intel Open Source Technology Center
#8 lore raw

PATCH 1/2 useradd.bbclass: handle nativesdk case

* without this patch, building dbus-nativesdk leads to a missing dependency on 'base-passwd-nativesdk'
This was added by commit 46e6c3fa8034b12d178d605f3f5d7efe69671a13
* this patch handle the nativesdk case in the class useradd
* close bug 1702 http://bugzilla.pokylinux.org/show_bug.cgi?id=1702

---
 meta/classes/useradd.bbclass |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)
meta/classes/useradd.bbclass +15 -3
index fb70b3e..b935d01 100644
@@ -3,9 +3,16 @@ USERADDPN ?= "${PN}"
 # base-passwd-cross provides the default passwd and group files in the
 # target sysroot, and shadow -native and -sysroot provide the utilities
 # and support files needed to add and modify user and group accounts
-DEPENDS_append = " base-passwd shadow-native shadow-sysroot"
 RDEPENDS_${USERADDPN}_append = " base-passwd shadow"
 
+def useradd_dep_append(d):
+	deps = ' '
+	if not bb.data.inherits_class('nativesdk', d):
+		deps = ' shadow-native shadow-sysroot base-passwd'
+	return deps
+
+DEPENDS_append = "${@useradd_dep_append(d)}"
+
 # This preinstall function will be run in two contexts: once for the
 # native sysroot (as invoked by the useradd_sysroot() wrapper), and
 # also as the preinst script in the target package.
@@ -96,8 +103,13 @@ useradd_sysroot_sstate () {
 	fi
 }
 
-do_install[prefuncs] += "useradd_sysroot"
-SSTATEPOSTINSTFUNCS += "useradd_sysroot_sstate"
+python () {
+	if not bb.data.inherits_class('nativesdk', d):
+		funcs = bb.data.getVarFlag('do_install', 'prefuncs', d) or ""
+		funcs += 'useradd_sysroot'
+		bb.data.setVarFlag('do_install', 'prefuncs', funcs, d)
+		d.setVar('SSTATEPOSTINSTFUNCS', (bb.data.getVar('SSTATEPOSTINSTFUNCS', d, True) or "").join("useradd_sysroot_sstate"))
+}
 
 # Recipe parse-time sanity checks
 def update_useradd_after_parse(d):
Signature · 1 line
1.7.6.4
#9 lore raw

PATCH 2/2 dbus: fix install for virtclass-nativesdk

* 46e6c3fa8034b12d178d605f3f5d7efe69671a13 changed do_install which now fails for nativesdk (chown messagebus leads to no such user)
* tested by building meta-toolchain-qte and running the generated sdk

---
 meta/recipes-core/dbus/dbus.inc |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
meta/recipes-core/dbus/dbus.inc +4 -0
index caa781c..99b2fc7 100644
@@ -105,4 +105,8 @@ do_install_virtclass-native() {
 	# dbus-glib-native and dbus-glib need this xml file
 	./bus/dbus-daemon --introspect > ${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml
 }
+
+do_install_virtclass-nativesdk() {
+	autotools_do_install
+}
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
1.7.6.4
Acked-by on v1 2/2
#10 lore raw

Re: [PATCH 2/2] dbus: fix install for virtclass-nativesdk

Quoted 7 lines · Eric Bénard

* 46e6c3fa8034b12d178d605f3f5d7efe69671a13 changed do_install which now fails for nativesdk (chown messagebus leads to no such user)
* tested by building meta-toolchain-qte and running the generated sdk

Quoted 17 lines
---
  meta/recipes-core/dbus/dbus.inc |    4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)
meta/recipes-core/dbus/dbus.inc +4 -0
index caa781c..99b2fc7 100644
@@ -105,4 +105,8 @@ do_install_virtclass-native() {
  	# dbus-glib-native and dbus-glib need this xml file
  	./bus/dbus-daemon --introspect>  ${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml
  }
+
+do_install_virtclass-nativesdk() {
+	autotools_do_install
+}
  BBCLASSEXTEND = "native nativesdk"
Signature · 3 lines
Scott Garman
Embedded Linux Engineer - Yocto Project
Intel Open Source Technology Center
Acked-by on v1 1/2
#11 lore raw

Re: [PATCH 1/2] useradd.bbclass: handle nativesdk case

In reply to Eric Bénard
Quoted 7 lines · Eric Bénard

* without this patch, building dbus-nativesdk leads to a missing dependency on 'base-passwd-nativesdk'
This was added by commit 46e6c3fa8034b12d178d605f3f5d7efe69671a13
* this patch handle the nativesdk case in the class useradd
* close bug 1702 http://bugzilla.pokylinux.org/show_bug.cgi?id=1702

Quoted 42 lines
---
  meta/classes/useradd.bbclass |   18 +++++++++++++++---
  1 files changed, 15 insertions(+), 3 deletions(-)
meta/classes/useradd.bbclass +15 -3
index fb70b3e..b935d01 100644
@@ -3,9 +3,16 @@ USERADDPN ?= "${PN}"
  # base-passwd-cross provides the default passwd and group files in the
  # target sysroot, and shadow -native and -sysroot provide the utilities
  # and support files needed to add and modify user and group accounts
-DEPENDS_append = " base-passwd shadow-native shadow-sysroot"
  RDEPENDS_${USERADDPN}_append = " base-passwd shadow"
 
+def useradd_dep_append(d):
+	deps = ' '
+	if not bb.data.inherits_class('nativesdk', d):
+		deps = ' shadow-native shadow-sysroot base-passwd'
+	return deps
+
+DEPENDS_append = "${@useradd_dep_append(d)}"
+
  # This preinstall function will be run in two contexts: once for the
  # native sysroot (as invoked by the useradd_sysroot() wrapper), and
  # also as the preinst script in the target package.
@@ -96,8 +103,13 @@ useradd_sysroot_sstate () {
  	fi
  }
 
-do_install[prefuncs] += "useradd_sysroot"
-SSTATEPOSTINSTFUNCS += "useradd_sysroot_sstate"
+python () {
+	if not bb.data.inherits_class('nativesdk', d):
+		funcs = bb.data.getVarFlag('do_install', 'prefuncs', d) or ""
+		funcs += 'useradd_sysroot'
+		bb.data.setVarFlag('do_install', 'prefuncs', funcs, d)
+		d.setVar('SSTATEPOSTINSTFUNCS', (bb.data.getVar('SSTATEPOSTINSTFUNCS', d, True) or "").join("useradd_sysroot_sstate"))
+}
 
  # Recipe parse-time sanity checks
  def update_useradd_after_parse(d):
Signature · 3 lines
Scott Garman
Embedded Linux Engineer - Yocto Project
Intel Open Source Technology Center
#12 lore raw

Re: [PATCH 1/2] useradd.bbclass: handle nativesdk case

In reply to Eric Bénard

Hi Eric,

Sorry to throw more churn into this, but can I ask you to submit a new pull request for this?

In discussions with Richard today, he pointed out a few tricks that would improve the patchset:

DEPENDS_append = "${USERADDDEPENDS}" USERADDDEPENDS = " base-passwd shadow-native shadow-sysroot" USERADDDEPENDS_virtclass-nativesdk = ""

do_install[prefuncs] += "${SYSROOTFUNC}"
SYSROOTFUNC = "useradd_sysroot"
SYSROOTFUNC_virtclass-nativesdk = ""

I didn't want to take away credit for your patch, so if you'd be willing to make these changes and respin your patch set, we'll take that.

The second thing is to avoid merge conflicts, can you rebase you patchset on top of this branch:

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sgarman/useradd-rdepends-final

...and Saul has been warned to apply these patches in the correct order.

Thanks,

Scott

PS - if this is a hassle, just let me know and I'm happy to take care of it.

Signature · 3 lines
Scott Garman
Embedded Linux Engineer - Yocto Project
Intel Open Source Technology Center
#13 lore raw

PATCH 1/2 useradd.bbclass: handle nativesdk case

* without this patch, building dbus-nativesdk leads to a missing dependency on 'base-passwd-nativesdk'
This was added by commit 46e6c3fa8034b12d178d605f3f5d7efe69671a13
* this patch handle the nativesdk case in the class useradd
* close bug 1702 http://bugzilla.pokylinux.org/show_bug.cgi?id=1702
* v2 from Scott Garman with Richard Purdie's tricks

---
 meta/classes/useradd.bbclass |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
meta/classes/useradd.bbclass +6 -3
index 0f9b84c..6c933e1 100644
@@ -3,7 +3,9 @@ USERADDPN ?= "${PN}"
 # base-passwd-cross provides the default passwd and group files in the
 # target sysroot, and shadow -native and -sysroot provide the utilities
 # and support files needed to add and modify user and group accounts
-DEPENDS_append = " base-passwd shadow-native shadow-sysroot"
+DEPENDS_append = "${USERADDDEPENDS}"
+USERADDDEPENDS = " base-passwd shadow-native shadow-sysroot"
+USERADDDEPENDS_virtclass-nativesdk = ""
 
 # This preinstall function will be run in two contexts: once for the
 # native sysroot (as invoked by the useradd_sysroot() wrapper), and
@@ -95,8 +97,9 @@ useradd_sysroot_sstate () {
 	fi
 }
 
-do_install[prefuncs] += "useradd_sysroot"
-SSTATEPOSTINSTFUNCS += "useradd_sysroot_sstate"
+do_install[prefuncs] += "${SYSROOTFUNC}"
+SYSROOTFUNC = "useradd_sysroot"
+SYSROOTFUNC_virtclass-nativesdk = ""
 
 # Recipe parse-time sanity checks
 def update_useradd_after_parse(d):
Signature · 1 line
1.7.6.4
#14 lore raw

PATCH 2/2 dbus: fix install for virtclass-nativesdk

* 46e6c3fa8034b12d178d605f3f5d7efe69671a13 changed do_install which now fails for nativesdk (chown messagebus leads to no such user)
* tested by building meta-toolchain-qte and running the generated sdk

---
 meta/recipes-core/dbus/dbus.inc |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
meta/recipes-core/dbus/dbus.inc +4 -0
index caa781c..99b2fc7 100644
@@ -105,4 +105,8 @@ do_install_virtclass-native() {
 	# dbus-glib-native and dbus-glib need this xml file
 	./bus/dbus-daemon --introspect > ${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml
 }
+
+do_install_virtclass-nativesdk() {
+	autotools_do_install
+}
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
1.7.6.4
#15 lore raw

Re: [PATCH 2/2] dbus: fix install for virtclass-nativesdk

Quoted 17 lines · Eric Bénard

* 46e6c3fa8034b12d178d605f3f5d7efe69671a13 changed do_install which now fails for nativesdk (chown messagebus leads to no such user)
* tested by building meta-toolchain-qte and running the generated sdk

---
 meta/recipes-core/dbus/dbus.inc |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
meta/recipes-core/dbus/dbus.inc +0 -0
index caa781c..99b2fc7 100644

meta/recipes-core/dbus/dbus.inc do_install_virtclass-native() { · line 112

Quoted 8 lines
meta/recipes-core/dbus/dbus.inc +4 -0
@@ -105,4 +105,8 @@ do_install_virtclass-native() {
 	# dbus-glib-native and dbus-glib need this xml file
 	./bus/dbus-daemon --introspect > ${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml
 }
+
+do_install_virtclass-nativesdk() {
+	autotools_do_install
+}
 BBCLASSEXTEND = "native nativesdk"

I've merged this piece to master, thanks.

Richard

#16 lore raw

Re: [PATCH 1/2] useradd.bbclass: handle nativesdk case

In reply to Eric Bénard
Quoted 29 lines · Eric Bénard

* without this patch, building dbus-nativesdk leads to a missing dependency on 'base-passwd-nativesdk'
This was added by commit 46e6c3fa8034b12d178d605f3f5d7efe69671a13
* this patch handle the nativesdk case in the class useradd
* close bug 1702 http://bugzilla.pokylinux.org/show_bug.cgi?id=1702
* v2 from Scott Garman with Richard Purdie's tricks

---
 meta/classes/useradd.bbclass |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
meta/classes/useradd.bbclass +3 -1
index 0f9b84c..6c933e1 100644
@@ -3,7 +3,9 @@ USERADDPN ?= "${PN}"
 # base-passwd-cross provides the default passwd and group files in the
 # target sysroot, and shadow -native and -sysroot provide the utilities
 # and support files needed to add and modify user and group accounts
-DEPENDS_append = " base-passwd shadow-native shadow-sysroot"
+DEPENDS_append = "${USERADDDEPENDS}"
+USERADDDEPENDS = " base-passwd shadow-native shadow-sysroot"
+USERADDDEPENDS_virtclass-nativesdk = ""
 
 # This preinstall function will be run in two contexts: once for the
 # native sysroot (as invoked by the useradd_sysroot() wrapper), and

meta/classes/useradd.bbclass useradd_sysroot_sstate () { · line 102

Quoted 8 lines
meta/classes/useradd.bbclass +3 -2
@@ -95,8 +97,9 @@ useradd_sysroot_sstate () {
 	fi
 }
 
-do_install[prefuncs] += "useradd_sysroot"
-SSTATEPOSTINSTFUNCS += "useradd_sysroot_sstate"
+do_install[prefuncs] += "${SYSROOTFUNC}"
+SYSROOTFUNC = "useradd_sysroot"
+SYSROOTFUNC_virtclass-nativesdk = ""

Nearly but you're missing a:

SSTATEPOSTINSTFUNCS += "${SYSROOTPOSTFUNC}"
SYSROOTPOSTFUNC = "useradd_sysroot_sstate"
SYSROOTPOSTFUNC_virtclass-nativesdk = ""

Cheers,

Richard

#17 lore raw

PATCH 1/1 useradd.bbclass: handle nativesdk case

* without this patch, building dbus-nativesdk leads to a missing dependency on 'base-passwd-nativesdk'
This was added by commit 46e6c3fa8034b12d178d605f3f5d7efe69671a13
* this patch handle the nativesdk case in the class useradd
* close bug 1702 http://bugzilla.pokylinux.org/show_bug.cgi?id=1702
* v2 from Scott Garman with Richard Purdie's tricks

---
 meta/classes/useradd.bbclass |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
meta/classes/useradd.bbclass +9 -3
index 0f9b84c..a8a1c14 100644
@@ -3,7 +3,9 @@ USERADDPN ?= "${PN}"
 # base-passwd-cross provides the default passwd and group files in the
 # target sysroot, and shadow -native and -sysroot provide the utilities
 # and support files needed to add and modify user and group accounts
-DEPENDS_append = " base-passwd shadow-native shadow-sysroot"
+DEPENDS_append = "${USERADDDEPENDS}"
+USERADDDEPENDS = " base-passwd shadow-native shadow-sysroot"
+USERADDDEPENDS_virtclass-nativesdk = ""
 
 # This preinstall function will be run in two contexts: once for the
 # native sysroot (as invoked by the useradd_sysroot() wrapper), and
@@ -95,8 +97,12 @@ useradd_sysroot_sstate () {
 	fi
 }
 
-do_install[prefuncs] += "useradd_sysroot"
-SSTATEPOSTINSTFUNCS += "useradd_sysroot_sstate"
+do_install[prefuncs] += "${SYSROOTFUNC}"
+SYSROOTFUNC = "useradd_sysroot"
+SYSROOTFUNC_virtclass-nativesdk = ""
+SSTATEPOSTINSTFUNCS += "${SYSROOTPOSTFUNC}"
+SYSROOTPOSTFUNC = "useradd_sysroot_sstate"
+SYSROOTPOSTFUNC_virtclass-nativesdk = ""
 
 # Recipe parse-time sanity checks
 def update_useradd_after_parse(d):
Signature · 1 line
1.7.6.4
#18 lore raw

Re: [PATCH] useradd.bbclass: handle nativesdk case

Quoted 7 lines · Eric Bénard

* without this patch, building dbus-nativesdk leads to a missing dependency on 'base-passwd-nativesdk'
This was added by commit 46e6c3fa8034b12d178d605f3f5d7efe69671a13
* this patch handle the nativesdk case in the class useradd
* close bug 1702 http://bugzilla.pokylinux.org/show_bug.cgi?id=1702
* v2 from Scott Garman with Richard Purdie's tricks

Quoted 5 lines
---
 meta/classes/useradd.bbclass |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

Merged to master, thanks.

Richard

#19 lore raw

Re: [PATCH 1/2] useradd.bbclass: handle nativesdk case

In reply to Scott Garman

Hi Scott,

Quoted 6 lines · Scott Garman

Sorry to throw more churn into this, but can I ask you to submit a new pull request for this?

In discussions with Richard today, he pointed out a few tricks that would improve the patchset:

Quoted 8 lines

DEPENDS_append = "${USERADDDEPENDS}" USERADDDEPENDS = " base-passwd shadow-native shadow-sysroot" USERADDDEPENDS_virtclass-nativesdk = ""

do_install[prefuncs] += "${SYSROOTFUNC}"
SYSROOTFUNC = "useradd_sysroot"
SYSROOTFUNC_virtclass-nativesdk = ""

that's clean it removes all the python code and ... that works !

Quoted 3 lines

I didn't want to take away credit for your patch, so if you'd be willing to make these changes and respin your patch set, we'll take that.

well now you have written v2 of the patch so you also get the credits but the most important thing beyond the credits is to have this bug fixed ;-)

Quoted 6 lines

The second thing is to avoid merge conflicts, can you rebase you patchset on top of this branch:

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=sgarman/useradd-rdepends-final

I just applied this patch and resent the 2 others on top of this one.

Thanks,
Eric