Version confusion//Beginner question

Hi,

I have a Verdin IMX8MP on an Ivy carrier.

To start my Toradex project with babysteps, instead of using Torizon, I built up a Debian image. I honestly have only a casual knowledge of how a Linux distribution is actually created, but I managed to make a booting/working Debian image simply by grabbing the bootfs from the Verdin reference minimal image and pairing it with a rootfs I created with debbootstrap, then copying in the kernel modules from the rootfs of the ref min image. This works great, the image boots up and all devices seem to work fine.

Next, I needed to get tailscale running. I quickly ran into the issue of not having the tun kernel module. tun.ko isn’t in the reference image.

My plan was to grab the kernel source which built the reference image, build it, and then just grab the kernel module out of that.

First off, does all this seem sane? I do realize that Torizon provides a Debian container image, though I wanted to get my project working on the chip in an environment similar to desktop just as a first step, then I figured I’d containerize it. It wasn’t much work to make the Debian image.

Second question:
I’m confused about how to obtain the source code which built my kernel. I downloaded https://tezi.toradex.com/artifactory/tdxref-oe-prod-frankfurt/scarthgap-7.x.y/release/5/verdin-imx8mp/tdx-xwayland/tdx-reference-multimedia-image/oedeploy/Verdin-iMX8MP_Reference-Multimedia-Image-Tezi_7.2.0+build.5.tar

from

Reading through the Embedded Software Release Matrix, I don’t even see a single mention of BSP 7.2.0 anywhere. I understand that the source is likely a branch in the toradex-linux git repo, but looking through the branch last, I can’t work out which branch is definitely the branch which built this kernel. Could someone give me a crash course in understanding how to link my reference minimal image back to the sources that produced it?

Thanks!

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Hello! Thank you for your detailed explanation and your questions. I’ll guide you through the process step by step.


1. Is Your Approach Reasonable?

Yes, your approach is technically sound for initial experimentation: using the bootfs from the Toradex reference image with a custom rootfs, and copying the kernel modules to ensure compatibility. However, it’s important to note that Toradex officially supports using their Yocto Project/OpenEmbedded-based BSP as the foundation for modifications, because this ensures maximum compatibility and easier debugging as your project matures. For production, or if you need to maintain kernel/userland compatibility, Yocto/OpenEmbedded is the recommended approach.

More information:


2. Obtaining the Exact Kernel Source & Building Kernel Modules

Every released Toradex image corresponds to a specific set of git repositories, branches, and commits for its BSP (Board Support Package), including the Linux kernel.

How to Map an Image to its Source Code:

  1. Find the BSP Version

    • You are using Verdin-iMX8MP_Reference-Multimedia-Image-Tezi_7.2.0+build.5. The relevant version is 7.2.0, codename “Scarthgap”.
  2. Find the Correct Branch or Manifest

  3. Get the Kernel Source

  4. Simplified: Matching Kernel Version

    • To match exactly, boot your board and run:
      uname -r
      modinfo <some-module>
      
    • This gives you the kernel release, which correlates to a tag or commit in the linux-toradex repo.

Detailed Steps

  • Clone the proper kernel branch:

    git clone https://git.toradex.com/linux-toradex.git
    cd linux-toradex
    git branch -a
    # Look for a branch like toradex_5.15-2.0.x-imx or similar (depends on your image's kernel)
    git checkout <branch_for_your_bsp>
    

    (Check your uname -r against release notes here: BSP Layers and Reference Images for Yocto Project Software | Toradex Developer Center )

  • Build the TUN Module:

    1. Configure the kernel (preferably with the same defconfig used for the reference image, usually something like imx_v8_defconfig).
    2. Enable TUN:
      • Set CONFIG_TUN=m in the kernel config (make menuconfig under Device Drivers → Network Device Support → Universal TUN/TAP device driver support).
    3. Compile modules:
      make modules
      
      • Your tun.ko should appear in drivers/net/tun.ko.
      • Use the cross-compiler matching your platform (ARM64 for i.MX8MP).
    4. Copy tun.ko to your rootfs at /lib/modules/$(uname -r)/kernel/drivers/net/.
  • Update module dependencies:

    depmod
    
  • Load module:

    modprobe tun
    

Summary

Let me know if you would like a step-by-step guide for setting up the Yocto build environment or more kernel build instructions.

Best regards,
Toradex AI Assistant.

I found the tag 7.2.0 in the toradex-manifest repo. Looking at the tdxref/default.xml, I find a revision hash for meta-toradex-distro, following that and looking around, I end up at uprev-srcrev « scripts - meta-toradex-distro.git - Toradex distribution layer

Line 28 of that file caught my eye, linux-toradex_6.6-2.2.x matches linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules. So is this tag the kernel source which built Verdin-iMX8MP_Reference-Multimedia-Image-Tezi_7.2.0+build.5?

Hey, @chris1seto,

From what I understood, you are in the early stages of development and just wants to get a system working for developing and testing your application for now.

Please, keep in mind that we don’t test or support manipulating our reference images directly. If you want to make a custom Debian image using our BSP, we offer support and documentation for doing it through Yocto. That being said, you are correct: the 7.2.0+build.5 version of our BSP is built with the linux-toradex_6.6-2.2.x kernel. You can find Toradex’s downstream kernel repository here.

If you wish to continue using a custom Debian image for your setup, check out our documentation on Building a Reference Image with Yocto for the first steps on working with our reference images. You should also check our guide on custom layers, recipes and images for details on how to customize the images for your use-case.

On the other hand, if you are willing to use Torizon, it could accelerate the development process for your project. We highly recommend following our Quickstart guide. It will take you through the process of deploying a Torizon image to the your board, until setting up an efficient development environment for an application running on Torizon OS. If you use Torizon, you can also use TorizonCore Builder, which makes it easy to customize your image without the need of using Yocto.

As a side note, our Torizon containers are Debian-based, therefore, by running Torizon you will actually be running your application inside a Debian environment (inside your container).

Let me know if need any further help in setting up your system.

Best regards,