Unable to apply a simple patch in Yocto

I am trying to update a touchscreen controller driver by applying a patch when building the OS in Yocto (see related question). Then I update the kernel by copying the zImage file from the OS image build and writing the new kernel to the flash. I use the kernel (zImage) update method, because it is easier and faster to test than deploying the entire image every time on the device to see if the patch worked.

The problem is that I get many “err -22” messages in the kernel boot log and my kernel-managed I2C devices do not appear as managed (UU) when scanning the I2C bus with i2cdetect. Also, the touchscreen does not work.

I have attached the dmesg log after applying the patch. It is weird that I get the same output even when applying a simple patch that only adds a printk instruction in the touchscreen driver (attached). This is my folder that contains the patch (the folder is located in my custom Yocto layer).

What could be the problem? Is the kernel update method inappropriate and I need to deploy the entire image?

Colibri iMX6ULL 512MB WB IT
Custom carrier board
Linux TDX X11 5.2.0-devel-20210226152038+build.0 (dunfell)

Just a guess, but maybe you need to update the kernel modules in the rootfs also since you updated the kernel. Can you update the rootfs also after the new yocto build?

@DaveM Can you indicate what should I do in order to update the kernel modules in rootfs? I do not want to mess up the PS.

Just build and deploy the entire new image using tezi.

@DaveM I found the issue, but I don’t know how to resolve it. Every time I include the recipes-kernel folder (attached in my first message) in my custom Yocto layer, the image’s kernel does not contain all the customizations I made (e.g., custom splash screen/kernel modules/device drivers configured using bitbake -c menuconfig virtual/kernel), so that is why kernel-managed I2C devices do not appear as managed, nor the custom splash screen appears on boot.

I mention that I configured the kernel and built the image as follows:

  • bitbake -c menuconfig virtual/kernel (to make the customizations);
  • bitbake -c savedefconfig virtual/kernel (to save the customizations);
  • bitbake virtual/kernel (to compile the kernel);
  • bitbake -k tdx-reference-multimedia-image (to build the image; also includes bitbake linux-toradex).

If I remove the recipes-kernel folder and rebuild the image, everything is OK.

How can I add the patch without losing the kernel customizations?

If you followed the steps in Custom meta layers, recipes and images in Yocto Project (hello-world examples), you should be ok? I didn’t see you reference that document anywhere. I do think you should go back to that document and do the demonstration pieces to see if you can get that confidence in your process. I wouldn’t try to update just the zImage at this time.

@DaveM I managed to apply the patch and get everything working. I added the defconfig file to my folder and the custom logo, and modified the bbappend file accordingly. Thank you.

1 Like