Hello,

On 08/06/2023 11:19, Richard Purdie wrote:
On Wed, 2023-06-07 at 17:16 +0200, Louis Rannou wrote:
Hello again,

a python solution could be one below.

Also, I found that most of users/groups defined there are redundant as
they already exist (such as root). I guess they are defined from
base-passwd. I am not sure which recipe (base-passwd or systemd) should
have the precedence on this. If it's base-passwd, perhaps this
postcommand should check first if the user does already exist.

I'd say base-passwd should likely be the winner but we should probably
error if there is a conflict between what sysusers.d and base-passwd
are defining.
There will be some conflict. As an example the root home directory in sysusers.d is /root.

Some others users/groups defined in sysusers.d files are already created in recipes with the useradd class (such as systemd-resolved, systemd-network who are defined in the systemd recipe).

In the end, almost all users/groups in sysusers.d/* already exist. Perhaps it's a wrong way to parse this file to add users. In my opinion, we should only parse this file to check users/groups are already created and raise an error if one is missing.

Louis
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#182502): 
https://lists.openembedded.org/g/openembedded-core/message/182502
Mute This Topic: https://lists.openembedded.org/mt/99343510/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to