Skip to contentSkip to conversation

useradd: don't override pseudo environment

PATCH In review Ross Burton 4 participants 4 messages Sep 15, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 useradd: don't override pseudo environment

Back in the dark days before recipe-specific-sysroots the paths being passed in this manual construction of the pseudo environment made sense, but now they're incorrect and result in pseudo writing to two different databases during a single build. The result is that pseudo doesn't follow changes to /etc/passwd in the sysroot, and warns in the logs.

Remove the PSEUDO_LOCALSTATEDIR assignment and inherit the correct assignment in FAKEROOTENV.

---
 meta/classes/useradd.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/useradd.bbclass +1 -1
index 6017ded8601..0f51e5522b1 100644
@@ -100,7 +100,7 @@ useradd_sysroot () {
 	# Pseudo may (do_prepare_recipe_sysroot) or may not (do_populate_sysroot_setscene) be running 
 	# at this point so we're explicit about the environment so pseudo can load if 
 	# not already present.
-	export PSEUDO="${FAKEROOTENV} PSEUDO_LOCALSTATEDIR=${STAGING_DIR_TARGET}${localstatedir}/pseudo ${PSEUDO_SYSROOT}${bindir_native}/pseudo"
+	export PSEUDO="${FAKEROOTENV} ${PSEUDO_SYSROOT}${bindir_native}/pseudo"
 
 	# Explicitly set $D since it isn't set to anything
 	# before do_prepare_recipe_sysroot
Signature · 1 line
2.11.0
Acked-by on v1 1/1
#1 lore raw

nice

Quoted 45 lines · Ross Burton

Back in the dark days before recipe-specific-sysroots the paths being passed in
this manual construction of the pseudo environment made sense, but now they're
incorrect and result in pseudo writing to two different databases during a single build. The result is that pseudo doesn't follow changes to /etc/passwd
in the sysroot, and warns in the logs.

Remove the PSEUDO_LOCALSTATEDIR assignment and inherit the correct assignment in
FAKEROOTENV.

---
 meta/classes/useradd.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/useradd.bbclass +0 -0
index 6017ded8601..0f51e5522b1 100644
@@ -100,7 +100,7 @@ useradd_sysroot () {
        # Pseudo may (do_prepare_recipe_sysroot) or may not

(do_populate_sysroot_setscene) be running

        # at this point so we're explicit about the environment so pseudo
can load if
        # not already present.
-       export PSEUDO="${FAKEROOTENV} PSEUDO_LOCALSTATEDIR=${
STAGING_DIR_TARGET}${localstatedir}/pseudo ${PSEUDO_SYSROOT}${bindir_
native}/pseudo"
+       export PSEUDO="${FAKEROOTENV} ${PSEUDO_SYSROOT}${bindir_
native}/pseudo"

# Explicitly set $D since it isn't set to anything # before do_prepare_recipe_sysroot
--
2.11.0

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

#2 lore raw
In reply to Ross Burton
Quoted 2 lines · On Fri, 15 Sep 2017 12:58:48 +0100 Ross Burton <[email protected]> wrote:

Remove the PSEUDO_LOCALSTATEDIR assignment and inherit the correct assignment in FAKEROOTENV.

Nice catch! This probably explains a LOT of the strange behaviors we've been seeing.

-s

#3 lore raw
Quoted 8 lines · Seebs
Quoted 3 lines · On Fri, 15 Sep 2017 12:58:48 +0100 Ross Burton <[email protected]> wrote:

Remove the PSEUDO_LOCALSTATEDIR assignment and inherit the correct assignment in FAKEROOTENV.

Nice catch! This probably explains a LOT of the strange behaviors we've been seeing.

I think it will fix some warnings but I believe the bulk of the issues are from files being deleted in contents outside of pseudo and then the inode numbers being reused.

Note that this issue existed long before we had recipe specific sysroots.

Unfortunately its very hard to guarantee we'll always delete files under pseudo context as for example "do_clean", "do_recipe_prepare_sysroot" and others are not pseudo tasks but can add/delete files. Files in ${WORKDIR}/temp such as log files and sysroot manifests and locks may be modified by both the fakeroot worker and the parent bitbake server too.

Possible options:

a) Add a way to filter the paths pseudo looks at and cares about.
b) At server startup, check files really do exist
c) Add some way to trigger a sync of the pseudo db with what is on disk.

Cheers,

Richard