If you look at tpm2-tss recipe of any version (in my current setup I use tpm2-tss_2.3.2.bb) you can see that extrausers class is used to add tss user and group. This is odd since Yocto reference manual explicitly states: [quote] The user and group operations added using the extrausers class are not tied to a specific recipe outside of the recipe for the image. Thus, the operations can be performed across the image as a whole. Use the useradd class to add user and group configuration to a specific recipe. [/quote] Other recipies in meta-tmp also add users (for instance tpm2-abrmd, swtpm, trousers) and they do it with the help of useradd bbclass. I suspect this is a correct way to add users/groups from within a recipe. For example (tpm2-abrmd recipe): inherit autotools pkgconfig systemd update-rc.d useradd USERADD_PACKAGES = "${PN}" GROUPADD_PARAM_${PN} = "tss" USERADD_PARAM_${PN} = "--system -M -d /var/lib/tpm -s /bin/false -g tss tss" Moreover, you won't find extrausers usages in meta-openembedded and other mainline layers. So I suppose extrausers is designed to be used only on image recipes and not in spicific recipies. Let alone, in the example above the tss user/group is created using useradd class As a side effect, I see that in the built image/filesystem the tss user gets created with uid 1000: bash-5.0# cat /etc/passwd | grep tss tss:x:999:1000::/var/lib/tpm:/bin/false which is not a common practice for system users.
Thanks for letting me know. I will take a look shortly.
in kirkstone. https://git.yoctoproject.org/meta-security/commit/?h=kirkstone&id=da23c2a094b2e1a87da2932552ec96c0f842a639