Methods

If you want to modify the Digi Embedded Yocto Linux kernel, you can use several methods:

  • Build custom Yocto kernel recipe: this method makes use of the Yocto build system. Digi recommends this method for users who customize the entire system, including the Linux kernel. It allows for two possible workflows:

    • Git-based workflow (suitable for most projects): This workflow consists of creating a git repository (usually a fork of the main DEY Linux repo), using it to develop the kernel, and making Yocto fetch the sources from the repository. Note that this will not automatically apply the updates to the official source code repo. To update your repository with the latest official releases, you must merge Digi releases into your forked repository.

    • Patch-based workflow: The usual way to work with Yocto recipes is to download the official source code and apply custom patches to meet your specific needs. This workflow is fine when only a few patches are expected, but it doesn’t scale to multiple modifications. (In that case, Digi recommends you fork the original repo.) The benefit of this workflow is that you can follow updates on the official source code branch.

  • Build standalone/external images: This method clones the Linux kernel repository out of Digi Embedded Yocto and builds it externally. Digi recommends this method for teams that focus mainly on kernel development. It doesn’t require Yocto, but it does require the Digi Embedded Yocto toolchain to compile the code for Digi platforms. Digi recommends this method for developing, testing, and maintaining code changes before integrating them into the Yocto recipes using any of the previous methods.

  • Make quick changes in the Yocto devshell: This method allows you to make temporary changes to the kernel and test them quickly. Note that a clean operation of the recipe removes all changes, so Digi only recommends this method for testing small changes.

Build the kernel - general steps

The kernel build system offers many options, and you must follow some general steps before building:

  1. Clone the Linux kernel repository.

  2. Check out the branch of your choice.

  3. Set up the build environment.

  4. Select your platform’s configuration.

  5. Compile.

Yocto automatically performs these steps while following the kernel recipes.

After the build is done, you must Deploy the kernel on your target.