Patchwork bitbake.conf/image.bbclass: Ensure images use the correct passwd/group files

login
register
mail settings
Submitter Richard Purdie
Date Dec. 7, 2011, 5:34 p.m.
Message ID <1323279247.30601.51.camel@ted>
Download mbox | patch
Permalink /patch/16401/
State Accepted
Commit c4da803ef78322b758380eb0af0dcb73cae6553c
Headers show

Comments

Richard Purdie - Dec. 7, 2011, 5:34 p.m.
We need pseudo to use the rootfs passwd/group files belonging to the
rootfs when building images. This patch ensures that we use the rootfs
files instead of those in the sysroot which can lead to incorrect file
ownership issues.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Martin Jansa - Dec. 7, 2011, 5:39 p.m.
On Wed, Dec 07, 2011 at 05:34:07PM +0000, Richard Purdie wrote:
> We need pseudo to use the rootfs passwd/group files belonging to the
> rootfs when building images. This patch ensures that we use the rootfs
> files instead of those in the sysroot which can lead to incorrect file
> ownership issues.
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Acked-by: Martin Jansa <Martin.Jansa@gmail.com>
 
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 4642fa6..865d430 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -121,6 +121,8 @@ IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
>  
>  LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IMAGE_LINGUAS', 1).split()))}"
>  
> +PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
> +
>  do_rootfs[nostamp] = "1"
>  do_rootfs[dirs] = "${TOPDIR}"
>  do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index e80cc32..eeb1fc4 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -580,11 +580,12 @@ SRC_URI = "file://${FILE}"
>  
>  # Use pseudo as the fakeroot implementation
>  PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
> +PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}"
>  export PSEUDO_DISABLED = "1"
>  #export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
>  #export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
>  #export PSEUDO_LIBDIR = "${STAGING_DIR_NATIVE}$PSEUDOBINDIR/../lib/pseudo/lib
> -FAKEROOTENV = "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_PASSWD=${STAGING_DIR_TARGET} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
> +FAKEROOTENV = "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
>  FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
>  FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
>  PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Andreas Müller - Dec. 7, 2011, 11:53 p.m.
On Wednesday, December 07, 2011 06:34:07 PM Richard Purdie wrote:
> We need pseudo to use the rootfs passwd/group files belonging to the
> rootfs when building images. This patch ensures that we use the rootfs
> files instead of those in the sysroot which can lead to incorrect file
> ownership issues.
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> 
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 4642fa6..865d430 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -121,6 +121,8 @@ IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
> 
>  LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s,
> d.getVar('IMAGE_LINGUAS', 1).split()))}"
> 
> +PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
> +
>  do_rootfs[nostamp] = "1"
>  do_rootfs[dirs] = "${TOPDIR}"
>  do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index e80cc32..eeb1fc4 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -580,11 +580,12 @@ SRC_URI = "file://${FILE}"
> 
>  # Use pseudo as the fakeroot implementation
>  PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
> +PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}"
>  export PSEUDO_DISABLED = "1"
>  #export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
>  #export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
>  #export PSEUDO_LIBDIR =
> "${STAGING_DIR_NATIVE}$PSEUDOBINDIR/../lib/pseudo/lib -FAKEROOTENV =
> "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
> PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
> PSEUDO_PASSWD=${STAGING_DIR_TARGET} PSEUDO_NOSYMLINKEXP=1
> PSEUDO_DISABLED=0" +FAKEROOTENV =
> "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
> PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
> PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
> FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
>  FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
>  PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
dbus still needs manual call of 

	chown messagebus:messagebus /var/run/dbus /var/lib/dbus

( it is root:root on my image) and

	chown root:messagebus /usr/libexec/dbus-daemon-launch-helper

( it is avahi:netdev on my image )

Does this one fix it?
To test: Is it enough to rebuild dbus?

Andreas
Richard Purdie - Dec. 8, 2011, 12:01 a.m.
On Thu, 2011-12-08 at 00:53 +0100, Andreas Müller wrote:
> On Wednesday, December 07, 2011 06:34:07 PM Richard Purdie wrote:
> > We need pseudo to use the rootfs passwd/group files belonging to the
> > rootfs when building images. This patch ensures that we use the rootfs
> > files instead of those in the sysroot which can lead to incorrect file
> > ownership issues.
> > 
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > 
> > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> > index 4642fa6..865d430 100644
> > --- a/meta/classes/image.bbclass
> > +++ b/meta/classes/image.bbclass
> > @@ -121,6 +121,8 @@ IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
> > 
> >  LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s,
> > d.getVar('IMAGE_LINGUAS', 1).split()))}"
> > 
> > +PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
> > +
> >  do_rootfs[nostamp] = "1"
> >  do_rootfs[dirs] = "${TOPDIR}"
> >  do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index e80cc32..eeb1fc4 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -580,11 +580,12 @@ SRC_URI = "file://${FILE}"
> > 
> >  # Use pseudo as the fakeroot implementation
> >  PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
> > +PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}"
> >  export PSEUDO_DISABLED = "1"
> >  #export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
> >  #export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
> >  #export PSEUDO_LIBDIR =
> > "${STAGING_DIR_NATIVE}$PSEUDOBINDIR/../lib/pseudo/lib -FAKEROOTENV =
> > "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
> > PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
> > PSEUDO_PASSWD=${STAGING_DIR_TARGET} PSEUDO_NOSYMLINKEXP=1
> > PSEUDO_DISABLED=0" +FAKEROOTENV =
> > "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
> > PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
> > PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
> > FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
> >  FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
> >  PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
> dbus still needs manual call of 
> 
> 	chown messagebus:messagebus /var/run/dbus /var/lib/dbus
> 
> ( it is root:root on my image) and
> 
> 	chown root:messagebus /usr/libexec/dbus-daemon-launch-helper
> 
> ( it is avahi:netdev on my image )
> 
> Does this one fix it?
> To test: Is it enough to rebuild dbus?

It could well do. You just need to apply the patch and rebuild the
image.

Cheers,

Richard
Andreas Müller - Dec. 8, 2011, 1:23 a.m.
On Thursday, December 08, 2011 01:01:48 AM Richard Purdie wrote:
> > dbus still needs manual call of
> > 
> > 	chown messagebus:messagebus /var/run/dbus /var/lib/dbus
> > 
> > ( it is root:root on my image) and
> > 
> > 	chown root:messagebus /usr/libexec/dbus-daemon-launch-helper
> > 
> > ( it is avahi:netdev on my image )
> > 
> > Does this one fix it?
> > To test: Is it enough to rebuild dbus?
> 
> It could well do. You just need to apply the patch and rebuild the
> image.
> 
I've tested the patch and seems not to fix dbus issues:

/var/run/dbus -> root:root
/var/lib/dbus -> 70:netdev
/usr/libexec/dbus-daemon-launch-helper -> root:netdev

Andreas
Martin Jansa - Dec. 8, 2011, 7:05 a.m.
On Thu, Dec 08, 2011 at 12:53:11AM +0100, Andreas Müller wrote:
> On Wednesday, December 07, 2011 06:34:07 PM Richard Purdie wrote:
> > We need pseudo to use the rootfs passwd/group files belonging to the
> > rootfs when building images. This patch ensures that we use the rootfs
> > files instead of those in the sysroot which can lead to incorrect file
> > ownership issues.
> > 
> > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> > 
> > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> > index 4642fa6..865d430 100644
> > --- a/meta/classes/image.bbclass
> > +++ b/meta/classes/image.bbclass
> > @@ -121,6 +121,8 @@ IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
> > 
> >  LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s,
> > d.getVar('IMAGE_LINGUAS', 1).split()))}"
> > 
> > +PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
> > +
> >  do_rootfs[nostamp] = "1"
> >  do_rootfs[dirs] = "${TOPDIR}"
> >  do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index e80cc32..eeb1fc4 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -580,11 +580,12 @@ SRC_URI = "file://${FILE}"
> > 
> >  # Use pseudo as the fakeroot implementation
> >  PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
> > +PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}"
> >  export PSEUDO_DISABLED = "1"
> >  #export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
> >  #export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
> >  #export PSEUDO_LIBDIR =
> > "${STAGING_DIR_NATIVE}$PSEUDOBINDIR/../lib/pseudo/lib -FAKEROOTENV =
> > "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
> > PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
> > PSEUDO_PASSWD=${STAGING_DIR_TARGET} PSEUDO_NOSYMLINKEXP=1
> > PSEUDO_DISABLED=0" +FAKEROOTENV =
> > "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
> > PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
> > PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
> > FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
> >  FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
> >  PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
> dbus still needs manual call of 
> 
> 	chown messagebus:messagebus /var/run/dbus /var/lib/dbus
> 
> ( it is root:root on my image) and
> 
> 	chown root:messagebus /usr/libexec/dbus-daemon-launch-helper
> 
> ( it is avahi:netdev on my image )
> 
> Does this one fix it?

It did for me, see:
http://bugzilla.pokylinux.org/show_bug.cgi?id=1711

> To test: Is it enough to rebuild dbus?

I had right owners in dbus package, wrong only in rootfs, so your issue
could be different.

Regards,
Mark Hatle - Dec. 8, 2011, 3:40 p.m.
On 12/8/11 1:05 AM, Martin Jansa wrote:
> On Thu, Dec 08, 2011 at 12:53:11AM +0100, Andreas Müller wrote:
>> On Wednesday, December 07, 2011 06:34:07 PM Richard Purdie wrote:
>>> We need pseudo to use the rootfs passwd/group files belonging to the
>>> rootfs when building images. This patch ensures that we use the rootfs
>>> files instead of those in the sysroot which can lead to incorrect file
>>> ownership issues.
>>>
>>> Signed-off-by: Richard Purdie<richard.purdie@linuxfoundation.org>
>>>
>>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>>> index 4642fa6..865d430 100644
>>> --- a/meta/classes/image.bbclass
>>> +++ b/meta/classes/image.bbclass
>>> @@ -121,6 +121,8 @@ IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
>>>
>>>   LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s,
>>> d.getVar('IMAGE_LINGUAS', 1).split()))}"
>>>
>>> +PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
>>> +
>>>   do_rootfs[nostamp] = "1"
>>>   do_rootfs[dirs] = "${TOPDIR}"
>>>   do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
>>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>>> index e80cc32..eeb1fc4 100644
>>> --- a/meta/conf/bitbake.conf
>>> +++ b/meta/conf/bitbake.conf
>>> @@ -580,11 +580,12 @@ SRC_URI = "file://${FILE}"
>>>
>>>   # Use pseudo as the fakeroot implementation
>>>   PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
>>> +PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}"
>>>   export PSEUDO_DISABLED = "1"
>>>   #export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
>>>   #export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
>>>   #export PSEUDO_LIBDIR =
>>> "${STAGING_DIR_NATIVE}$PSEUDOBINDIR/../lib/pseudo/lib -FAKEROOTENV =
>>> "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
>>> PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
>>> PSEUDO_PASSWD=${STAGING_DIR_TARGET} PSEUDO_NOSYMLINKEXP=1
>>> PSEUDO_DISABLED=0" +FAKEROOTENV =
>>> "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
>>> PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
>>> PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
>>> FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
>>>   FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
>>>   PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
>> dbus still needs manual call of
>>
>> 	chown messagebus:messagebus /var/run/dbus /var/lib/dbus
>>
>> ( it is root:root on my image) and
>>
>> 	chown root:messagebus /usr/libexec/dbus-daemon-launch-helper
>>
>> ( it is avahi:netdev on my image )
>>
>> Does this one fix it?
>
> It did for me, see:
> http://bugzilla.pokylinux.org/show_bug.cgi?id=1711
>
>> To test: Is it enough to rebuild dbus?
>
> I had right owners in dbus package, wrong only in rootfs, so your issue
> could be different.

Andreas: What packaging type are you using?

I know that RPM never uses the uid/gid, it always does a look up.  If the look 
up fails it then falls back to "root".  So you should never see something like a 
70, unless there is a manual chown/grp somewhere making the change.

opkg had a bug before where it only used the uid/gid number, I know Richard 
patched that -- but I'm not sure what happens if the look up fails.  It may fall 
back to the embedded numeric ids.  If that is the case, the real issue may 
simply be that the uname/gname hasn't yet made it into the passwd/group files.

If you are using opkg, try switching to RPM and see if the behavior on these 
files changes, if it does what the new value is.

--Mark

> Regards,
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Andreas Müller - Dec. 8, 2011, 11:21 p.m.
On Thursday, December 08, 2011 04:40:38 PM Mark Hatle wrote:
> Andreas: What packaging type are you using?
> 
> I know that RPM never uses the uid/gid, it always does a look up.  If the
> look up fails it then falls back to "root".  So you should never see
> something like a 70, unless there is a manual chown/grp somewhere making
> the change.
> 
> opkg had a bug before where it only used the uid/gid number, I know Richard
> patched that -- but I'm not sure what happens if the look up fails.  It may
> fall back to the embedded numeric ids.  If that is the case, the real
> issue may simply be that the uname/gname hasn't yet made it into the
> passwd/group files.
> 
> If you are using opkg, try switching to RPM and see if the behavior on
> these files changes, if it does what the new value is.
I am using opkg - will try RPM when I have time next week.

Andreas
Koen Kooi - Dec. 9, 2011, 1:44 p.m.
Op 8 dec. 2011, om 08:05 heeft Martin Jansa het volgende geschreven:

> On Thu, Dec 08, 2011 at 12:53:11AM +0100, Andreas Müller wrote:
>> On Wednesday, December 07, 2011 06:34:07 PM Richard Purdie wrote:
>>> We need pseudo to use the rootfs passwd/group files belonging to the
>>> rootfs when building images. This patch ensures that we use the rootfs
>>> files instead of those in the sysroot which can lead to incorrect file
>>> ownership issues.
>>> 
>>> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>>> 
>>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>>> index 4642fa6..865d430 100644
>>> --- a/meta/classes/image.bbclass
>>> +++ b/meta/classes/image.bbclass
>>> @@ -121,6 +121,8 @@ IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
>>> 
>>> LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s,
>>> d.getVar('IMAGE_LINGUAS', 1).split()))}"
>>> 
>>> +PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
>>> +
>>> do_rootfs[nostamp] = "1"
>>> do_rootfs[dirs] = "${TOPDIR}"
>>> do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
>>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>>> index e80cc32..eeb1fc4 100644
>>> --- a/meta/conf/bitbake.conf
>>> +++ b/meta/conf/bitbake.conf
>>> @@ -580,11 +580,12 @@ SRC_URI = "file://${FILE}"
>>> 
>>> # Use pseudo as the fakeroot implementation
>>> PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
>>> +PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}"
>>> export PSEUDO_DISABLED = "1"
>>> #export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
>>> #export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
>>> #export PSEUDO_LIBDIR =
>>> "${STAGING_DIR_NATIVE}$PSEUDOBINDIR/../lib/pseudo/lib -FAKEROOTENV =
>>> "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
>>> PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
>>> PSEUDO_PASSWD=${STAGING_DIR_TARGET} PSEUDO_NOSYMLINKEXP=1
>>> PSEUDO_DISABLED=0" +FAKEROOTENV =
>>> "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
>>> PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
>>> PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
>>> FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
>>> FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
>>> PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
>> dbus still needs manual call of 
>> 
>> 	chown messagebus:messagebus /var/run/dbus /var/lib/dbus
>> 
>> ( it is root:root on my image) and
>> 
>> 	chown root:messagebus /usr/libexec/dbus-daemon-launch-helper
>> 
>> ( it is avahi:netdev on my image )
>> 
>> Does this one fix it?
> 
> It did for me, see:
> http://bugzilla.pokylinux.org/show_bug.cgi?id=1711
> 
>> To test: Is it enough to rebuild dbus?
> 
> I had right owners in dbus package, wrong only in rootfs, so your issue
> could be different.

I've also started seeing this issue recently, I wonder if it's due to switching MACHINEs and sstate invalidation.

regards,

Koen
Richard Purdie - Dec. 9, 2011, 3:05 p.m.
On Fri, 2011-12-09 at 14:44 +0100, Koen Kooi wrote:
> Op 8 dec. 2011, om 08:05 heeft Martin Jansa het volgende geschreven:
> 
> > On Thu, Dec 08, 2011 at 12:53:11AM +0100, Andreas Müller wrote:
> >> On Wednesday, December 07, 2011 06:34:07 PM Richard Purdie wrote:
> >>> We need pseudo to use the rootfs passwd/group files belonging to the
> >>> rootfs when building images. This patch ensures that we use the rootfs
> >>> files instead of those in the sysroot which can lead to incorrect file
> >>> ownership issues.
> >>> 
> >>> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> >>> 
> >>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> >>> index 4642fa6..865d430 100644
> >>> --- a/meta/classes/image.bbclass
> >>> +++ b/meta/classes/image.bbclass
> >>> @@ -121,6 +121,8 @@ IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
> >>> 
> >>> LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s,
> >>> d.getVar('IMAGE_LINGUAS', 1).split()))}"
> >>> 
> >>> +PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
> >>> +
> >>> do_rootfs[nostamp] = "1"
> >>> do_rootfs[dirs] = "${TOPDIR}"
> >>> do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
> >>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> >>> index e80cc32..eeb1fc4 100644
> >>> --- a/meta/conf/bitbake.conf
> >>> +++ b/meta/conf/bitbake.conf
> >>> @@ -580,11 +580,12 @@ SRC_URI = "file://${FILE}"
> >>> 
> >>> # Use pseudo as the fakeroot implementation
> >>> PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
> >>> +PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}"
> >>> export PSEUDO_DISABLED = "1"
> >>> #export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
> >>> #export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
> >>> #export PSEUDO_LIBDIR =
> >>> "${STAGING_DIR_NATIVE}$PSEUDOBINDIR/../lib/pseudo/lib -FAKEROOTENV =
> >>> "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
> >>> PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
> >>> PSEUDO_PASSWD=${STAGING_DIR_TARGET} PSEUDO_NOSYMLINKEXP=1
> >>> PSEUDO_DISABLED=0" +FAKEROOTENV =
> >>> "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
> >>> PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
> >>> PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
> >>> FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
> >>> FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
> >>> PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
> >> dbus still needs manual call of 
> >> 
> >> 	chown messagebus:messagebus /var/run/dbus /var/lib/dbus
> >> 
> >> ( it is root:root on my image) and
> >> 
> >> 	chown root:messagebus /usr/libexec/dbus-daemon-launch-helper
> >> 
> >> ( it is avahi:netdev on my image )
> >> 
> >> Does this one fix it?
> > 
> > It did for me, see:
> > http://bugzilla.pokylinux.org/show_bug.cgi?id=1711
> > 
> >> To test: Is it enough to rebuild dbus?
> > 
> > I had right owners in dbus package, wrong only in rootfs, so your issue
> > could be different.
> 
> I've also started seeing this issue recently, I wonder if it's due to switching MACHINEs and sstate invalidation.

Has it continued since the above patch was merged or not?

What we really need at this point is a clear reproducer for the bug.

Cheers,

Richard
Koen Kooi - Dec. 9, 2011, 3:10 p.m.
Op 9 dec. 2011, om 16:05 heeft Richard Purdie het volgende geschreven:

> On Fri, 2011-12-09 at 14:44 +0100, Koen Kooi wrote:
>> Op 8 dec. 2011, om 08:05 heeft Martin Jansa het volgende geschreven:
>> 
>>> On Thu, Dec 08, 2011 at 12:53:11AM +0100, Andreas Müller wrote:
>>>> On Wednesday, December 07, 2011 06:34:07 PM Richard Purdie wrote:
>>>>> We need pseudo to use the rootfs passwd/group files belonging to the
>>>>> rootfs when building images. This patch ensures that we use the rootfs
>>>>> files instead of those in the sysroot which can lead to incorrect file
>>>>> ownership issues.
>>>>> 
>>>>> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>>>>> 
>>>>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>>>>> index 4642fa6..865d430 100644
>>>>> --- a/meta/classes/image.bbclass
>>>>> +++ b/meta/classes/image.bbclass
>>>>> @@ -121,6 +121,8 @@ IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
>>>>> 
>>>>> LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s,
>>>>> d.getVar('IMAGE_LINGUAS', 1).split()))}"
>>>>> 
>>>>> +PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
>>>>> +
>>>>> do_rootfs[nostamp] = "1"
>>>>> do_rootfs[dirs] = "${TOPDIR}"
>>>>> do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
>>>>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>>>>> index e80cc32..eeb1fc4 100644
>>>>> --- a/meta/conf/bitbake.conf
>>>>> +++ b/meta/conf/bitbake.conf
>>>>> @@ -580,11 +580,12 @@ SRC_URI = "file://${FILE}"
>>>>> 
>>>>> # Use pseudo as the fakeroot implementation
>>>>> PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
>>>>> +PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}"
>>>>> export PSEUDO_DISABLED = "1"
>>>>> #export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
>>>>> #export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
>>>>> #export PSEUDO_LIBDIR =
>>>>> "${STAGING_DIR_NATIVE}$PSEUDOBINDIR/../lib/pseudo/lib -FAKEROOTENV =
>>>>> "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
>>>>> PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
>>>>> PSEUDO_PASSWD=${STAGING_DIR_TARGET} PSEUDO_NOSYMLINKEXP=1
>>>>> PSEUDO_DISABLED=0" +FAKEROOTENV =
>>>>> "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
>>>>> PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
>>>>> PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
>>>>> FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
>>>>> FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
>>>>> PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
>>>> dbus still needs manual call of 
>>>> 
>>>> 	chown messagebus:messagebus /var/run/dbus /var/lib/dbus
>>>> 
>>>> ( it is root:root on my image) and
>>>> 
>>>> 	chown root:messagebus /usr/libexec/dbus-daemon-launch-helper
>>>> 
>>>> ( it is avahi:netdev on my image )
>>>> 
>>>> Does this one fix it?
>>> 
>>> It did for me, see:
>>> http://bugzilla.pokylinux.org/show_bug.cgi?id=1711
>>> 
>>>> To test: Is it enough to rebuild dbus?
>>> 
>>> I had right owners in dbus package, wrong only in rootfs, so your issue
>>> could be different.
>> 
>> I've also started seeing this issue recently, I wonder if it's due to switching MACHINEs and sstate invalidation.
> 
> Has it continued since the above patch was merged or not?
> 
> What we really need at this point is a clear reproducer for the bug.

I'm seeing it in a filesystem I built yesterday from an incremental build:

commit 493746f1d7f1410284880203c1ac462d61ab5299
Author: Martin Jansa <martin.jansa@gmail.com>
Date:   Tue Dec 6 09:35:21 2011 +0100


regards,

Koen
Andreas Müller - Dec. 10, 2011, 12:41 a.m.
On Friday, December 09, 2011 04:10:36 PM Koen Kooi wrote:
> Op 9 dec. 2011, om 16:05 heeft Richard Purdie het volgende geschreven:
> > On Fri, 2011-12-09 at 14:44 +0100, Koen Kooi wrote:
> >> Op 8 dec. 2011, om 08:05 heeft Martin Jansa het volgende geschreven:
> >>> On Thu, Dec 08, 2011 at 12:53:11AM +0100, Andreas Müller wrote:
> >>>> On Wednesday, December 07, 2011 06:34:07 PM Richard Purdie wrote:
> >>>>> We need pseudo to use the rootfs passwd/group files belonging to the
> >>>>> rootfs when building images. This patch ensures that we use the
> >>>>> rootfs files instead of those in the sysroot which can lead to
> >>>>> incorrect file ownership issues.
> >>>>> 
> >>>>> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> >>>>> 
> >>>>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> >>>>> index 4642fa6..865d430 100644
> >>>>> --- a/meta/classes/image.bbclass
> >>>>> +++ b/meta/classes/image.bbclass
> >>>>> @@ -121,6 +121,8 @@ IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
> >>>>> 
> >>>>> LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s,
> >>>>> d.getVar('IMAGE_LINGUAS', 1).split()))}"
> >>>>> 
> >>>>> +PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
> >>>>> +
> >>>>> do_rootfs[nostamp] = "1"
> >>>>> do_rootfs[dirs] = "${TOPDIR}"
> >>>>> do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
> >>>>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> >>>>> index e80cc32..eeb1fc4 100644
> >>>>> --- a/meta/conf/bitbake.conf
> >>>>> +++ b/meta/conf/bitbake.conf
> >>>>> @@ -580,11 +580,12 @@ SRC_URI = "file://${FILE}"
> >>>>> 
> >>>>> # Use pseudo as the fakeroot implementation
> >>>>> PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
> >>>>> +PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}"
> >>>>> export PSEUDO_DISABLED = "1"
> >>>>> #export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
> >>>>> #export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
> >>>>> #export PSEUDO_LIBDIR =
> >>>>> "${STAGING_DIR_NATIVE}$PSEUDOBINDIR/../lib/pseudo/lib -FAKEROOTENV =
> >>>>> "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
> >>>>> PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
> >>>>> PSEUDO_PASSWD=${STAGING_DIR_TARGET} PSEUDO_NOSYMLINKEXP=1
> >>>>> PSEUDO_DISABLED=0" +FAKEROOTENV =
> >>>>> "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native}
> >>>>> PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR}
> >>>>> PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1
> >>>>> PSEUDO_DISABLED=0" FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
> >>>>> FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
> >>>>> PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
> >>>> 
> >>>> dbus still needs manual call of
> >>>> 
> >>>> 	chown messagebus:messagebus /var/run/dbus /var/lib/dbus
> >>>> 
> >>>> ( it is root:root on my image) and
> >>>> 
> >>>> 	chown root:messagebus /usr/libexec/dbus-daemon-launch-helper
> >>>> 
> >>>> ( it is avahi:netdev on my image )
> >>>> 
> >>>> Does this one fix it?
> >>> 
> >>> It did for me, see:
> >>> http://bugzilla.pokylinux.org/show_bug.cgi?id=1711
> >>> 
> >>>> To test: Is it enough to rebuild dbus?
> >>> 
> >>> I had right owners in dbus package, wrong only in rootfs, so your issue
> >>> could be different.
> >> 
> >> I've also started seeing this issue recently, I wonder if it's due to
> >> switching MACHINEs and sstate invalidation.
> > 
> > Has it continued since the above patch was merged or not?
> > 
> > What we really need at this point is a clear reproducer for the bug.
For me the dbus bug is stable since Otavio's patch which moved all chown stuff 
from pkg_postinst to do_install [1]
> 
> I'm seeing it in a filesystem I built yesterday from an incremental build:
> 
> commit 493746f1d7f1410284880203c1ac462d61ab5299
> Author: Martin Jansa <martin.jansa@gmail.com>
> Date:   Tue Dec 6 09:35:21 2011 +0100
> 
In passwd/groups I have:

root@overo:~# cat /etc/passwd
...
avahi:x:999:999::/var/run/avahi-daemon:/bin/false
messagebus:x:998:997::/var/lib/dbus:/bin/false

root@overo:~# cat /etc/group
...
avahi:x:999:
netdev:x:998:
messagebus:x:997:
lock:x:996:

for messagebus group I see guid 997 and uuid 998 AND netdev uuid is 998!

After testing the patch - we are currently talking of - I have: 

/var/run/dbus -> root:root
/var/lib/dbus -> 70:netdev
/usr/libexec/dbus-daemon-launch-helper -> root:netdev

and I swear before the patch I saw one of these files with owner avahi!

Is there some mechanism, enusring useradd/groupadd stuff working properly for 
multiple threads adding users/groups at the same time?

Andreas

[1] http://cgit.openembedded.org/openembedded-
core/commit/?id=46e6c3fa8034b12d178d605f3f5d7efe69671a13

Patch

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 4642fa6..865d430 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -121,6 +121,8 @@  IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
 
 LINGUAS_INSTALL = "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IMAGE_LINGUAS', 1).split()))}"
 
+PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
+
 do_rootfs[nostamp] = "1"
 do_rootfs[dirs] = "${TOPDIR}"
 do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index e80cc32..eeb1fc4 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -580,11 +580,12 @@  SRC_URI = "file://${FILE}"
 
 # Use pseudo as the fakeroot implementation
 PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
+PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}"
 export PSEUDO_DISABLED = "1"
 #export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
 #export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
 #export PSEUDO_LIBDIR = "${STAGING_DIR_NATIVE}$PSEUDOBINDIR/../lib/pseudo/lib
-FAKEROOTENV = "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_PASSWD=${STAGING_DIR_TARGET} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
+FAKEROOTENV = "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
 FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
 FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
 PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"