This topic explains how to modify, build, and deploy a given recipe with quick temporary changes using Digi Embedded Yocto.

Pros and cons

  • Pros

    • You can quickly test minor configuration or code changes before making a permanent change.

  • Cons

    • Changes are temporary, and they will be lost when you run a clean or fetch operation on the recipe.

Instructions

  1. Go to your Digi Embedded Yocto project and source the environment:

    $ source dey-setup-environment
  2. Open a devshell to the recipe:

    $ bitbake -c devshell <recipe-name>

    Digi Embedded Yocto automatically fetches and unpacks the recipe’s sources. A new terminal opens directly in the folder where the recipe’s source code is.

  3. Make your changes to the source code, and/or configuration (for instance, with make menuconfig).

  4. When you are done with your changes, exit the shell and return to your project folder:

    $ exit
  5. Build the recipe with your changes:

    $ bitbake -C compile <recipe-name>

    The (capital) -C makes bitbake execute the compile task and any other tasks that follow. It also forces the build while keeping any changes you made in the temporary directory. This is important because using (lower-case) -c won’t force the rebuild. Besides, running tasks that precede compile, such as fetch, will override your temporary changes.

You can now build your image and deploy the artifacts on the target to test your changes. See Deploy.

Save your changes

Once you are happy with your changes it is recommended you save them to a different folder. This is important because the devshell source folder is temporary, and your changes will disappear when you clean the recipe.

To save the changes you made to the source code:

  1. Open a devshell to the recipe:

    $ bitbake -c devshell <recipe-name>
  2. If the recipe is based on a git repository:

    1. Use git commands to see the changes and create commits:

      $ git diff
      $ git add <filename>
      $ git commit -s
    2. Keep making changes and commits as needed.

    3. Create the patches for the number of commits you have made and put them inside the recipe’s folder in your layer. For example, if you have made five commits:

      $ git format-patch -5 -o > <path-to-my-layer>/<path-to-recipe>/
  3. If the recipe is based on a tarball, you need to manually extract your differences from the original code and create patches.

This is the fastest way to modify, build, deploy, and test changes. To make the changes permanent, see Make permanent changes.