[YOCTO #13419]

If recipeB creates a user and assigns it to a group created in recipeA,
we need to ensure two things:

That recipeA is in recipeB's DEPENDS (documentation issue) and that the
sysroot setscene, in the case of a TMPDIR wipeout, is in
USERADDSETSCENEDEPS.

RP and I discussed adding a USERADD_DEPENDS variable to deal with this,
but there is some magic around DEPENDS that a new variable wouldn't have
so I'm sending this as is for people to poke at.

This commit should also fix issues seen in the following bugs:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=13279
https://bugzilla.yoctoproject.org/show_bug.cgi?id=13904
https://bugzilla.yoctoproject.org/show_bug.cgi?id=15084

Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <[email protected]>
---
 meta/classes/useradd.bbclass | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 4d3bd9a5f56..98c6999a0d2 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -177,6 +177,14 @@ SYSROOT_PREPROCESS_FUNCS += "${SYSROOTFUNC}"
 
 SSTATEPREINSTFUNCS:append:class-target = " useradd_sysroot_sstate"
 
+python __anonymous() {
+    setscenedeps = ""
+    if "-native" not in d.getVar("PN"):
+        for pkg in d.getVar("DEPENDS").split():
+            setscenedeps += " %s:do_populate_sysroot_setscene " % pkg
+        d.setVar("USERADDSETSCENEDEPS", "%s %s" % 
(d.getVar("USERADDSETSCENEDEPS"), setscenedeps))
+}
+
 do_package_setscene[depends] += "${USERADDSETSCENEDEPS}"
 do_populate_sysroot_setscene[depends] += "${USERADDSETSCENEDEPS}"
 USERADDSETSCENEDEPS:class-target = 
"${MLPREFIX}base-passwd:do_populate_sysroot_setscene 
pseudo-native:do_populate_sysroot_setscene 
shadow-native:do_populate_sysroot_setscene 
${MLPREFIX}shadow-sysroot:do_populate_sysroot_setscene"
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#191155): 
https://lists.openembedded.org/g/openembedded-core/message/191155
Mute This Topic: https://lists.openembedded.org/mt/102766836/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to