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 the build directory,
${
B
}
,
which expands to
${
WORKDIR
}
/linux-
${
PACKAGE_ARCH
}-${
LINUX_KERNEL_TYPE
}-build
.
You can use the entire .config
file as the
defconfig
file as described in the
"Changing the Configuration" section.
For more information on the .config
file,
see the
"Using menuconfig
"
section in the Yocto Project Development Manual.
bitbake -e
command:
$ bitbake -e virtual/kernelSearch the output for the variable in which you are interested to see exactly how it is expanded and used.
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
This step ensures that you will be creating a
.config
file from a known state.
Because situations exist where your build state might
become unknown, it is best to run the previous
command prior to starting up
menuconfig
.
Run the menuconfig
command:
$ bitbake linux-yocto -c menuconfig
Run the diffconfig
command to prepare a configuration fragment.
The resulting file fragment.cfg
will be placed in the
${
WORKDIR
}
directory:
$ bitbake linux-yocto -c diffconfig
The diffconfig
command creates a file that is a
list of Linux kernel CONFIG_
assignments.
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 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.