TipsAndTricks/DemystifyingTheLinuxYoctoKernel: Difference between revisions

From Yocto Project
Jump to navigationJump to search
No edit summary
No edit summary
Line 11: Line 11:
To configure, build, and boot a new kernel outside of Yocto, you'd typically do something like this:
To configure, build, and boot a new kernel outside of Yocto, you'd typically do something like this:


$ make menuconfig
.
.
select/deselect new config items
.
.
$ make bzImage
$ scp arch/x86/boot/bzImage 10.0.0.18/mnt/bzImage
.
.
reboot target and see changes
The same thing in Yocto would be:
$ bitbake -c menuconfig virtual/kernel
.
.
select/deselect new config items
.
.
$ bitbake -c compile -f virtual/kernel
$ scp tmp/work/core2-32-intel-common-poky-linux/linux-yocto/4.1.26+gitAUTOINC+9f68667031_9195020e57-r0/linux-core2-32-intel-common-standard-build/arch/x86/boot/bzImage 10.0.0.18:/mnt/bzImage
.
.
reboot target and see changes





Revision as of 20:21, 27 June 2016

Despite the existence of plenty of in-depth documentation out there on working with kernels in Yocto, most people seem to still view the subject as 'a riddle, wrapped in a mystery, inside an enigma'. [1][2]

This is the first in what should be a short series of articles dealing with Yocto kernels, focusing only on the bare essentials.

Let's start first with the kernel itself. When most people think of a kernel in Yocto, they tend to think of it as something that's wrapped inside a kernel recipe, which in turn is something that's wrapped inside the build system and generated into the final image. That's all true and valid, but all those extra layers (let's call them the mystery and the enigma for now) obscure the kernel of truth at the center (the riddle). Let's just look at the riddle and come back some other day to explain the mystery and the enigma.

At its heart, a Yocto kernel is just exactly the same thing as an upstream Linux kernel.

To make that point clear, let's take a quick look at a typical kernel development workflow outside of Yocto (don't let the phrase 'kernel development workflow' scare you off - for the purposes of this article it just refers to compiling and building and possibly configuring a kernel, which is something anyone dealing with a build system like Yocto should be comfortable with).

To configure, build, and boot a new kernel outside of Yocto, you'd typically do something like this:

$ make menuconfig
.
.
select/deselect new config items
.
.
$ make bzImage
$ scp arch/x86/boot/bzImage 10.0.0.18/mnt/bzImage
.
.
reboot target and see changes

The same thing in Yocto would be:

$ bitbake -c menuconfig virtual/kernel
.
.
select/deselect new config items
.
.
$ bitbake -c compile -f virtual/kernel
$ scp tmp/work/core2-32-intel-common-poky-linux/linux-yocto/4.1.26+gitAUTOINC+9f68667031_9195020e57-r0/linux-core2-32-intel-common-standard-build/arch/x86/boot/bzImage 10.0.0.18:/mnt/bzImage
.
.
reboot target and see changes


[1] Yocto kernel labs

[2] Yocto Kernel Development Manual