Building a device tree overlay with torizoncore-builder

I’m converting a project from BSP 2.8 to TorizonCore. I have a device tree overlay that works with our hardware, and I’m trying to use TorizonCore Builder to build and deploy it. I’m following the instructions for building a device tree using TorizonCore Builder, but when I get to the step of running torizoncore-builder dt checkout, it fails as follows:

root@debian:/home/user/torizon# source ./tcb-env-setup.sh 
You may have an outdated version installed. Would you like to check for updates online? [y/n] y
Setting up TorizonCore Builder with version 2.

Pulling TorizonCore Builder...
2: Pulling from torizon/torizoncore-builder
Digest: sha256:e5453981ba65a82eb4c0180ef2b0b91e457afcb2755eb77bb176328428c97e70
Status: Image is up to date for torizon/torizoncore-builder:2
Done!

Setup complete! TorizonCore Builder is now ready to use.
For more information, run 'torizoncore-builder -h' or go to https://developer.toradex.com/knowledge-base/torizoncore-builder-tool
root@debian:/home/user/torizon# torizoncore-builder dt checkout
An unexpected Exception occured. Please provide the following stack trace to
the Toradex TorizonCore support team:

Traceback (most recent call last):
  File "/builder/torizoncore-builder", line 172, in <module>
    mainargs.func(mainargs)
  File "/builder/tcbuilder/cli/dt.py", line 36, in do_dt_checkout
    checkout_git_repo(storage_dir, None, None)
  File "/builder/tcbuilder/backend/common.py", line 281, in checkout_git_repo
    git_branch = get_branch_from_metadata(storage_dir)
  File "/builder/tcbuilder/backend/common.py", line 266, in get_branch_from_metadata
    src_sysroot = ostree.load_sysroot(src_sysroot_dir)
  File "/builder/tcbuilder/backend/ostree.py", line 40, in load_sysroot
    sysroot.load()
gi.repository.GLib.GError: g-io-error-quark: loading sysroot: opendir(/storage/sysroot): No such file or directory (1)

Is there a step that I’m missing? Here’s the information on the host system:

root@debian:/home/user/torizon# uname -a
Linux debian 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux
root@debian:/home/user/torizon# lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster

i had the same error. you need to run the unpack cmd first.
see thread below

Hi @nkj and @richgriswold,

The observation from @nkj is correct.

This is a known issue, which we are working to be fixed in an upcoming release of the TorizonCore Builder.

Until there, the solution is to use the unpack first.

Can you try that and tell me if it worked, @richgriswold?

Best regards,
André Curvello

I ran torizoncore-builder images download --remote-host eval_board_ip_address --remote-username torizon --remote-password eval_board_password, which downloaded and unpacked the image, and after that torizoncore-builder dt checkout worked. Thank you for your help with this. I’m still trying to wrap my head around torizoncore-builder and working with Torizon in general.

Thank you we appreciate the feedback!