Add precompiled Module to Yocto Image

Showing results for 
Search instead for 
Did you mean: 

Add precompiled Module to Yocto Image

Contributor III

Hello Everybody,

I am a little confused about the correct way, how to add a precompiled module to my Yocto Image. I thought the easiest way is to create a new recipe.



DESCRIPTION = "Install of several kernel modules"

kmoddir = "/lib/modules/${KERNEL_VERSION}/wlan"

SRC_URI = "file://modules/compat.ko \
file://modules/sxcfg80211.ko \
file://modules/wlan.ko \

FILES_${PN} += "/lib/modules/ ${kmoddir} ${kmoddir}/compat.ko ${kmoddir}/sxcfg80211.ko ${kmoddir}/wlan.ko"

do_install() {
install -d ${D}${kmoddir}
install -m 0755 ${WORKDIR}/modules/compat.ko ${D}${kmoddir}
install -m 0755 ${WORKDIR}/modules/sxcfg80211.ko ${D}${kmoddir}
install -m 0755 ${WORKDIR}/modules/wlan.ko ${D}${kmoddir}


The recipe built is successfully, the modules are available in the rootfs, but not at the correct location. The modules are located in "/lib/modules/wlan" but the correct path should be "/lib/modules/KERNEL_VERSION/wlan".

So I checked the ${KERNEL_VERSION} variable and it´s empty. How can I access this variable in my recipe? Do I need a special include?

My second idea was to add the module by inherit module to my recipe. There is also an example located in poky/meta-skeleton/recipes-kernel/hello-mod. My main problem is that the module recipes tries always to compile my own recipe. But there is nothing to compile, my kernel images are precompiled.

So that´s why I am confused and not sure which is the correct approach?

Thanks for any help,

Labels (3)
0 Kudos
1 Reply

NXP TechSupport
NXP TechSupport

Hi Patrick,

I guess KERNEL_VERSION should be declare or is not part of yocto, you have to use the whole kernel version you are using.

0 Kudos