You can manipulate the .config
file
used to build a linux-yocto recipe with the
menuconfig
command as follows:
$ bitbake linux-yocto -c menuconfig
This command starts the Linux kernel configuration tool,
which allows you to prepare a new
.config
file for the build.
When you exit the tool, be sure to save your changes
at the prompt.
The resulting .config
file is
located in
${
WORKDIR
}
under the
linux-${
MACHINE
}-${
directory.
You can use the entire KTYPE
}-build.config
file as the
defconfig
file as described in the
"Changing the Configuration" section.
A better method is to create a configuration fragment using the
differences between two configuration files: one previously
created and saved, and one freshly created using the
menuconfig
tool.
To create a configuration fragment using this method, follow these steps:
Complete a build at least through the kernel configuration task as follows:
$ bitbake linux-yocto -c kernel_configme -f
Copy and rename the resulting
.config
file (e.g.
config.orig
).
Run the menuconfig
command:
$ bitbake linux-yocto -c menuconfig
Prepare a configuration fragment based on the differences between the two files.
Ultimately, the configuration fragment file needs to be a
list of Linux kernel CONFIG_
assignments.
It cannot be in diff
format.
Here is an example of a command that creates your
configuration fragment file.
Regardless of the exact command you use, plan on reviewing
the output as you can usually remove some of the defaults:
$ diff -Nurp config.orig .config | sed -n "s/^\+//p" > frag.cfg
See the "Changing the Configuration" section for information on how to use the output as a configuration fragment.
The kernel tools also provide configuration validation.
You can use these tools to produce warnings for when a
requested configuration does not appear in the final
.config
file or when you override a
policy configuration in a hardware configuration fragment.
Here is an example with some sample output of the command
that runs these tools:
$ bitbake linux-yocto -c kernel_configcheck -f ... NOTE: validating kernel configuration This BSP sets 3 invalid/obsolete kernel options. These config options are not offered anywhere within this kernel. The full list can be found in your kernel src dir at: meta/cfg/standard/mybsp/invalid.cfg This BSP sets 21 kernel options that are possibly non-hardware related. The full list can be found in your kernel src dir at: meta/cfg/standard/mybsp/specified_non_hdw.cfg WARNING: There were 2 hardware options requested that do not have a corresponding value present in the final ".config" file. This probably means you are not't getting the config you wanted. The full list can be found in your kernel src dir at: meta/cfg/standard/mybsp/mismatch.cfg
The output describes the various problems that you can
encounter along with where to find the offending configuration
items.
You can use the information in the logs to adjust your
configuration files and then repeat the
kernel_configme
and
kernel_configcheck
commands until
they produce no warnings.
For more information on how to use the
menuconfig
tool, see the
"Using menuconfig
"
section in the Yocto Project Development Manual.