Yocto patch application

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


It looks like you’re trying to apply a patch to a device tree source (DTS) file through a Yocto recipe, but the patch is not being applied. Here are a few steps to troubleshoot and ensure that your patch is correctly applied:

  1. Check the Patch File:
    Ensure that your patch file 0001-Add-Rudi-text.patch is correctly formatted and applies cleanly to the target DTS file. You can manually apply the patch using the patch command to verify this:

    patch -p1 < 0001-Add-Rudi-text.patch
    
  2. Verify the bbappend File:
    Ensure that your cti-rudi-minimal-image.bbappend file is correctly referencing the patch. The SRC_URI should include the patch file:

    SRC_URI += "file://0001-Add-Rudi-text.patch"
    
  3. Layer Configuration:
    Ensure that your layer configuration (layer.conf) includes the path to the files directory where the patch is located. You should have something like this in your layer.conf:

    FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
    
  4. Patch Application:
    Ensure that the patch is being applied at the correct stage. If the patch is for a device tree file, it should be applied in the context of the kernel or U-Boot recipe, not the image recipe. You might need to create a bbappend for the kernel or U-Boot recipe instead of the image recipe.

    For example, if you are patching a device tree file in the kernel, you should create a bbappend for the kernel recipe:

    meta-cti-rudi/
    ├── recipes-kernel/
    │   └── linux/
    │       └── linux-toradex_%.bbappend
    └── files/
        └── 0001-Add-Rudi-text.patch
    

    And in linux-toradex_%.bbappend:

    FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
    SRC_URI += "file://0001-Add-Rudi-text.patch"
    
  5. Rebuild the Image:
    After making these changes, clean the build and rebuild the image to ensure that the patch is applied:

    bitbake -c cleanall <image-name>
    bitbake <image-name>
    
  6. Check Logs:
    Check the build logs to see if the patch is being applied. You can find the logs in the tmp/work directory of your build. Look for messages related to patch application.

If you follow these steps and ensure that the patch is correctly referenced and applied in the appropriate recipe, you should be able to see the changes in the decompiled DTB file. If you still encounter issues, please provide more details about the specific DTS file you are trying to patch and the exact contents of your patch file.

Please, also check if these links can help you solve your problem:

https://community.nxp.com/t5/i-MX-Processors/Yocto-build-is-ignoring-changes-in-recipe/td-p/858040.