diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index d37f94e74a..db6c29fdc3 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml @@ -1036,6 +1036,171 @@ so that there are some definite steps on how to do this. I need more detail her +
+ Configuring the Kernel + + + Configuring the Linux Yocto kernel consists of making sure the .config + file has all the right information in it for the image you are building. + You can use the menuconfig tool and configuration fragments to + make sure your .config file is just how you need it. + This section describes how to use menuconfig, create and use + configuration fragments, and how to interatively tweak your .config + file to create the leanest kernel configuration file possible. + + + + For concepts on kernel configuration, see the + "Kernel Configuration" + section in the Yocto Project Kernel Architecture and Use Manual. + + +
+ Using  <filename>menuconfig</filename> + + + The easiest way to define kernel configurations is to set them through the + menuconfig tool. + For general information on menuconfig, see + . + + + + To use the menuconfig tool in the Yocto Project development + environment, you must build the tool using BitBake. + The following commands build and invoke menuconfig assuming the + Yocto Project files top-level directory is ~/poky: + + $ cd ~/poky + $ source oe-init-build-env + $ bitbake linux-yocto -c menuconfig + + Once menuconfig comes up, its standard interface allows you to + examine and configure all the kernel configuration parameters. + Once you have made your changes, simply exit the tool and save your changes to + create an updated version of the .config configuration file. + + + + For an example that shows how to change the SMP_CONFIG parameter + using menuconfig, see the + "Changing + the CONFIG_SMP Configuration Using menuconfig" + section. + +
+ +
+ Creating Config Fragments + + + Configuration fragments are simply kernel options that appear in a file. + Syntactically, the configuration statement is identical to what would appear + in the .config. + For example, issuing the following from the shell would create a config fragment + file named my_smp.cfg that enables multi-processor support + within the kernel: + + $ echo "CONFIG_SMP=y" >> my_smp.cfg + + + + + Where do you put your configuration files? + You can place these configuration files in the same area to which the + SRC_URI points. + The Yocto Project build process will pick up the configuration and add it to the + kernel's configuration. + For example, assume you add the following to your + linux-yocto_3.0.bbappend file: + + file://my_smp.cfg + + You would put the config fragment file my_smp.cfg in your + layer right beneath the directory containing the + linux-yocto_3.0.bbappend file and the build system + will pick up and apply the fragment. + +
+ +
+ Fine-tuning the Kernel Configuration File + + + You can make sure the .config is as lean or efficient as + possible by reading the output of the kernel configuration fragment audit, + noting any issues, making changes to correct the issues, and then repeating. + + + + As part of the Linux Yocto kernel build process, the + kernel_configcheck task runs. + This task validates the kernel configuration by checking the final + .config file against the input files. + During the check, the task produces warning messages for the following + issues: + + Requested options that did not make the final + .config file. + Configuration items that appear twice in the same + configuration fragment. + Configuration items tagged as 'required' were overridden. + + A board overrides a non-board specific option. + Listed options not valid for the kernel being processed. + In other words, the option does not appear anywhere. + + + The kernel_configcheck task can also optionally report + if an option is overridden during processing. + + + + + For each output warning, a message points to the file + that contains a list of the options and a pointer to the config + fragment that defines them. + Collectively, the files are the key to streamlining the configiguration. + + + + To streamline the configuration, do the following: + + Start with a full configuration that you know + works - it builds and boots successfully. + This configuration file will be your baseline. + Separately run the configme and + kernel_configcheck tasks. + Take the resulting list of files from the + kernel_configcheck task warnings and do the following: + + Drop values that are redefined in the fragment but do not + change the final .config file. + Analyze and potentially drop values from the + .config file that override required + configurations. + Analyze and potentially remove non-board specific options. + + Remove repeated and invalid options. + + After you have worked through the output of the kernel configuration + audit, you can re-run the configme + and kernel_configcheck tasks to see the results of your + changes. + If you have more issues, you can deal with them as described in the + previous step. + + + + + Iteratively working through steps two through four eventually yields + a minimal, streamlined configuration file. + Once you have the best .config, you can build the Linux + Yocto kernel. + +
+
+
Handling a Package Name Alias