Error while building Torizon 6

I am attempting to build Torizon 6 for the Verdin imx8mp as a precursor to adding my program to the build. I attempted to build from source using the Docker container method without modifying any files by using this command on my Linux machine:
docker run --rm -it --name=crops -v ~/yocto-workdir:/workdir --workdir=/workdir -e MACHINE=verdin-imx8mp -e IMAGE=torizon-minimal torizon/crops:kirkstone-6.x.y startup-tdx.sh

The build produces the following error after some time:

ERROR: torizon-users-1.0-r0 do_prepare_recipe_sysroot: torizon-users: useradd command did not succeed.
ERROR: torizon-users-1.0-r0 do_prepare_recipe_sysroot: ExecutionError('/workdir/build-verdin-imx8mp/tmp/work/cortexa53-tdx-linux/torizon-users/1.0-r0/temp/run.useradd_sysroot.3049031', 1, None, None)
ERROR: Logfile of failure stored in: /workdir/build-verdin-imx8mp/tmp/work/cortexa53-tdx-linux/torizon-users/1.0-r0/temp/log.do_prepare_recipe_sysroot.3049031
ERROR: Task (/workdir/build-verdin-imx8mp/conf/../../layers/meta-toradex-torizon/recipes-core/torizon-users/torizon-users_1.0.bb:do_prepare_recipe_sysroot) failed with exit code '1'
NOTE: Tasks Summary: Attempted 5265 tasks of which 2989 didn't need to be rerun and 1 failed.

Log File Mentioned in error:

 DEBUG: Executing python function do_prepare_recipe_sysroot
DEBUG: Executing python function extend_recipe_sysroot
NOTE: Direct dependencies are ['/workdir/build-verdin-imx8mp/conf/../../layers/openembedded-core/meta/recipes-core/base-files/base-files_3.0.14.bb:do_populate_sysroot', '/workdir/build-verdin-imx8mp/conf>
NOTE: Installed into sysroot: ['base-files', 'base-passwd', 'shadow-sysroot', 'shadow', 'pseudo-native', 'shadow-native', 'libxcrypt', 'attr', 'gcc-runtime', 'glibc', 'opkg-utils', 'libpam', 'libgcc', 'l>
NOTE: Skipping as already exists in sysroot: []
DEBUG: sed -e 's:^[^/]*/:/workdir/build-verdin-imx8mp/tmp/work/cortexa53-tdx-linux/torizon-users/1.0-r0/recipe-sysroot/:g' /workdir/build-verdin-imx8mp/tmp/sysroots-components/cortexa53/base-passwd/fixme>
DEBUG: Python function extend_recipe_sysroot finished
DEBUG: Python function do_prepare_recipe_sysroot finished
DEBUG: Executing python function useradd_sysroot_sstate
DEBUG: Executing shell function useradd_sysroot
/workdir/build-verdin-imx8mp/tmp/work/cortexa53-tdx-linux/torizon-users/1.0-r0/recipe-sysroot-native/usr/sbin/useradd
Running groupadd commands...
NOTE: torizon-users: Performing groupadd with [--root /workdir/build-verdin-imx8mp/tmp/work/cortexa53-tdx-linux/torizon-users/1.0-r0/recipe-sysroot --gid 1000 torizon]
configuration error - unknown item 'SYSLOG_SU_ENAB' (notify administrator)
configuration error - unknown item 'SYSLOG_SG_ENAB' (notify administrator)
Running useradd commands...
NOTE: torizon-users: Performing useradd with [--root /workdir/build-verdin-imx8mp/tmp/work/cortexa53-tdx-linux/torizon-users/1.0-r0/recipe-sysroot --home-dir /home/torizon --gid 1000 --groups adm,sudo,us>
configuration error - unknown item 'SYSLOG_SU_ENAB' (notify administrator)
configuration error - unknown item 'SYSLOG_SG_ENAB' (notify administrator)
useradd: group 'gpio' does not exist
useradd: group 'i2cdev' does not exist
useradd: group 'spidev' does not exist
useradd: group 'pwm' does not exist
ERROR: torizon-users: useradd command did not succeed.
WARNING: /workdir/build-verdin-imx8mp/tmp/work/cortexa53-tdx-linux/torizon-users/1.0-r0/temp/run.useradd_sysroot.3049031:335 exit 1 from 'exit 1'
WARNING: Backtrace (BB generated script):
        #1: bbfatal, /workdir/build-verdin-imx8mp/tmp/work/cortexa53-tdx-linux/torizon-users/1.0-r0/temp/run.useradd_sysroot.3049031, line 335
        #2: perform_useradd, /workdir/build-verdin-imx8mp/tmp/work/cortexa53-tdx-linux/torizon-users/1.0-r0/temp/run.useradd_sysroot.3049031, line 321
        #3: useradd_preinst, /workdir/build-verdin-imx8mp/tmp/work/cortexa53-tdx-linux/torizon-users/1.0-r0/temp/run.useradd_sysroot.3049031, line 246
        #4: useradd_sysroot, /workdir/build-verdin-imx8mp/tmp/work/cortexa53-tdx-linux/torizon-users/1.0-r0/temp/run.useradd_sysroot.3049031, line 176
        #5: main, /workdir/build-verdin-imx8mp/tmp/work/cortexa53-tdx-linux/torizon-users/1.0-r0/temp/run.useradd_sysroot.3049031, line 347
DEBUG: Python function useradd_sysroot_sstate finished

Motivation:
We have a program that needs as much performance as possible out of the SoC, especially RAM, so a Docker container image is not ideal, we are also a small company, but larger than the 250-employee limit for free use.
We also have an OOT Linux Kernel Module that has to be used for our peripherals, so I don’t think the TorizionCore builder would work, correct me if I’m wrong please.

Similar Topic:

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

Thank you for reaching out with your issue. The error you’re encountering during the build process for Torizon 6 on the Verdin iMX8MP is related to the ‘useradd’ command failing due to missing groups such as ‘gpio’, ‘i2cdev’, ‘spidev’, and ‘pwm’. This typically indicates that these groups are not defined in the build configuration.

To resolve this issue, please consider the following steps:

  1. Check Configuration Files: Ensure that the necessary group definitions are included in your Yocto build configuration. You may need to modify the torizon-users recipe or related configuration files to define these groups.

  2. Verify Build Environment: Make sure your build environment is correctly set up and that all dependencies are installed. Sometimes, missing packages or incorrect environment settings can lead to such errors.

Regarding your concerns about performance, running applications directly on the host OS can indeed provide better performance compared to containerized environments. However, TorizonCore is designed to be lightweight and efficient, even when using containers.

For integrating an out-of-tree Linux kernel module, you can use the Yocto build system to include your custom kernel module in the TorizonCore image. This approach allows you to maintain a high-performance environment while still benefiting from the flexibility of TorizonCore.

I hope this helps you resolve the issue and proceed with your project. If you have any more questions, feel free to ask.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

https://community.nxp.com/t5/i-MX-Processors/configuration-error-unkown-item-SYSLOG-SU-ENAB-during-bitbake/td-p/1875136

"usermod -aG group user" not accepted.

Found the same result using WSL2. Seems to be an issue that is independent of the build machine.

Hey @allen.morrison,

Running a reference build like yours on my Linux(ubuntu 24.04) machine to see if it builds correctly. So far so good. Only thing I had to make sure was the build directory had non 0:0 uid/gid permissions.

Integrating out of tree kernel modules shouldn’t be a problem. For out of tree modules inclusion with TorizonCore Builder.

-Eric

Hey @allen.morrison,

Running a reference build like yours on my Linux(ubuntu 24.04) machine to see if it builds correctly. So far so good. Only thing I had to make sure was the build directory had non 0:0 uid/gid permissions.

Integrating out of tree kernel modules shouldn’t be a problem. For out of tree modules inclusion with TorizonCore Builder.

developer.toradex.com

Building External Kernel Modules With Torizon | Toradex Developer Center

It is often necessary to add a kernel module to a Torizon OS image. Learn how to add an out-of-tree kernel module to your Torizon OS device.

-Eric

[Discourse post]

Hey @allen.morrison,

Running a reference build like yours on my Linux(ubuntu 24.04) machine to see if it builds correctly. So far so good. Only thing I had to make sure was the build directory had non 0:0 uid/gid permissions.

Integrating out of tree kernel modules shouldn’t be a problem. For out of tree modules inclusion with TorizonCore Builder.

developer.toradex.com

Building External Kernel Modules With Torizon | Toradex Developer Center

It is often necessary to add a kernel module to a Torizon OS image. Learn how to add an out-of-tree kernel module to your Torizon OS device.

Eric

[Discourse post]

Thanks for the clarification on OOT modules and TorizonCore Builder, which gives us an alternative implementation of our C++ program through docker alongside a TorizonCore image containing our custom kernel module.

It appears the userspace did play some role in the build process failing since I had run docker as sudo since it wouldn’t launch as my user. Now that I fixed that issue with docker’s instructions and your input, I have now restarted the build process and will post an update once I reach a conclusion.

Hey @eric.tx ,
After running the docker container without sudo (added my Linux user to a docker user group), I am still getting the same torizon-user: useradd command did not succeed error near the end of the build process.
Can you please expand on the change that you made with respect to “non 0:0 uid/gid permissions” so I can check that?

Here is what I found looking at the uid/gid of the build directory:

Hey @allen.morrison,

My build finished with the same error. So I’ll report this to our Torizon OS team and see what they say.

The uid/gid topic would be for the local build directory, but would have happened prior to the running of the container. So I don’t think this is an issue for you.

-Eric

Thanks @eric.tx ,
I appreciate the help and hopefully we hear back soon so we can develop on Torizon 6.
Since it’s near the end of the day, I’ll try to build Torizion 7 overnight for source building and look into putting our program into a container in the meantime since the OOT Kernel module could be added later.

@eric.tx ,
The Torizon 7 build succeeded, so for the moment I’m working on adding our program to that image. Hopefully, a Torizion 6 fix will come down the line soon as well.

Hey @allen.morrison,

Update:

This fix should be implemented in the next quarterly release for Torizon 6.I would recommend sticking with Torizon OS 7 if possible. But I understand you may already have a bulk of development done on 6.

-Eric

Howdy @eric.tx,
Thank y’all so much for your work on a patch! Thankfully, we had just started, so the migration to Torizon 7 was seamless. As long as we don’t need any of the GUI features that are having issues in Torizon 7, then we should be good to go. When the patch for Torizon 6 comes out, can you please ping me and I’ll try to make a build of it? Nice to know if we can rollback if we encounter issues.