Yocto external kernel module including public header

Viewed 361
1 Answers

After chatting on yocto mailinglist I got the impression, that it is uncommon for kernel modules to install their own headers. Hence I opted for a simple do_install_append() into hello-mod.bb, like this:

do_install_append() {
    install -d ${D}${includedir}/
    install -m 644 ${S}/header.h ${D}${includedir}/header.h
}
FILES_${PN} += "${includedir}"

With a DEPENDS entry other recipes can now access the header via sysroot.

Regarding a solution inside the module Makefile: I found some reference about "make headers_install" but couldn't figure out to integrate this into my module Makefile, see How do I specify header files for make headers_install in an out-of-tree kernel module?

Related