[yocto] useradd-staticids: problem with --user-group

Alexander Stein alexander.stein at systec-electronic.com
Mon Jul 1 22:56:15 PDT 2019


Hi,

I need to use useradd-staticids to have fixed UID/GID during update. For that I've set the following in my conf/local.conf:
> USERADD_ERROR_DYNAMIC = "1"
> USERADDEXTENSION = "useradd-staticids"
> USERADD_GID_TABLES = "files/group"
> USERADD_UID_TABLES = "files/passwd"

After deleting TMPDIR and rebuilding I get a build error in dbus package. In the log.do_prepare_recipe_sysroot logfile I have the following lines:
> [...]
> Running groupadd commands...
> NOTE: dbus: Performing groupadd with [--root $TMPDIR/work/cortexa7hf-neon-poky-linux-gnueabi/dbus/1.12.2-r0/recipe-sysroot --force --gid 999 --system netdev]
> NOTE: dbus: group netdev already exists, not re-creating it
> NOTE: dbus: Performing groupadd with [--root $TMPDIR/work/cortexa7hf-neon-poky-linux-gnueabi/dbus/1.12.2-r0/recipe-sysroot  --gid 998 messagebus]
> groupadd: GID '998' already exists

In $TMPDIR/work/cortexa7hf-neon-poky-linux-gnueabi/dbus/1.12.2-r0/recipe-sysroot/etc/group there the following entries:
> [...]
> nogroup:*:65534:
> systemd-journal:x:999:
> systemd-timesync:!:998:
> systemd-network:!:997:
> systemd-resolve:!:996:
> polkitd:!:995:
> systemd-bus-proxy:!:994:
> netdev:x:993:

So, ok. netdev is already there, but due to the --force parameter this is no error. But for adding the user-group using a fixed GID without --force fails as GID 998 is already used for systemd-timesync at this stage.

$ grep systemd-timesync files/group 
systemd-timesync:x:990:

So I wonder how to solve that. Should --force be added to the user-group step too? Or should the wanted GIDs for groups like systemd-timesync also be fixed before adding dbus specific users/groups?

I'm currently using sumo and without using useradd-staticids the build is fine, but the mapping user<->UID/GID might alter.

Best regards,
Alexander





More information about the yocto mailing list