diff mbox series

useradd: don't override pseudo environment

Message ID 20170915115848.4939-1-ross.burton@intel.com
State Accepted
Commit 02457ef7f600ce954874e2d11e74b1c6daaa3bfc
Headers show
Series useradd: don't override pseudo environment | expand

Commit Message

Ross Burton Sept. 15, 2017, 11:58 a.m. UTC
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.

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 meta/classes/useradd.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.11.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Comments

Martin Jansa Sept. 15, 2017, 12:04 p.m. UTC | #1
nice

Acked-by: Martin Jansa <Martin.Jansa@gmail.com>


On Fri, Sep 15, 2017 at 1:58 PM, Ross Burton <ross.burton@intel.com> wrote:

> 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.

>

> Signed-off-by: Ross Burton <ross.burton@intel.com>

> ---

>  meta/classes/useradd.bbclass | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass

> index 6017ded8601..0f51e5522b1 100644

> --- a/meta/classes/useradd.bbclass

> +++ b/meta/classes/useradd.bbclass

> @@ -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

> Openembedded-core@lists.openembedded.org

> http://lists.openembedded.org/mailman/listinfo/openembedded-core

>
<div dir="ltr">nice<div><br></div><div>Acked-by: Martin Jansa &lt;<a href="mailto:Martin.Jansa@gmail.com">Martin.Jansa@gmail.com</a>&gt;</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 15, 2017 at 1:58 PM, Ross Burton <span dir="ltr">&lt;<a href="mailto:ross.burton@intel.com" target="_blank">ross.burton@intel.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Back in the dark days before recipe-specific-sysroots the paths being passed in<br>
this manual construction of the pseudo environment made sense, but now they&#39;re<br>
incorrect and result in pseudo writing to two different databases during a<br>
single build.  The result is that pseudo doesn&#39;t follow changes to /etc/passwd<br>
in the sysroot, and warns in the logs.<br>
<br>
Remove the PSEUDO_LOCALSTATEDIR assignment and inherit the correct assignment in<br>
FAKEROOTENV.<br>
<br>
Signed-off-by: Ross Burton &lt;<a href="mailto:ross.burton@intel.com">ross.burton@intel.com</a>&gt;<br>

---<br>
 meta/classes/useradd.bbclass | 2 +-<br>
 1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass<br>
index 6017ded8601..0f51e5522b1 100644<br>
--- a/meta/classes/useradd.bbclass<br>
+++ b/meta/classes/useradd.bbclass<br>
@@ -100,7 +100,7 @@ useradd_sysroot () {<br>
        # Pseudo may (do_prepare_recipe_sysroot) or may not (do_populate_sysroot_setscene) be running<br>
        # at this point so we&#39;re explicit about the environment so pseudo can load if<br>
        # not already present.<br>
-       export PSEUDO=&quot;${FAKEROOTENV} PSEUDO_LOCALSTATEDIR=${<wbr>STAGING_DIR_TARGET}${<wbr>localstatedir}/pseudo ${PSEUDO_SYSROOT}${bindir_<wbr>native}/pseudo&quot;<br>
+       export PSEUDO=&quot;${FAKEROOTENV} ${PSEUDO_SYSROOT}${bindir_<wbr>native}/pseudo&quot;<br>
<br>
        # Explicitly set $D since it isn&#39;t set to anything<br>
        # before do_prepare_recipe_sysroot<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
--<br>
______________________________<wbr>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
</font></span></blockquote></div><br></div>
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Seebs Sept. 15, 2017, 5:58 p.m. UTC | #2
On Fri, 15 Sep 2017 12:58:48 +0100
Ross Burton <ross.burton@intel.com> 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
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Richard Purdie Sept. 15, 2017, 10:55 p.m. UTC | #3
On Fri, 2017-09-15 at 12:58 -0500, Seebs wrote:
> On Fri, 15 Sep 2017 12:58:48 +0100
> Ross Burton <ross.burton@intel.com> 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
diff mbox series

Patch

diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 6017ded8601..0f51e5522b1 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -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