Re: proper way to create an out-of-tree kernel modules


Quentin Schulz
 

Hi Kent,

On Tue, Mar 03, 2020 at 09:32:55AM -0500, Kent Dorfman wrote:
What is the proper way to create a recipe to build a kernel module
outside of the normal kernel tree?

The kernel sources need to be expanded and configured for the typical
kernel makefile line

make -C $(KERNEL_SRC) M=$(PWD) V=1 ARCH=$(ARCH) \
CROSS_COMPILE=$(CROSS_COMPILE) modules

to work.

Are there any sample/stubs available that demonstrate building and
deploying a simple kernel module?
inherit module should usually be enough in the recipe AFAICT.

There might be some fixes to do in Makefiles but nothing crazy.

c.f. https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#incorporating-out-of-tree-modules
http://git.yoctoproject.org/cgit.cgi/poky/tree/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb

Quentin

Join yocto@lists.yoctoproject.org to automatically receive all group messages.