Configuring the Kernel
- Configuring the Yocto Project 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 interactively modify your .config
- file to create the leanest kernel configuration file possible.
+ Configuring the Yocto Project 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.
+ You can also save known configurations in a
+ defconfig file that the build system can use
+ for kernel configuration.
+
+
+
+ This section describes how to use menuconfig,
+ create and use configuration fragments, and how to interactively
+ modify your .config file to create the
+ leanest kernel configuration file possible.
@@ -4660,18 +4669,23 @@
oe-init-build-env-memres
script found in the
Build Directory.
- The following commands run menuconfig assuming the
- Source Directory
- top-level folder is ~/poky:
+ You must also be sure of the state of your build in the
+ Source Directory.
+ The following commands run menuconfig
+ assuming the Source Directory's top-level folder is
+ ~/poky:
$ cd poky
$ source oe-init-build-env
+ $ bitbake linux-yocto -c kernel_configme -f
$ bitbake linux-yocto -c menuconfig
- Once menuconfig comes up, its standard interface allows you to
- interactively examine and configure all the kernel configuration parameters.
- After making your changes, simply exit the tool and save your changes to
- create an updated version of the .config configuration file.
+ Once menuconfig comes up, its standard
+ interface allows you to interactively examine and configure
+ all the kernel configuration parameters.
+ After making your changes, simply exit the tool and save your
+ changes to create an updated version of the
+ .config configuration file.
@@ -4752,6 +4766,70 @@
+
+ Creating a defconfig File
+
+
+ A defconfig file is simply a
+ .config renamed to "defconfig".
+ You can use a defconfig file
+ to retain a known set of kernel configurations from which the
+ OpenEmbedded build system can draw to create the final
+ .config file.
+
+ Out-of-the-box, the Yocto Project never ships a
+ defconfig or
+ .config file.
+ The OpenEmbedded build system creates the final
+ .config file used to configure the
+ kernel.
+
+
+
+
+ To create a defconfig, start with a
+ complete, working Linux kernel .config
+ file.
+ Copy that file to the appropriate
+ ${PN}
+ directory in your layer's
+ recipes-kernel/linux directory, and rename
+ the copied file to "defconfig".
+ Then, add the following lines to the linux-yocto
+ .bbappend file in your layer:
+
+ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+ SRC_URI += "file://defconfig"
+
+ The
+ SRC_URI
+ tells the build system how to search for the file, while the
+ FILESEXTRAPATHS
+ extends the
+ FILESPATH
+ variable (search directories) to include the
+ ${PN} directory you created to hold the
+ configuration changes.
+
+ The build system applies the configurations from the
+ defconfig file before applying any
+ subsequent configuration fragments.
+ The final kernel configuration is a combination of the
+ configurations in the defconfig
+ file and any configuration fragments you provide.
+ You need to realize that if you have any configuration
+ fragments, the build system applies these on top of and
+ after applying the existing defconfig file configurations.
+
+ For more information on configuring the kernel, see the
+ "Changing the Configuration"
+ and
+ "Generating Configuration Files"
+ sections, both in the Yocto Project Linux Kernel Development
+ Manual.
+
+
+
Creating Configuration Fragments