All of lore.kernel.org
 help / color / mirror / Atom feed
* Making header of out-of-tree module available
@ 2017-01-30 15:37 colin.helliwell
  2017-01-30 16:46 ` Daniel.
  0 siblings, 1 reply; 5+ messages in thread
From: colin.helliwell @ 2017-01-30 15:37 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 343 bytes --]

I have a recipe which builds my own (out-of-tree) driver module - this
packages/installs the module fine. (It's recipe has "inherit module"). 

Now I'm writing a recipe to build a library which uses the driver. What's
needed to get the driver's header file 'exported' so that it can be included
by the library's recipe?

Thanks

 


[-- Attachment #2: Type: text/html, Size: 2142 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Making header of out-of-tree module available
  2017-01-30 15:37 Making header of out-of-tree module available colin.helliwell
@ 2017-01-30 16:46 ` Daniel.
  2017-01-30 17:05   ` colin.helliwell
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel. @ 2017-01-30 16:46 UTC (permalink / raw)
  To: colin.helliwell; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 999 bytes --]

You don't, you make your library depends on your driver, and not on kernel
exported headers. In my case I add the header to the -dev package and make
the library compilation depend on kernel module.

# kernel-module-foo.bb
FILES_${PN}-dev = "/usr/include/foo/linux/foo.h"

# libfoo.bb
DEPENDS = "kernel-module-foo"

Cheers

2017-01-30 13:37 GMT-02:00 <colin.helliwell@ln-systems.com>:

> I have a recipe which builds my own (out-of-tree) driver module – this
> packages/installs the module fine. (It’s recipe has “inherit module”).
>
> Now I’m writing a recipe to build a library which uses the driver. What’s
> needed to get the driver’s header file ‘exported’ so that it can be
> included by the library’s recipe?
>
> Thanks
>
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
>


-- 
*"Do or do not. There is no try"*
  *Yoda Master*

[-- Attachment #2: Type: text/html, Size: 2036 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Making header of out-of-tree module available
  2017-01-30 16:46 ` Daniel.
@ 2017-01-30 17:05   ` colin.helliwell
  2017-01-30 17:13     ` Daniel.
  0 siblings, 1 reply; 5+ messages in thread
From: colin.helliwell @ 2017-01-30 17:05 UTC (permalink / raw)
  To: 'Daniel.'; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 2337 bytes --]

Thanks Daniel,

I’ve given that a try, but the header isn’t appearing (with ‘bitbake rfctrl’) anywhere but the module’s own workdir.

It’s recipe is

 

SUMMARY = " RF driver"

LICENSE = "GPLv2"

LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"

 

inherit module

 

SRC_URI = "file://Makefile \

           file://rfctrl.c \

           file://rfctrl.h \

           file://COPYING \

          "

 

FILES_${PN}-dev = "/usr/include/rfctrl/linux/rfctrl.h"

 

S = "${WORKDIR}"

 

 

With a makefile:

 

obj-m := rfctrl.o

 

SRC := $(shell pwd)

 

all:

                $(MAKE) -C $(KERNEL_SRC) M=$(SRC)

 

modules_install:

                $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install

 

clean:

                rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c

                rm -f Module.markers Module.symvers modules.order

                rm -rf .tmp_versions Modules.symvers

 

 

 

From: Daniel. [mailto:danielhilst@gmail.com] 
Sent: 30 January 2017 16:46
To: colin.helliwell@ln-systems.com
Cc: yocto@yoctoproject.org
Subject: Re: [yocto] Making header of out-of-tree module available

 

You don't, you make your library depends on your driver, and not on kernel exported headers. In my case I add the header to the -dev package and make the library compilation depend on kernel module.

# kernel-module-foo.bb <http://kernel-module-foo.bb> 

FILES_${PN}-dev = "/usr/include/foo/linux/foo.h" 

# libfoo.bb <http://libfoo.bb> 

DEPENDS = "kernel-module-foo"

Cheers

 

2017-01-30 13:37 GMT-02:00 <colin.helliwell@ln-systems.com <mailto:colin.helliwell@ln-systems.com> >:

I have a recipe which builds my own (out-of-tree) driver module – this packages/installs the module fine. (It’s recipe has “inherit module”). 

Now I’m writing a recipe to build a library which uses the driver. What’s needed to get the driver’s header file ‘exported’ so that it can be included by the library’s recipe?

Thanks

 


--
_______________________________________________
yocto mailing list
yocto@yoctoproject.org <mailto:yocto@yoctoproject.org> 
https://lists.yoctoproject.org/listinfo/yocto




-- 

"Do or do not. There is no try"
  Yoda Master


[-- Attachment #2: Type: text/html, Size: 11453 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Making header of out-of-tree module available
  2017-01-30 17:05   ` colin.helliwell
@ 2017-01-30 17:13     ` Daniel.
  2017-01-30 17:14       ` Daniel.
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel. @ 2017-01-30 17:13 UTC (permalink / raw)
  To: colin.helliwell; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 2720 bytes --]

do_install_append() {
    install -d ${D}/usr/include/nrf24/linux/
    install -m 0755 ${S}/include/linux/nrf24.h
${D}/usr/include/nrf24/linux/
}


Try something like this ^

Regards,

2017-01-30 15:05 GMT-02:00 <colin.helliwell@ln-systems.com>:

> Thanks Daniel,
>
> I’ve given that a try, but the header isn’t appearing (with ‘bitbake
> rfctrl’) anywhere but the module’s own workdir.
>
> It’s recipe is
>
>
>
> SUMMARY = " RF driver"
>
> LICENSE = "GPLv2"
>
> LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
>
>
>
> inherit module
>
>
>
> SRC_URI = "file://Makefile \
>
>            file://rfctrl.c \
>
>            file://rfctrl.h \
>
>            file://COPYING \
>
>           "
>
>
>
> FILES_${PN}-dev = "/usr/include/rfctrl/linux/rfctrl.h"
>
>
>
> S = "${WORKDIR}"
>
>
>
>
>
> With a makefile:
>
>
>
> obj-m := rfctrl.o
>
>
>
> SRC := $(shell pwd)
>
>
>
> all:
>
>                 $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
>
>
>
> modules_install:
>
>                 $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
>
>
>
> clean:
>
>                 rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
>
>                 rm -f Module.markers Module.symvers modules.order
>
>                 rm -rf .tmp_versions Modules.symvers
>
>
>
>
>
>
>
> *From:* Daniel. [mailto:danielhilst@gmail.com]
> *Sent:* 30 January 2017 16:46
> *To:* colin.helliwell@ln-systems.com
> *Cc:* yocto@yoctoproject.org
> *Subject:* Re: [yocto] Making header of out-of-tree module available
>
>
>
> You don't, you make your library depends on your driver, and not on kernel
> exported headers. In my case I add the header to the -dev package and make
> the library compilation depend on kernel module.
>
> # kernel-module-foo.bb
>
> FILES_${PN}-dev = "/usr/include/foo/linux/foo.h"
>
> # libfoo.bb
>
> DEPENDS = "kernel-module-foo"
>
> Cheers
>
>
>
> 2017-01-30 13:37 GMT-02:00 <colin.helliwell@ln-systems.com>:
>
> I have a recipe which builds my own (out-of-tree) driver module – this
> packages/installs the module fine. (It’s recipe has “inherit module”).
>
> Now I’m writing a recipe to build a library which uses the driver. What’s
> needed to get the driver’s header file ‘exported’ so that it can be
> included by the library’s recipe?
>
> Thanks
>
>
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
>
>
>
> --
>
> *"Do or do not. There is no try"*
> *  Yoda Master*
>



-- 
*"Do or do not. There is no try"*
  *Yoda Master*

[-- Attachment #2: Type: text/html, Size: 10458 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Making header of out-of-tree module available
  2017-01-30 17:13     ` Daniel.
@ 2017-01-30 17:14       ` Daniel.
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel. @ 2017-01-30 17:14 UTC (permalink / raw)
  To: colin.helliwell; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 3051 bytes --]

At your kernel-module-<foo>.bb

:)

2017-01-30 15:13 GMT-02:00 Daniel. <danielhilst@gmail.com>:

> do_install_append() {
>     install -d ${D}/usr/include/nrf24/linux/
>     install -m 0755 ${S}/include/linux/nrf24.h
> ${D}/usr/include/nrf24/linux/
> }
>
>
> Try something like this ^
>
> Regards,
>
> 2017-01-30 15:05 GMT-02:00 <colin.helliwell@ln-systems.com>:
>
>> Thanks Daniel,
>>
>> I’ve given that a try, but the header isn’t appearing (with ‘bitbake
>> rfctrl’) anywhere but the module’s own workdir.
>>
>> It’s recipe is
>>
>>
>>
>> SUMMARY = " RF driver"
>>
>> LICENSE = "GPLv2"
>>
>> LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
>>
>>
>>
>> inherit module
>>
>>
>>
>> SRC_URI = "file://Makefile \
>>
>>            file://rfctrl.c \
>>
>>            file://rfctrl.h \
>>
>>            file://COPYING \
>>
>>           "
>>
>>
>>
>> FILES_${PN}-dev = "/usr/include/rfctrl/linux/rfctrl.h"
>>
>>
>>
>> S = "${WORKDIR}"
>>
>>
>>
>>
>>
>> With a makefile:
>>
>>
>>
>> obj-m := rfctrl.o
>>
>>
>>
>> SRC := $(shell pwd)
>>
>>
>>
>> all:
>>
>>                 $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
>>
>>
>>
>> modules_install:
>>
>>                 $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
>>
>>
>>
>> clean:
>>
>>                 rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
>>
>>                 rm -f Module.markers Module.symvers modules.order
>>
>>                 rm -rf .tmp_versions Modules.symvers
>>
>>
>>
>>
>>
>>
>>
>> *From:* Daniel. [mailto:danielhilst@gmail.com]
>> *Sent:* 30 January 2017 16:46
>> *To:* colin.helliwell@ln-systems.com
>> *Cc:* yocto@yoctoproject.org
>> *Subject:* Re: [yocto] Making header of out-of-tree module available
>>
>>
>>
>> You don't, you make your library depends on your driver, and not on
>> kernel exported headers. In my case I add the header to the -dev package
>> and make the library compilation depend on kernel module.
>>
>> # kernel-module-foo.bb
>>
>> FILES_${PN}-dev = "/usr/include/foo/linux/foo.h"
>>
>> # libfoo.bb
>>
>> DEPENDS = "kernel-module-foo"
>>
>> Cheers
>>
>>
>>
>> 2017-01-30 13:37 GMT-02:00 <colin.helliwell@ln-systems.com>:
>>
>> I have a recipe which builds my own (out-of-tree) driver module – this
>> packages/installs the module fine. (It’s recipe has “inherit module”).
>>
>> Now I’m writing a recipe to build a library which uses the driver. What’s
>> needed to get the driver’s header file ‘exported’ so that it can be
>> included by the library’s recipe?
>>
>> Thanks
>>
>>
>>
>>
>> --
>> _______________________________________________
>> yocto mailing list
>> yocto@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
>>
>>
>>
>>
>> --
>>
>> *"Do or do not. There is no try"*
>> *  Yoda Master*
>>
>
>
>
> --
> *"Do or do not. There is no try"*
>   *Yoda Master*
>



-- 
*"Do or do not. There is no try"*
  *Yoda Master*

[-- Attachment #2: Type: text/html, Size: 11205 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-30 17:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-30 15:37 Making header of out-of-tree module available colin.helliwell
2017-01-30 16:46 ` Daniel.
2017-01-30 17:05   ` colin.helliwell
2017-01-30 17:13     ` Daniel.
2017-01-30 17:14       ` Daniel.

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.