[ To simplify the description I will only use groups as an example, but everything applies to users as well. ] If there is no group file in the etc directory of the sysroot, /etc/group will be used instead. This means that one can succeed in building a recipe where a group is used that exists in /etc/group if no group file is in the sysroot, but the recipe will fail to build later when base-passwd has been installed and the group file in the sysroot does not contain the used group.
How about making such recipe dependent on base-passwd? //Chen Qi
Do you use the useradd.bbclass to modify the user or group files? It has a dependency on base-passwd as Chen Qi suggests. How are you modifing the group file?
Well, for recipes that need to add users and/or groups in addition to what base-passwd provides, useradd.bbclass is appropriate. However, I am talking about recipes that only use the users and groups provided by base-passwd. In Poky, there are only two recipes that depend on base-passwd: sysvinit and shadow-sysroot. Any other recipe that installs files (and that should be just about every single recipe) relies on the fact that the users and groups in /etc are similar enough to the ones provided by bass-passwd, most notably that root exists. That said, this may be more of a theoretical problem as the likelihood of having a host system without a user called "root" is pretty slim...
It would make sense to change that behavior in pseudo, I would be inclined to have pseudo use a small built-in passwd/group set instead of the host system's in that case.
Not sure what more info I am expected to provide...
Duplicated to 6124. *** This bug has been marked as a duplicate of bug 6124 ***