Creating and Adding Patches For Software Components within a PetaLinux Project - 2023.2 English

PetaLinux Tools Documentation: Reference Guide (UG1144)

Document ID
UG1144
Release Date
2023-10-18
Version
2023.2 English
To create and add patches for software components within a PetaLinux project, follow these steps:
  1. Get the source code from git URL specified in meta-layers:
    petalinux-devtool modify <recipe-name>

    For example:

    petalinux-devtool modify linux-xlnx

    The previous command fetches the sources for the recipe and unpack them to a <plnx-proj-root>/components/yocto/workspace/sources/<recipe-name> directory and initialize it as a git repository if it is not already one.

  2. Make the changes you want to make to the source.
  3. Run a build to test your changes. You can run petalinux-build -c <recipename> or even build an entire image using petalinux-build incorporating the changes assuming a package produced by the recipe is part of an image. There is no need to force anything, the build system detects changes to the source and recompile as necessary.
  4. Optional: Test your changes on the target.
  5. Place your changes in the form of a patch to the PetaLinux project. To commit your changes, use the following commands.
    git add <filename>
    git commit -s
  6. petalinux-devtool finish <recipe-name> <destination layer path> creates a patch for the committed changes in recipe sources directory.

    For example:

    petalinux-devtool finish linux-xlnx <plnx-proj-dir>/project-spec/meta-user

    petalinux-devtool update-recipe linux-xlnx -a <destination layer path> creates a patch for the committed changes in recipe sources directory without removing the bbappend and source directory from the workspace directory.

    For example:

    petalinux-devtool update-recipe linux-xlnx -a <plnx-proj-dir>/project-spec/meta-user
  7. Once you have finished working on the recipe, run petalinux-devtool reset <recipe-name> to remove the source directory for the recipe from workspace.