Customizing the Linux kernel - sgunin/somlabs-extra GitHub Wiki

Configure build environment Build SomLabs Yocto release:

$ cd ~/somlabs
$ . setup-environment build

The default kernel configuration file used by Yocto is part of the kernel source tree and is located at:

~/somlabs/sources/meta-somlabs/recipes-kernel/linux/linux-fslc

Run menuconfig and configure the kernel:

$ bitbake -c menuconfig linux-fslc

When finished, save and exit.

The .config file is saved to ~/somlabs/tmp/work/visionsom6ull-poky-linux-gnueabi/linux-fslc/4.20+gitAUTOINC+bf414f71d7-r0/build/.

At this point your can build image with the newly configured kernel, or just build the kernel by running $ bitbake linux-fslc, or, you can follow the next steps to use this configuration permanently.

To save the configuration in a defconfig format:

$ bitbake -c savedefconfig linux-fslc

The defconfig file is saved to ~/somlabs/tmp/work/visionsom6ull-poky-linux-gnueabi/linux-fslc/4.20+gitAUTOINC+bf414f71d7-r0/build/defconfig.

To make the kernel recipe use this configuration permanently, you can do either of the following:

  • Use any of the three methods described in the Making changes in the source code section below to overwrite the default configuration file in the source tree, and replace it with the above defconfig.
  • Make the kernel recipe use the defconfig from outside of the source tree:

Copy your defconfig:

$ cd ~/somlabs/sources/meta-somlabs-extra
$ mkdir -p recipes-kernel/linux/files
$ cp  ~/somlabs/tmp/work/visionsom6ull-poky-linux-gnueabi/linux-fslc/4.20+gitAUTOINC+bf414f71d7-r0/build/defconfig recipes-kernel/linux/files/defconfig

Create a linux-fslc_%.bbappend file:

$ vi recipes-kernel/linux/linux-fslc_%.bbappend

and append the following to it:

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://defconfig"
KERNEL_DEFCONFIG_var-som-mx6 = "${WORKDIR}/custom_defconfig"
COMPATIBLE_MACHINE = "(visionsom6ull)"