[yocto] Including a header from an external kernel module

Michael Allwright michael.allwright at ulb.ac.be
Tue Jul 10 00:11:23 PDT 2018


Am I correct in expecting that, if I do everything correctly, my header
file from module-a should end up
in ~/poky/build/tmp/work-shared/machine/kernel-source/include/linux/mfd

Michael Allwright

Postdoctoral Researcher at IRIDIA
Phone: +32 2 650 2273
Email: michael.allwright at ulb.ac.be


On Tue, 10 Jul 2018 at 07:53, Michael Allwright <michael.allwright at ulb.ac.be>
wrote:

>
>
> On Tue., 10 Jul. 2018, 00:15 Andre McCurdy, <armccurdy at gmail.com> wrote:
>
>> On Mon, Jul 9, 2018 at 3:07 PM, Michael Allwright
>> <michael.allwright at ulb.ac.be> wrote:
>> > Yes, it ended up in the development package in the do_install_append
>> > attempt
>>
>> How did you confirm that (ie that the header ended up in the
>> module-a-dev package) ?
>
>
> In the build directory, I can see that the header file is in the
> module-a-dev directory under split packages.
>
>
>> > , but I couldn't #include it in the second module (file didn't exist
>> > in the include search paths).
>>
>> Did you add:
>>
>>   DEPENDS = "module-a"
>>
>> to the module-b recipe?
>>
>
> Yes, I did this.
>
> > I would point out though, that I am interested in what is the correct
>> way to
>> > do this, and not just in finding some workaround / hack so that it
>> works...
>>
>> That's good to hear.
>>
>
> So am I on the right track or should I be doing this differently?
>
>
>> > On Mon., 9 Jul. 2018, 19:47 Andre McCurdy, <armccurdy at gmail.com> wrote:
>> >>
>> >> On Mon, Jul 9, 2018 at 8:27 AM, Michael Allwright
>> >> <michael.allwright at ulb.ac.be> wrote:
>> >> > Hello,
>> >> >
>> >> > I think it would be useful to extend the hello-mod recipe in
>> >> > meta-skeleton
>> >> > to demonstrate some slightly more complicated scenarios. For
>> example, I
>> >> > am
>> >> > trying to find out how to have two external kernel modules A and B,
>> >> > where
>> >> > module B #includes a header file provided by module A.
>> >> >
>> >> > I have made module B depend on module A, however, I believe I am
>> still
>> >> > missing one or two steps in my recipe for module A such that the
>> header
>> >> > file
>> >> > is copied into the shared kernel staging directory where module B can
>> >> > find
>> >> > it.
>> >> >
>> >> > So far I have tried the following:
>> >> >
>> >> > FILES_${PN}-dev += "/usr/include/linux/mfd/module-a.h"
>> >> >
>> >> > FILES_kernel-headers += "${includedir}/linux/mfd/module-a.h"
>> >> >
>> >> > do_install_append () {
>> >> >    install -d ${D}${includedir}/linux/mfd
>> >> >    install -m 644 ${S}/module-a
>> ${D}${includedir}/linux/mfd/module-a.h
>> >> > }
>> >>
>> >> And what happened after you tried the above? Did the header not end up
>> >> in the -dev package for module A? Did the module A recipe not create a
>> >> -dev package? Something else?
>> >>
>> >> > In module B, I want to be able to:
>> >> >
>> >> > #include <linux/mfd/module-a.h>
>> >> >
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20180710/164cd53e/attachment-0001.html>


More information about the yocto mailing list