Configuration fragments are simply kernel options that appear in a file
placed where the OpenEmbedded build system can find and apply them.
Syntactically, the configuration statement is identical to what would appear
in the .config
file, which is in the
Build Directory:
tmp/work/arch
-poky-linux/linux-yocto-release_specific_string
/linux-arch
-build_type
It is simple to create a configuration fragment.
For example, issuing the following from the shell creates a configuration fragment
file named my_smp.cfg
that enables multi-processor support
within the kernel:
$ echo "CONFIG_SMP=y" >> my_smp.cfg
.cfg
extension in order for the
OpenEmbedded build system to recognize them as a
configuration fragment.
Where do you put your configuration fragment files?
You can place these files in the same area pointed to by
SRC_URI
.
The OpenEmbedded build system picks up the configuration and
adds it to the kernel's configuration.
For example, suppose you had a set of configuration options
in a file called myconfig.cfg
.
If you put that file inside a directory named
linux-yocto
that resides in the same
directory as the kernel's append file and then add a
SRC_URI
statement such as the following
to the kernel's append file, those configuration options
will be picked up and applied when the kernel is built.
SRC_URI += "file://myconfig.cfg"
As mentioned earlier, you can group related configurations into multiple files and
name them all in the SRC_URI
statement as well.
For example, you could group separate configurations specifically for Ethernet and graphics
into their own files and add those by using a SRC_URI
statement like the
following in your append file:
SRC_URI += "file://myconfig.cfg \ file://eth.cfg \ file://gfx.cfg"