[yocto] Building out of tree module into kernel image

Fan Zhang fzhang at sgl.com
Wed Sep 6 07:13:52 PDT 2017


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 at 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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20170906/fd471646/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fzhang.vcf
Type: text/x-vcard
Size: 175 bytes
Desc: not available
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20170906/fd471646/attachment.vcf>


More information about the yocto mailing list