Upstream storage of all the available kernel source code is one thing, while representing and using the code on your host development system is another. Conceptually, you can think of the kernel source repositories as all the source files necessary for all the supported Yocto Linux kernels. As a developer, you are just interested in the source files for the kernel on which you are working. And, furthermore, you need them available on your host system.
Kernel source code is available on your host system several different ways:
Files Accessed While using devtool
:
devtool
, which is available with the
Yocto Project, is the preferred method by which to
modify the kernel.
See the
"Kernel Modification Workflow"
section.
Cloned Repository: If you are working in the kernel all the time, you probably would want to set up your own local Git repository of the Yocto Linux kernel tree. For information on how to clone a Yocto Linux kernel Git repository, see the "Preparing the Build Host to Work on the Kernel" section.
Temporary Source Files from a Build:
If you just need to make some patches to the kernel using
a traditional BitBake workflow (i.e. not using the
devtool
), you can access temporary
kernel source files that were extracted and used during
a kernel build.
The temporary kernel source files resulting from a build using
BitBake have a particular hierarchy.
When you build the kernel on your development system, all files
needed for the build are taken from the source repositories
pointed to by the
SRC_URI
variable and gathered in a temporary work area where they are
subsequently used to create the unique kernel.
Thus, in a sense, the process constructs a local source tree
specific to your kernel from which to generate the new kernel
image.
The following figure shows the temporary file structure created on your host system when you build the kernel using Bitbake. This Build Directory contains all the source files used during the build.
![]() |
Again, for additional information on the Yocto Project kernel's
architecture and its branching strategy, see the
"Yocto Linux Kernel Architecture and Branching Strategies"
section.
You can also reference the
"Using devtool
to Patch the Kernel"
and
"Using Traditional Kernel Development to Patch the Kernel"
sections for detailed example that modifies the kernel.