I want to integrate a custom kernel into a Torizon Core Image.
There are the following notes on this: Deploying the Kernel to an Image
I need help on the first two points.
Without concrete examples, I can’t imagine how this works.
I want to make slight adjustments in the kernel in the torizon-core-docker-apalis-imx8-Tezi_5.7.2+build.20
“It is possible to configure aspects of the Linux Kernel of TorizonCore and it’s modules by setting certain custom boot-time arguments (parameters). Learn how to customize kernel arguments on the Kernel Arguments section.”
If I understand you correctly, you could successfully build the custom kernel and now you are struggling with how to deploy it on the target.
After you have built the image with the custom kernel, you should be having a tar file of the image in Toradex Easy Installer format in the output directory. There are multiple ways by which you can deploy this image as they are explained here: Detailed Manual | Toradex Developer Center
The file structure of TorizonCore image is a bit different (since it uses OSTree) from that of our reference BSP images. On the BSP, the kernel binary and device tree(s) are part of the bootfs.tar.xz archive. So you simply need to replace them in the archive (just like in the article that you already found).
This is why we recommend building the image following this article. The advantage of this method is that you will get the image in Toradex Easy Installer format in the output directory - which you can deploy using multiple methods.
In your case since you need to add a custom kernel module, this section would be the most relevant to you. In summary, you will create a custom layer and a recipe to build your custom kernel module. After that, you will build the torizoncore image using the command bitbake torizon-core-docker.
I don’t want to create a new kernel module. I just want to change 2 values in an existing module that is being used by another module.
As far as I know, Torizon Core Images are created with Yocto as well as the BSP’s.
Where can I find instructions on how to replace the kernel in a TC image to try exactly these 2 changes in a custom Torizon Core Image?
As I already described in my previous reply, the recommended way to replace/swap the kernel on TorizonCore image is to reinstall the new image (the custom image you built with the kernel modifications included) itself. You are following the documentation for our BSP images. In my previous answers, I have added the references to how to build your custom TorizonCore image either by using TorizonCore Builder tool or by building it from Yocto. The right method you should follow depends on what type of modifications/customizations you are trying to make. This is why I would like to know what exact modifications are you trying to make with the kernel module.
I don’t want to create a new kernel module. I just want to change 2 values in an existing module that is being used by another module.
Could you please elaborate a bit more on that? How exactly are you doing that? Please list down your step-by-step procedure.
If you find it difficult to describe, I would like to propose a call with you where we can discuss this in detail. Please let me know if you would be interested to do that.
(This should ensure that my data packet, which is guaranteed to be larger than 4096 bytes and smaller than 8192, is NOT fragmented. A data packet that comes in via the serial interface should be forwarded packed in ASN1 via RPMSG)
From this answer in your other post, I can see that you’ve been successful in editing the kernel driver source and recompiling the kernel. After you compiled the kernel, if I understand you correctly, you built a reference Linux image in Toradex Easy Installer format. If that’s the case, I must say that you are mixing up the workflow of building reference Linux images with that of TorizonCore images.
What you need to do is the following:
You need to modify an in-tree kernel module and build a custom TorizonCore image with it. In this case, you will have to go with the Yocto workflow. That would be the cleanest way. As I have already mentioned before, you could follow this documentation on how to customize your kernel. As a pre-requisite, you need to build a TorizonCore image from Yocto and then add a custom layer and recipe to add your modifications on top of that. Then you will have to bitbake your custom TorizonCore image which will include the kernel modifications you added.
Modifying an in-tree kernel module is not really a supported use case of TorizonCore Builder. If you want to add an external kernel module or customize some kernel arguments you could do those with the TorizonCore Builder tool. Unfortunately, that’s not what you want to do here.
At this point, the following is required as a prerequisite:
Build a reference image with Yocto Project
or: Build TorizonCore from Source With Yocto
what is the right thing to do in my case (just changing 2 lines of code )?
Once again:
I don’t want to add any kernel module, no helloWorld program, no devicetree.