Skip to contentSkip to conversation

Building out of tree module into kernel image

DISCUSSION Fan Zhang 2 participants 3 messages Sep 6, 2017

lore
Share & tools
lore

Fan Zhang

author
#0 lore raw

Hi,

I've followed the Yocto manual here: http://www.yoctoproject.org/docs/1.6.1/kernel-dev/kernel-dev.html#incorporating-out-of-tree-modules to include an out of tree module, named axidma. I can build this module alone by

bitbake axidma

and get the .ko file in build/tmp/work/my_machine/axidma directory, but when I build my custom image, and include this module by

MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-axidma"

I got an error that says "/Computing transaction...error: Can't install packagegroup-core-boot-1.0-r17@microzed_zynq7: no package provides kernel-module-axidma/". All the other variables mentioned in the manual doesn't compile the module either. They just doesn't stop the image from building.

After googling for a few days, it seems every thread I found stucked at different stage of this problem, some advance further than me, but from my very limited knowledge about bitbake, out of tree modules should be included into the build by module.bbclass, which has do_configuration, do_compile and do _install in that class. So it is quite puzzling why this is not working.

Any pointer is greatly appreciated. Thanks. Below are the configurations for my module:

My axidma folder structure is this

/axidma (a directory under recipes-sgl directory) /

/    - files (directory)
/

/            - COPYING/

/            - dma_proxy.c/

/            - dma_proxy.h/

/            - Makefile
/

/    - axidma.bb/

The bb files in axidma directory is added to BBFILES in layer.conf by

       /BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \//
       //    ${LAYERDIR}/recipes-*/*/*.bbappend"/

axidma.bb file looks like this:

       /SUMMARY = "Example of how to build an external Linux kernel module"
       LICENSE = "GPLv2"
       LIC_FILES_CHKSUM =
       "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"

       inherit module
       PR = "r0"
       PV = "0.1"
       SRC_URI = "file://Makefile \
                   file://dma_proxy.c \
                   file://dma_proxy.h \
                   file://COPYING \
                  "

       S = "${WORKDIR}"

       # The inherit of module.bbclass will automatically name module
       packages with
       # "kernel-module-" prefix as required by the oe-core build
       environment./

Makefile looks like this:

       /obj-m := dma_proxy.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/

Fan Zhang

begin:vcard
fn:Fan Zhang
n:Zhang;Fan
org:Sander Geophysics Ltd.
email;internet:[email protected]
title:Electronics Design Engineer
tel;work:(613)521-9626
version:2.1
end:vcard

#1 lore raw

Hi,

Where did you put MACHINE_ESSENTIAL_EXTRA_RDEPENDS instruction? Did you try to rename axidma.bb to kernel-module-axidma.bb ?

Best Regards,
Vincent

2017-09-06 16:13 GMT+02:00 Fan Zhang <[email protected]>:

Quoted 109 lines

Hi,

I've followed the Yocto manual here: http://www.yoctoproject.org/
docs/1.6.1/kernel-dev/kernel-dev.html#incorporating-out-of-tree-modules to include an out of tree module, named axidma. I can build this module alone by

bitbake axidma

and get the .ko file in build/tmp/work/my_machine/axidma directory, but when I build my custom image, and include this module by

MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-axidma"

I got an error that says "*Computing transaction...error: Can't install packagegroup-core-boot-1.0-r17@microzed_zynq7: no package provides kernel-module-axidma*". All the other variables mentioned in the manual doesn't compile the module either. They just doesn't stop the image from building.

After googling for a few days, it seems every thread I found stucked at different stage of this problem, some advance further than me, but from my very limited knowledge about bitbake, out of tree modules should be included into the build by module.bbclass, which has do_configuration, do_compile and do _install in that class. So it is quite puzzling why this is not working.

Any pointer is greatly appreciated. Thanks. Below are the configurations for my module:

My axidma folder structure is this

*axidma (a directory under recipes-sgl directory) *

* - files (directory) *

* - COPYING*

* - dma_proxy.c*

* - dma_proxy.h*

* - Makefile *

* - axidma.bb <http://axidma.bb>*

The bb files in axidma directory is added to BBFILES in layer.conf by

*BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \*
* ${LAYERDIR}/recipes-*/*/*.bbappend"*

axidma.bb file looks like this:

*SUMMARY = "Example of how to build an external Linux kernel module" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e" inherit module PR =
"r0" PV = "0.1" SRC_URI = "file://Makefile \ file://dma_proxy.c
\ file://dma_proxy.h \ file://COPYING \ " S
= "${WORKDIR}" # The inherit of module.bbclass will automatically name module packages with # "kernel-module-" prefix as required by the oe-core build environment.*

Makefile looks like this:

*obj-m := dma_proxy.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*

Fan Zhang

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

author
#2 lore raw

Hi Vincent

Thanks for the quick reply. The MACHINE_ESSENTIAL_EXTRA_RDEPENDS  instruction was put in the local.conf in my build folder.

After renaming axidma.bb to kernel-module-axidma.bb. The image build picked up this module. Thanks you so much.

There is this comments in the module sample bb file/ /

/# The inherit of module.bbclass will automatically name module packages with/
/# "kernel-module-" prefix as required by the oe-core build environment. /

leaded me to believe this is done automatically by bitbake. Thanks again.

Best regards,

Fan

/
/

Quoted 112 lines · Vincent Prince

Hi,

Where did you put MACHINE_ESSENTIAL_EXTRA_RDEPENDS  instruction?
Did you try to rename axidma.bb <http://axidma.bb/> to kernel-module-axidma.bb <http://kernel-module-axidma.bb> ?

Best Regards,
Vincent

2017-09-06 16:13 GMT+02:00 Fan Zhang <[email protected] <mailto:[email protected]>>:

Hi,

I've followed the Yocto manual here:
http://www.yoctoproject.org/docs/1.6.1/kernel-dev/kernel-dev.html#incorporating-out-of-tree-modules
<http://www.yoctoproject.org/docs/1.6.1/kernel-dev/kernel-dev.html#incorporating-out-of-tree-modules>
to include an out of tree module, named axidma. I can build this module alone by

bitbake axidma

and get the .ko file in build/tmp/work/my_machine/axidma directory, but when I build my custom image, and include this module by

MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "kernel-module-axidma"

I got an error that says "/Computing transaction...error: Can't install packagegroup-core-boot-1.0-r17@microzed_zynq7: no package provides kernel-module-axidma/". All the other variables mentioned in the manual doesn't compile the module either. They just doesn't stop the image from building.

After googling for a few days, it seems every thread I found stucked at different stage of this problem, some advance further than me, but from my very limited knowledge about bitbake, out of tree modules should be included into the build by module.bbclass, which has do_configuration, do_compile and do _install in that class. So it is quite puzzling why this is not working.

Any pointer is greatly appreciated. Thanks. Below are the configurations for my module:

My axidma folder structure is this

/axidma (a directory under recipes-sgl directory) /

/    - files (directory)
/

/            - COPYING/

/            - dma_proxy.c/

/            - dma_proxy.h/

/            - Makefile
/

/    - axidma.bb <http://axidma.bb>/

The bb files in axidma directory is added to BBFILES in layer.conf by

/BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \// //    ${LAYERDIR}/recipes-*/*/*.bbappend"/

axidma.bb <http://axidma.bb> file looks like this:

/SUMMARY = "Example of how to build an external Linux kernel module"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"

inherit module
PR = "r0"
PV = "0.1"
SRC_URI = "file://Makefile \
file://dma_proxy.c \
file://dma_proxy.h \
file://COPYING \
          "

S = "${WORKDIR}"

# The inherit of module.bbclass will automatically name module packages with
# "kernel-module-" prefix as required by the oe-core build environment./

Makefile looks like this:

/obj-m := dma_proxy.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/

Fan Zhang

Quoted 8 lines

--
_______________________________________________
yocto mailing list
[email protected] <mailto:[email protected]>
https://lists.yoctoproject.org/listinfo/yocto
<https://lists.yoctoproject.org/listinfo/yocto>

begin:vcard
fn:Fan Zhang
n:Zhang;Fan
org:Sander Geophysics Ltd.
email;internet:[email protected]
title:Electronics Design Engineer
tel;work:(613)521-9626
version:2.1
end:vcard