Yocto build using Docker CROPS container

Hi,
I am attempting to implement secure boot into our project and need to build the O.S. using Yocto for that.
I tried to build it from source using the Docker container ‘Crops’ as per the documentation. After i set up the docker container on my Linux system (VMWARE system, at the time there was about ± 80GB of data free) it ran correclty up until i think 10 tasks indicated the space was not enough.
I added about 30 more GB and restarted the docker container and now it seems to complete the build, however i don’t see a tarball output in the deploy/images/[machine] folder. I do have several other files there but not a tarrball, according to the documentation a tezi tarball should be a resulting ouptut in the /deploy/images/[machine] folder.

I am using the verdin-am62 module and tried to build the yocto build using the following docker setup:
docker run --rm -it --name=crops -v ~/yocto-workdir:/workdir --workdir=/workdir -e MACHINE=verdin-am62 -e IMAGE=torizon-docker torizon/crops:scarthgap-7.x.y startup-tdx.sh

Output files in ‘/deploy/images/verdin-am62’ folder:

According to the output logs i have 1 warning and 2 tasks failed with errors present after the build which i don’t understand.
warning:

Failed task outputs:
"ERROR: kernel-devsrc-1.0-r0 do_package: Error executing a python function in exec_func_python() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: ‘exec_func_python() autogenerated’, lineno: 2, function:
0001:
*** 0002:sstate_report_unihash(d)
0003:
File: ‘/workdir/torizon/build-torizon/conf/…/…/layers/openembedded-core/meta/classes-global/sstate.bbclass’, lineno: 920, function: sstate_report_unihash
0916: report_unihash = getattr(bb.parse.siggen, ‘report_unihash’, None)
0917:
0918: if report_unihash:
0919: ss = sstate_state_fromvars(d)
*** 0920: report_unihash(os.getcwd(), ss[‘task’], d)
0921:}
0922:
0923:#
0924:# Shell function to decompress and prepare a package for installation
File: ‘/workdir/torizon/layers/openembedded-core/bitbake/lib/bb/siggen.py’, lineno: 809, function: report_unihash
0805:
0806: if “.” in self.method:
0807: (module, method) = self.method.rsplit(‘.’, 1)
0808: locs[‘method’] = getattr(importlib.import_module(module), method)
*** 0809: outhash = bb.utils.better_eval(‘method(path, sigfile, task, d)’, locs)
0810: else:
0811: outhash = bb.utils.better_eval(self.method + ‘(path, sigfile, task, d)’, locs)
0812:
0813: try:
File: ‘/workdir/torizon/layers/openembedded-core/bitbake/lib/bb/utils.py’, lineno: 434, function: better_eval
0430: if extraglobals:
0431: ctx = copy.copy(ctx)
0432: for g in extraglobals:
0433: ctx[g] = extraglobals[g]
*** 0434: return eval(source, ctx, locals)
0435:
0436:@contextmanager
0437:def fileslocked(files, *args, **kwargs):
0438: “”“Context manager for locking and unlocking file locks.”“”
File: ‘’, lineno: 1, function:
File “”, line 1, in

File: ‘/workdir/torizon/build-torizon/conf/…/…/layers/openembedded-core/meta/lib/oe/sstatesig.py’, lineno: 677, function: OEOuthashBasic
0673: update_hash(“\n”)
0674:
0675: # Process this directory and all its child files
0676: if include_root or root != “.”:
*** 0677: process(root)
0678: for f in files:
0679: if f == ‘fixmepath’:
0680: continue
0681: process(os.path.join(root, f))
File: ‘/workdir/torizon/build-torizon/conf/…/…/layers/openembedded-core/meta/lib/oe/sstatesig.py’, lineno: 616, function: process
0612: except KeyError as e:
0613: msg = (“KeyError: %s\nPath %s is owned by uid %d, gid %d, which doesn’t match "
0614: “any user/group on target. This may be due to host contamination.” %
0615: (e, os.path.abspath(path), s.st_uid, s.st_gid))
*** 0616: raise Exception(msg).with_traceback(e.traceback)
0617:
0618: if include_timestamps:
0619: # Need to clamp to SOURCE_DATE_EPOCH
0620: if s.st_mtime > source_date_epoch:
File: ‘/workdir/torizon/build-torizon/conf/…/…/layers/openembedded-core/meta/lib/oe/sstatesig.py’, lineno: 610, function: process
0606: else:
0607: add_perm(stat.S_IXOTH, ‘x’)
0608:
0609: try:
*** 0610: update_hash(” %10s" % pwd.getpwuid(s.st_uid).pw_name)
0611: update_hash(" %10s" % grp.getgrgid(s.st_gid).gr_name)
0612: except KeyError as e:
0613: msg = ("KeyError: %s\nPath %s is owned by uid %d, gid %d, which doesn’t match "
0614: “any user/group on target. This may be due to host contamination.” %
Exception: Exception: KeyError: ‘getpwuid(): uid not found: 1000’
Path /workdir/torizon/build-torizon/tmp/work/verdin_am62-tdx-linux/kernel-devsrc/1.0/sstate-build-package/package is owned by uid 1000, gid 1000, which doesn’t match any user/group on target. This may be due to host contamination.

ERROR: Logfile of failure stored in: /workdir/torizon/build-torizon/tmp/work/verdin_am62-tdx-linux/kernel-devsrc/1.0/temp/log.do_package.3579
ERROR: Task (/workdir/torizon/build-torizon/conf/…/…/layers/openembedded-core/meta/recipes-kernel/linux/kernel-devsrc.bb:do_package) failed with exit code ‘1’
ERROR: boost-1.84.0-r0 do_package: Error executing a python function in exec_func_python() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: ‘exec_func_python() autogenerated’, lineno: 2, function:
0001:
*** 0002:sstate_report_unihash(d)
0003:
File: ‘/workdir/torizon/build-torizon/conf/…/…/layers/openembedded-core/meta/classes-global/sstate.bbclass’, lineno: 920, function: sstate_report_unihash
0916: report_unihash = getattr(bb.parse.siggen, ‘report_unihash’, None)
0917:
0918: if report_unihash:
0919: ss = sstate_state_fromvars(d)
*** 0920: report_unihash(os.getcwd(), ss[‘task’], d)
0921:}
0922:
0923:#
0924:# Shell function to decompress and prepare a package for installation
File: ‘/workdir/torizon/layers/openembedded-core/bitbake/lib/bb/siggen.py’, lineno: 809, function: report_unihash
0805:
0806: if “.” in self.method:
0807: (module, method) = self.method.rsplit(‘.’, 1)
0808: locs[‘method’] = getattr(importlib.import_module(module), method)
*** 0809: outhash = bb.utils.better_eval(‘method(path, sigfile, task, d)’, locs)
0810: else:
0811: outhash = bb.utils.better_eval(self.method + ‘(path, sigfile, task, d)’, locs)
0812:
0813: try:
File: ‘/workdir/torizon/layers/openembedded-core/bitbake/lib/bb/utils.py’, lineno: 434, function: better_eval
0430: if extraglobals:
0431: ctx = copy.copy(ctx)
0432: for g in extraglobals:
0433: ctx[g] = extraglobals[g]
*** 0434: return eval(source, ctx, locals)
0435:
0436:@contextmanager
0437:def fileslocked(files, *args, **kwargs):
0438: “”“Context manager for locking and unlocking file locks.”“”
File: ‘’, lineno: 1, function:
File “”, line 1, in

File: ‘/workdir/torizon/build-torizon/conf/…/…/layers/openembedded-core/meta/lib/oe/sstatesig.py’, lineno: 677, function: OEOuthashBasic
0673: update_hash(“\n”)
0674:
0675: # Process this directory and all its child files
0676: if include_root or root != “.”:
*** 0677: process(root)
0678: for f in files:
0679: if f == ‘fixmepath’:
0680: continue
0681: process(os.path.join(root, f))
File: ‘/workdir/torizon/build-torizon/conf/…/…/layers/openembedded-core/meta/lib/oe/sstatesig.py’, lineno: 616, function: process
0612: except KeyError as e:
0613: msg = (“KeyError: %s\nPath %s is owned by uid %d, gid %d, which doesn’t match "
0614: “any user/group on target. This may be due to host contamination.” %
0615: (e, os.path.abspath(path), s.st_uid, s.st_gid))
*** 0616: raise Exception(msg).with_traceback(e.traceback)
0617:
0618: if include_timestamps:
0619: # Need to clamp to SOURCE_DATE_EPOCH
0620: if s.st_mtime > source_date_epoch:
File: ‘/workdir/torizon/build-torizon/conf/…/…/layers/openembedded-core/meta/lib/oe/sstatesig.py’, lineno: 610, function: process
0606: else:
0607: add_perm(stat.S_IXOTH, ‘x’)
0608:
0609: try:
*** 0610: update_hash(” %10s" % pwd.getpwuid(s.st_uid).pw_name)
0611: update_hash(" %10s" % grp.getgrgid(s.st_gid).gr_name)
0612: except KeyError as e:
0613: msg = ("KeyError: %s\nPath %s is owned by uid %d, gid %d, which doesn’t match "
0614: “any user/group on target. This may be due to host contamination.” %
Exception: Exception: KeyError: ‘getpwuid(): uid not found: 1000’
Path /workdir/torizon/build-torizon/tmp/work/aarch64-tdx-linux/boost/1.84.0/sstate-build-package/package is owned by uid 1000, gid 1000, which doesn’t match any user/group on target. This may be due to host contamination.

ERROR: Logfile of failure stored in: /workdir/torizon/build-torizon/tmp/work/aarch64-tdx-linux/boost/1.84.0/temp/log.do_package.2306
ERROR: Task (/workdir/torizon/build-torizon/conf/…/…/layers/openembedded-core/meta/recipes-support/boost/boost_1.84.0.bb:do_package) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 9404 tasks of which 9364 didn’t need to be rerun and 2 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 11 seconds
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 7 seconds
"

I hope someone can point me in the right direction.

Kind regards Richard.

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 Richard,

Thank you for reaching out with your question. Let’s address the issues you’re encountering with your Yocto build for the Verdin AM62 module using the Crops Docker container.

  1. Missing Tarball Output:

    • The absence of the expected tarball in the deploy/images/[machine] directory suggests the build might not have completed successfully. Ensure that the build process finishes without critical errors.
    • Double-check that the IMAGE variable in your Docker run command is set correctly. For Torizon, it should typically be torizon-core-docker or a similar variant.
    • Verify your local.conf file in the Yocto build configuration to ensure the IMAGE_FSTYPES variable includes tar.bz2 or tar.gz if you expect a tarball output.
  2. Build Errors and Warnings:

    • The KeyError related to user ID mismatches often occurs when the Docker container’s user does not match the host system’s user. You can resolve this by running the Docker container with the --user flag to match the host’s user ID and group ID, like so: --user $(id -u):$(id -g).
    • The error getpwuid(): uid not found: 1000 indicates that UID 1000 does not exist in the container. Ensure the user inside the container has the same UID as your host user.
    • For the failed tasks, examine the detailed logs in the temp directory of the build output for more specific error messages, which can provide further insights.
  3. General Recommendations:

    • Ensure your Docker environment is set up with adequate resources (CPU, memory, and disk space) to handle the build process.
    • If your goal is to customize Torizon OS without deep involvement in Yocto, consider using the TorizonCore Builder tool, which simplifies many aspects of image customization and deployment.

By addressing these points, you should be able to resolve the issues with your Yocto build process. If you continue to experience problems, further investigation into the specific error logs and configurations may be necessary.

Best regards,
Toradex AI Assistant

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

Bitbake fails to build elfutils.

Update:

After freeing up more space and starting from scratch (complete rebuild) the build results as expected in the tarball output, so most likely the issue was not enough space during build.
I monitored the used space during this new build at several points via df -h and started at a free space of 103GB, during the build this dropped to 38 GB and ended around 49GB.

I dont have the inital disk space, but this was around 103GB free.

halfway:

At the end:

The advised free space for this build was around 60GB but i used more which was most likely the issue.

Docker container ending log output:

resulting output (among many other files) in '/deploy/images/verdin-am62’ folder:

Kind regards Richard.

Hi @RiBe_Act

Happy to know that everything is working now. :smile:

Thanks for the information, I think the 60 GB minimum requirement may be outdated, we are going to update our documentation. :+1: