Skip to contentSkip to conversation

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

PATCH In review Richard Purdie 5 participants 12 messages Dec 7, 2011 – Dec 10, 2011

lore
Share & tools
lore
#0 lore raw

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

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.

meta/classes/image.bbclass +2 -0
index 4642fa6..865d430 100644
@@ -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"
meta/conf/bitbake.conf +2 -1
index e80cc32..eeb1fc4 100644
@@ -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"
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Richard Purdie

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.

Quoted 37 lines
meta/classes/image.bbclass +2 -0
index 4642fa6..865d430 100644
@@ -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"
meta/conf/bitbake.conf +2 -1
index e80cc32..eeb1fc4 100644
@@ -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
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#2 lore raw
In reply to Richard Purdie
Quoted 37 lines · Richard Purdie

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.

meta/classes/image.bbclass +0 -0
index 4642fa6..865d430 100644
@@ -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()))}"

meta/classes/image.bbclass +2 -0
+PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
+
 do_rootfs[nostamp] = "1"
 do_rootfs[dirs] = "${TOPDIR}"
 do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
meta/conf/bitbake.conf +1 -0
index e80cc32..eeb1fc4 100644
@@ -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}

Quoted 8 lines

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

#3 lore raw
Quoted 50 lines · Andreas Müller
Quoted 37 lines · Richard Purdie

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.

meta/classes/image.bbclass +0 -0
index 4642fa6..865d430 100644
@@ -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()))}"

meta/classes/image.bbclass +2 -0
+PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
+
 do_rootfs[nostamp] = "1"
 do_rootfs[dirs] = "${TOPDIR}"
 do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
meta/conf/bitbake.conf +1 -0
index e80cc32..eeb1fc4 100644
@@ -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}

Quoted 8 lines

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

Quoted 8 lines

( 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

#4 lore raw
Quoted 8 lines · Richard Purdie
Quoted 8 lines

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

Quoted 8 lines
Quoted 4 lines

( 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

#5 lore raw
In reply to Andreas Müller
Quoted 50 lines · Andreas Müller
Quoted 37 lines · Richard Purdie

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.

meta/classes/image.bbclass +0 -0
index 4642fa6..865d430 100644
@@ -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()))}"

meta/classes/image.bbclass +2 -0
+PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
+
 do_rootfs[nostamp] = "1"
 do_rootfs[dirs] = "${TOPDIR}"
 do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
meta/conf/bitbake.conf +1 -0
index e80cc32..eeb1fc4 100644
@@ -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}

Quoted 8 lines

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

Quoted 7 lines

( 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

Quoted 1 line

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,

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#6 lore raw
Quoted 59 lines · Martin Jansa
Quoted 50 lines · Andreas Müller
Quoted 37 lines · Richard Purdie

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.

meta/classes/image.bbclass +0 -0
index 4642fa6..865d430 100644
@@ -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()))}"

meta/classes/image.bbclass +2 -0
+PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
+
  do_rootfs[nostamp] = "1"
  do_rootfs[dirs] = "${TOPDIR}"
  do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
meta/conf/bitbake.conf +1 -0
index e80cc32..eeb1fc4 100644
@@ -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}

Quoted 8 lines

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

Quoted 7 lines

( 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?

Quoted 7 lines

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

Quoted 1 line

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

Quoted 8 lines

Regards,

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

#7 lore raw
Quoted 7 lines · Mark Hatle

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.

Quoted 8 lines

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

#8 lore raw
In reply to Martin Jansa

Op 8 dec. 2011, om 08:05 heeft Martin Jansa het volgende geschreven:

Quoted 59 lines · Andreas Müller
Quoted 50 lines · Richard Purdie
Quoted 37 lines

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.

meta/classes/image.bbclass +0 -0
index 4642fa6..865d430 100644
@@ -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()))}"

meta/classes/image.bbclass +2 -0
+PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
+

do_rootfs[nostamp] = "1"
do_rootfs[dirs] = "${TOPDIR}"
do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"

meta/conf/bitbake.conf +0 -0
index e80cc32..eeb1fc4 100644
@@ -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}

Quoted 8 lines

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

Quoted 7 lines

( 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?

Quoted 7 lines

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

Quoted 1 line

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

#9 lore raw
Quoted 64 lines · Koen Kooi

Op 8 dec. 2011, om 08:05 heeft Martin Jansa het volgende geschreven:

Quoted 62 lines · Andreas Müller
Quoted 50 lines · Richard Purdie
Quoted 37 lines

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.

meta/classes/image.bbclass +0 -0
index 4642fa6..865d430 100644
@@ -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()))}"

meta/classes/image.bbclass +2 -0
+PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
+

do_rootfs[nostamp] = "1"
do_rootfs[dirs] = "${TOPDIR}"
do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"

meta/conf/bitbake.conf +0 -0
index e80cc32..eeb1fc4 100644
@@ -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}

Quoted 8 lines

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

Quoted 7 lines

( 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

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

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

#10 lore raw

Op 9 dec. 2011, om 16:05 heeft Richard Purdie het volgende geschreven:

Quoted 67 lines · Koen Kooi
Quoted 66 lines

Op 8 dec. 2011, om 08:05 heeft Martin Jansa het volgende geschreven:

Quoted 64 lines · Andreas Müller
Quoted 50 lines · Richard Purdie
Quoted 37 lines

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.

meta/classes/image.bbclass +0 -0
index 4642fa6..865d430 100644
@@ -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()))}"

meta/classes/image.bbclass +2 -0
+PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
+

do_rootfs[nostamp] = "1"
do_rootfs[dirs] = "${TOPDIR}"
do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"

meta/conf/bitbake.conf +0 -0
index e80cc32..eeb1fc4 100644
@@ -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}

Quoted 8 lines

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

Quoted 7 lines

( 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

Quoted 1 line

To test: Is it enough to rebuild dbus?

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

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 <[email protected]>
Date:   Tue Dec 6 09:35:21 2011 +0100

regards,

Koen

#11 lore raw
Quoted 77 lines · Koen Kooi

Op 9 dec. 2011, om 16:05 heeft Richard Purdie het volgende geschreven:

Quoted 76 lines · Koen Kooi
Quoted 64 lines

Op 8 dec. 2011, om 08:05 heeft Martin Jansa het volgende geschreven:

Quoted 63 lines · Andreas Müller
Quoted 51 lines · Richard Purdie
Quoted 37 lines

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.

meta/classes/image.bbclass +0 -0
index 4642fa6..865d430 100644
@@ -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()))}"

meta/classes/image.bbclass +2 -0
+PSEUDO_PASSWD = "${IMAGE_ROOTFS}"
+

do_rootfs[nostamp] = "1"
do_rootfs[dirs] = "${TOPDIR}"
do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"

meta/conf/bitbake.conf +0 -0
index e80cc32..eeb1fc4 100644
@@ -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}

Quoted 8 lines

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

Quoted 7 lines

( 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

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

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]

Quoted 7 lines

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

commit 493746f1d7f1410284880203c1ac462d61ab5299

Author: Martin Jansa <[email protected]>
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