TorizonCore add a kernel module

Looking for instructions on how to build / include a kernel module into TorizonCore / Torizon. I need to add a custom driver.

Greetings @kdubious,

We are currently developing/working on a tool that will allow you to update the Torizon kernel with new kernel information including additional modules. However this tooling is still a work in progress so we’ll have to take a more manual approach.

Some clarifying question so I that I understand the situation:

  • Based on your question I assume this driver is not in the open source linux kernel correct?
  • What exact version of Torizon are you trying to add a kernel module to?

In general though the recommended way currently to modify the kernel would be via the Yocto build system. This article describes how to setup a Yocto build environment for Torizon: https://developer.toradex.com/knowledge-base/build-torizoncore

Then this is the general documentation on integrating out-of-tree kernel drivers with Yocto: https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#working-with-out-of-tree-modules

Alternatively, you could also just recompile the Linux Kernel with your driver code and then replace the Kernel on your Torizon system. This is a bit riskier than the Yocto method and can cause strange issues. Since at least with the Yocto method you ensure the entire system image is built and complied together.

Nonetheless if you’d like to try this method see the answer on this question for general steps: https://www.toradex.com/community/questions/51425/enabling-pps-gpio-on-torizon-colibri-imx7d.html

Also take note of this section here which outlines kernel module deployment: https://developer.toradex.com/knowledge-base/build-u-boot-and-linux-kernel-from-source-code#kernel-module-deployment

Best Regards,
Jeremias

Hello Jeremias, yes, the driver is not in the open source Linux kernel at this point.

I’ll take a look at the Yocto build and decide if that’s something I can do for this project.