Steps to build out of tree kernel modules using Yocto SDK

One of the good feature of Yocto is SDK, it provides application team/developers to concentrate on their application and platform team to concentrate on image customizations.

To provide SDK with the kernel source, you need to add the following in your local.conf/machine.conf file

TOOLCHAIN_TARGET_TASK_append = " kernel-devsrc"

This will include the Kernel Source code in the SDK. Generate SDK after adding the above configuration using the following command.

bitbake -c populate_sdk core-image-sato

SDK will be present in 'build/tmp/deploy/sdk' folder. Install this SDK on the machine where you want to build kernel modules.

Steps to use this SDK to build out of tree kernel modules:

1. Source the environment file for your SDK
2. cd to <SDKInstallPath>/sysroots/<mach>/usr/src/kernel and run 'make modules_prepare'
3. Now to compile the hello world or any other module.
KERNEL_SRC=<SDKInstallPath>/sysroots/<mach>/usr/src/kernel make


Comments

  1. Hi sir,

    I have tried this for beagebone black, could you tell me how to Source the environment file (first step)

    ReplyDelete

Post a Comment

Popular posts from this blog

bb.utils.contains yocto

make config vs oldconfig vs defconfig vs menuconfig vs savedefconfig

PR, PN and PV Variable in Yocto