All of lore.kernel.org
 help / color / mirror / Atom feed
* how to "compute" path to install module file
@ 2018-03-22  7:31 Vincent Daanen
  2018-03-22 10:22 ` Vincent Daanen
  2018-03-22 13:37 ` Stephano Cetola
  0 siblings, 2 replies; 4+ messages in thread
From: Vincent Daanen @ 2018-03-22  7:31 UTC (permalink / raw)
  To: yocto

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

Hi,

I'm porting the makefile to build SocketCan for Ixxat on yocto. At this time I successfully build the module file.
I now have to install it in the target image.

The "install" procedure from the original makefile does not work out-of-the-box. It copies files in the following directories starting by /lib and thus it tries to install in the host system, not the target system..

In order to install in the target image, the installation is performed in a customized do_install function in the bb file, and the problem starts here !

In the original makefile, installation process copies a file in the following directory : /lib/modules/$(shell uname -r)/kernel/drivers/net/.....

In the bb file, I "compute" the kernel version using ${KERNEL_VERSION}

Thus the bb file contains the following lines:

#MODDIR = Module file destination directory
MODDIR ="${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers/net/can/ixxat"

do_install() {
        install -d ${D}${base_libdir}/firmware
        install -m 0755 ${WORKDIR}/can-ibxxx_socketcan/ixx-can-ib-1.9.3.fw ${D}${base_libdir}/firmware
        install -d ${D}${MODDIR}
        install -m 0755 ${WORKDIR}/can-ibxxx_socketcan/ixx_pci.ko ${D}${MODDIR}
}
FILES_${PN} += " ${base_libdir}/firmware ${MODDIR}"

Build fails with the following error:
nothing provides kernel-module-ixx-pci-4.12.14-yocto-standard needed by kernel-module-ixxat-candriver-1.0-r0.qemux86_64

I don't understand how yocto computes to module filename. It adds the kernel-version to the default filename...
Is it the standard way for computing module filename with yocto (I searched and did not find any info about this) or could it be a side-effect of my bb file (and in this case, how can I identify where this side-effect occurs) or .. maybe if bug in bitbake ??

Thanks for helping

Vincent


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

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

* Re: how to "compute" path to install module file
  2018-03-22  7:31 how to "compute" path to install module file Vincent Daanen
@ 2018-03-22 10:22 ` Vincent Daanen
  2018-03-22 13:37 ` Stephano Cetola
  1 sibling, 0 replies; 4+ messages in thread
From: Vincent Daanen @ 2018-03-22 10:22 UTC (permalink / raw)
  To: yocto


[-- Attachment #1.1: Type: text/plain, Size: 1867 bytes --]

Hi,

I'm porting the makefile to build SocketCan for Ixxat on yocto. At this time I successfully build the module file.
I now have to install it in the target image.

The "install" procedure from the original makefile does not work out-of-the-box. It copies files in the following directories starting by /lib and thus it tries to install in the host system, not the target system..

In order to install in the target image, the installation is performed in a customized do_install function in the bb file, and the problem starts here !

In the original makefile, installation process copies a file in the following directory : /lib/modules/$(shell uname -r)/kernel/drivers/net/.....

In the bb file, I "compute" the kernel version using ${KERNEL_VERSION}

Thus the bb file contains the following lines:

#MODDIR = Module file destination directory
MODDIR ="${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers/net/can/ixxat"

do_install() {
        install -d ${D}${base_libdir}/firmware
        install -m 0755 ${WORKDIR}/can-ibxxx_socketcan/ixx-can-ib-1.9.3.fw ${D}${base_libdir}/firmware
        install -d ${D}${MODDIR}
        install -m 0755 ${WORKDIR}/can-ibxxx_socketcan/ixx_pci.ko ${D}${MODDIR}
}
FILES_${PN} += " ${base_libdir}/firmware ${MODDIR}"

Build fails with the following error:
nothing provides kernel-module-ixx-pci-4.12.14-yocto-standard needed by kernel-module-ixxat-candriver-1.0-r0.qemux86_64

I don't understand how yocto computes to module filename. It adds the kernel-version to the default filename...
Is it the standard way for computing module filename with yocto (I searched and did not find any info about this) or could it be a side-effect of my bb file (and in this case, how can I identify where this side-effect occurs) or .. maybe if bug in bitbake ??

Thanks for helping

Vincent


[-- Attachment #1.2: Type: text/html, Size: 5562 bytes --]

[-- Attachment #2: ATT00001.txt --]
[-- Type: text/plain, Size: 145 bytes --]

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

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

* Re: how to "compute" path to install module file
  2018-03-22  7:31 how to "compute" path to install module file Vincent Daanen
  2018-03-22 10:22 ` Vincent Daanen
@ 2018-03-22 13:37 ` Stephano Cetola
  2018-03-23 15:07   ` Vincent Daanen
  1 sibling, 1 reply; 4+ messages in thread
From: Stephano Cetola @ 2018-03-22 13:37 UTC (permalink / raw)
  To: Vincent Daanen; +Cc: yocto

On 3/22/18 12:31 AM, Vincent Daanen wrote:
> Hi, 
> 
> I’m porting the makefile to build SocketCan for Ixxat on yocto. At this
> time I successfully build the module file.

Have you checked out the CANopen drivers?
https://github.com/ros-industrial/ros_canopen
https://github.com/bmwcarit/meta-ros/tree/master/recipes-ros/ros-canopen

There are already recipes for this if it happens to work for your part.

Just figured I'd mention it :)

For adding the Ixxat driver, this documentation might help:
https://www.yoctoproject.org/docs/current/kernel-dev/kernel-dev.html#working-with-out-of-tree-modules

> 
> Build fails with the following error:
> 
> nothing provides kernel-module-ixx-pci-4.12.14-yocto-standard needed by
> kernel-module-ixxat-candriver-1.0-r0.qemux86_64

Do you have a recipe that provides ixx-pci? If so it needs to say:

PROVIDES = "ixx-pci"

https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#var-PROVIDES

Also, you need to be sure that it is being built, so I would add that
recipe into some RDEPENDS variable, for example:

MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "ixx-pci"

(in this case in your machine conf, assuming the package name is "ixx-pci")

> 
> I don’t understand how yocto computes to module filename. It adds the
> kernel-version to the default filename…

check out the "module_pattern" variables in:
meta/classes/kernel-module-split.bbclass

I believe this is done during packaging.

Cheers,
Stephano



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

* Re: how to "compute" path to install module file
  2018-03-22 13:37 ` Stephano Cetola
@ 2018-03-23 15:07   ` Vincent Daanen
  0 siblings, 0 replies; 4+ messages in thread
From: Vincent Daanen @ 2018-03-23 15:07 UTC (permalink / raw)
  To: Stephano Cetola; +Cc: yocto

Hi 
Thanks for your answer, it helps me to get module installation work.

But now I have another problem ... Stay tune the mail willarrive soon on the mailing list

> On 3/22/18 12:31 AM, Vincent Daanen wrote:
> > Hi,
> > 
> > I'm porting the makefile to build SocketCan for Ixxat on yocto. At 
> > this time I successfully build the module file.
>
> Have you checked out the CANopen drivers?
> https://github.com/ros-industrial/ros_canopen
> https://github.com/bmwcarit/meta-ros/tree/master/recipes-ros/ros-canopen
>
> There are already recipes for this if it happens to work for your part.
>
> Just figured I'd mention it :)
>
> For adding the Ixxat driver, this documentation might help:
> https://www.yoctoproject.org/docs/current/kernel-dev/kernel-dev.html#working-with-out-of-tree modules
>
> > 
> > Build fails with the following error:
> > 
> > nothing provides kernel-module-ixx-pci-4.12.14-yocto-standard needed 
> > by kernel-module-ixxat-candriver-1.0-r0.qemux86_64
>
> Do you have a recipe that provides ixx-pci? If so it needs to say:
>
> PROVIDES = "ixx-pci"
>
> https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#var-PROVIDES
>
> Also, you need to be sure that it is being built, so I would add that recipe into some RDEPENDS variable, > > for example:
>
> MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "ixx-pci"
>
> (in this case in your machine conf, assuming the package name is "ixx-pci")
>
> > 
> > I don't understand how yocto computes to module filename. It adds the 
> > kernel-version to the default filename...
>
> check out the "module_pattern" variables in:
> meta/classes/kernel-module-split.bbclass
>
> I believe this is done during packaging.
>
> Cheers,
> Stephano



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

end of thread, other threads:[~2018-03-23 15:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-22  7:31 how to "compute" path to install module file Vincent Daanen
2018-03-22 10:22 ` Vincent Daanen
2018-03-22 13:37 ` Stephano Cetola
2018-03-23 15:07   ` Vincent Daanen

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.