Recommended way to build in-tree (non-external) kernel modules for Torizon?

You have recently added a convenient method to compile external / out-of-tree kernel modules for Torizon 5.2 (Building External Kernel Modules With Torizon | Toradex Developer Center). This process is very simple and fairly straight forward.

Meanwhile, I cannot find any documentation on how to build a in-tree kernel module that is not already included with the Torizon kernel, without rebuilding the whole kernel and going through the additional steps needed to setup the environment for that. What we have ended up doing is actually copying the wanted driver code from the kernel source tree and compiling it as an external module using the torizoncore builder tool, which seems a bit backwards.

Am I missing some simpler way to do this? If not, do you have any plans to simplify this process? Or perhaps include more compiled modules with the distribution?

p.s. The module we were missing was “i2c-mux-pca954x”.

Greetings @hordur,

Currently at the present time we don’t have any plans to simplify the process for in-tree kernel modules. In general we try to have Torizon be an out-of-the-box binary distribution that customers can just take and use. Typically if a customer like you wants a in-tree kernel module we’ll go ahead and just add it to the kernel by default. Assuming there’s no exceptional reasons not to.

Let me go and make the request to add this kernel module on your behalf. Just to double-check on quick search it seems for the i2c-mux-pca954x module, the respective kernel config switch is CONFIG_I2C_MUX_PCA954x. Can you just confirm that this is what you’re looking for before I make the request?

Best Regards,
Jeremias