Adding to torizon minimal with new user

I’m trying to add mosquitto to the torizon-minimal-dev image. mosquitto adds a user and a group and, from this reply, I then need to add to the static user and group list. What would be the recommended way to do this? I can modify directly the torizon-static-passwd/torizon-static-group files, but this doesn’t seem to be maintainable in a team environment. Is there a way to somehow just append to the file from my own layer? Should I just make a copy of the torizon versions of those files and modify them in my own layer?

Greetings @mckay

Is there a way to somehow just append to the file from my own layer? Should I just make a copy of the torizon versions of those files and modify them in my own layer?

I don’t think you can append files like this in Yocto since it’s not a recipe or something similar. As you said you probably just have to copy this in your own meta-layer. Then as long as your layer has a higher priority than meta-toradex-torizon your version of these files should be used in the build.

By the way I see you’re trying to build torizon-minimal-dev. If you don’t mind me asking what is your goal here? Trying to debug something?

Best Regards,
Jeremias

I have, in the past, for similar things, used a patch file with a custom strip-level to patch the file after it has been copied to the workdir. As @jeremias.tx mentioned, it might not work in this case since this is a DISTRO-level setting but maybe it gives you (or someone reading this thread) an idea of an alternate mechanism.

Drew

I took a quick look at the openembedded sources and it does not appear there is an easy way to “append” to this file. It really is just a single file that is defined in the USERADD_UID_TABLES variable. Without a feature change inside openembedded I think the best choice is to just create the modified version in your layer, making sure to keep it in sync with the one from the Torizon layers.

Drew

By the way I see you’re trying to build torizon-minimal-dev. If you don’t mind me asking what is your goal here? Trying to debug something?

Correct. We will be debugging our applications on the hardware so we used the torizon-minimal-dev as our baseline, mainly to get gdbserver support.

Correct. We will be debugging our applications on the hardware so we used the torizon-minimal-dev as our baseline, mainly to get gdbserver support.

That makes sense. Just wanted to make sure you understood what the *-dev image was for.

Best Regards,
Jeremias