This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/BEAGLEBK: Building kernel module out-of-tree

Part Number: BEAGLEBK

Tool/software: Linux

Hi,

I use Yocto build system to build my bootloaders, Linux kernel and root file system, ...etc. Now I need to build my own Linux driver as a kernel module. This is driver does not refer to other symbols of the Linux kernel source tree.

I have seen different ways to building the kernel modules out-of-tree:

1. Create a Yocto recipe in my own layer, then build as a part of building the kernel.

2. Run $bitbake -c devshell virtual/kernel. Then build the driver under the devshell.

These do not seem to be ideal: If I am a kernel driver developer, I would prefer not to write an additional Yocto recipe or use a bitbake command.

So the questions are:

1. Is there a way to use only the Yocto generated toolchain (for example, Yocto generate SDK) and without using bitbake commands to build a kernel module out-of-tree?

2. What is a recommended way to do this?

Thank you.