This topic explains how to build the Linux kernel 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.

    • Digi Embedded Yocto handles the build.

  • Cons

    • Changes are temporary, and they will be lost if 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 kernel recipe:

    $ bitbake -c devshell virtual/kernel

    Digi Embedded Yocto automatically fetches and unpacks the kernel sources. A new terminal opens directly on the folder where the kernel source code is.

  3. Make your changes to kernel code, device trees, and/or kernel configuration (see Change kernel configuration).

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

    $ exit
  5. Build the kernel with your changes:

    $ bitbake -C compile virtual/kernel

    The (capital) -C makes bitbake execute the compile task and any other tasks that come after. It also forces the build while keeping any changes you made in the temporary directory. This is important because using (lower-case) -c or tasks that precede compile, such as fetch, will remove your temporary changes.

You can find the kernel binary and the device tree blobs in tmp/deploy/images/ccimx6qpsbc.

Change kernel configuration

To make a quick and temporary change to the kernel configuration, run this command from your Digi Embedded Yocto project folder:

$ bitbake -c menuconfig virtual/kernel

Change the kernel configuration as needed, then save and close the configuration tool.

Undo changes

To discard your temporary changes and let Yocto build the kernel from scratch:

$ bitbake -c cleanall virtual/kernel
$ bitbake virtual/kernel

Deploy the kernel on your target

After you build your kernel and device tree, proceed to deploy them. See Deploy the kernel on your target.