Customizing the Linux* Kernel

This chapter contains a brief overview of making kernel modifications. Customizing the kernel is important on embedded systems for making new devices and sensors. For more detailed information, see the [YKDM] at: http://www.yoctoproject.org/docs/latest/kernel-dev/kernel-dev.html. Check it out for additional ways of configuring the kernel, for example through using more compact and modular configuration fragments. The approach described here is good for ad-hoc modifications while config fragments are shorter than full kernel configuration, and it allows you to create and distribute your own Yocto recipes for modifying specific kernel features.

The base kernel config file is delivered with edison-src.tar.gz and is located in the edison-src/meta-intel-edison/meta-intel-edison-bsp/recipes-kernel/linux/files/defconfig file.

The menuconfig tool provides an easy interactive method with which to define kernel configurations. For general information on menuconfig, see http://en.wikipedia.org/wiki/Menuconfig. The following command opens the menuconfig terminal for configurations:

bitbake virtual/kernel -c menuconfig

Figure 2 – Linux kernel configuration

Linux kernel configuration

When the configuration is completed, replace defconfig with .config, then rename it back to defconfig. We also suggest taking a backup of the defconfig file. Force bitbake to copy the modified defconfig file to the actual build directory. Then the new image with modified kernel is ready to build.

cp <path_to_edison-src>/build/tmp/work/edison-poky-linux/linux- yocto/3.10.17+gitAUTOINC+6ad20f049a_c03195ed6e-r0/linux-edison-standard-build/.config <path_to_edison-src>/meta-intel-edison/meta-intel-edison-bsp/recipes-kernel/linux/files/defconfig

We can also change the Intel® Edison kernel configuration (i386_edison_defconfig) file and overwrite with customized kernel configuration by doing following:

cp <path_to_edison-src>/build/tmp/work/edison-poky-linux/linux-    yocto/3.10.17+gitAUTOINC+6ad20f049a_c03195ed6e-r0/linux-edison-standard-build/.config <path_to_edison-src>/build/tmp/work/edison-poky-linux/linux-yocto/3.10.17+gitAUTOINC+6ad20f049a_c03195ed6e-r0/linux/arch/x86/configs/i386_edison_defconfig
bitbake virtual/kernel –c configure –f –v
bitbake edison-image
For more complete information about compiler optimizations, see our Optimization Notice.