issue building an out-of-tree module with torizonCore builder

I am trying to build the “hello world” kernel module as explained in this tutorial:

I use wsl2 on windows 10 (> 2004) and my torizonCore builder “workdir” directory is /home/rfonck/tcbworkdir.
On every shell I open I type the following commands before to try to compile:

$ cd /home/rfonck/tcbworkdir/
$ source
$ torizoncore-builder images unpack torizon-core-docker-apalis-imx6-Tezi_5.1.0+build.1.tar
(the .tar file was previously downloaded)

I don’t have error message with these commands. But when I try to compile a module, the compilation fail with the following error code :

rfonck@LAPTOP:~/tcbworkdir$ torizoncore-builder kernel build_module source_dir/
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 175, in <module>
  File "/builder/tcbuilder/cli/", line 106, in do_kernel_build_module
  File "/builder/tcbuilder/cli/", line 71, in kernel_build_module
    assert linux_src, "panic: missing Linux kernel source!"
AssertionError: panic: missing Linux kernel source!

I thought this error might be related to the variable $KERNEL_SRC that is used in the makefile but that is not set on the shell but I suppose that it is set on the container that torizonCore builder use (I don’t know how to check that).

do you have any idea what can cause this error?

Thanks a lot

I think I found the origin of my error thanks to this topic:

I used an oldest version of torizon easy installer.

I have totally installed torizoncore-builder and it woked well.


Dear @rfonck,

thanks for using the community.

Is your issue solved?

Best Regards

Dear @kevin.tx

my problem is effectively solved.

Best Regards rfonck

Dear @rfonck,

Thanks for letting us now.

Best Regards