imx6ul: Yocto toolchain can't build kernel modules

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6ul: Yocto toolchain can't build kernel modules

Jump to solution
4,716 Views
sudomasaaki
Contributor II

In an sdk built with

bitbake core-image-directfb -c populate_sdk

there is no lib/modules/<kernel_version>/build folder to do kernel modules building, only lib/modules/<kernel_version>.

To my config file I added 

TOOLCHAIN_TARGET_TASK_append = " kernel-devsrc kernel-dev packagegroup-core-buildessential"

but still no result. Now I'm building kernel modules over ~/fsl-community-bsp/build/tmp/work/imx6ulevk-poky-linux-gnueabi/linux-imx/4.1.15-r0/build/ folder and it works, but it's an overkill. Working in a team I want to give others toolchain so that they can build kernel modules using it. What do I have to add to config file so that my toolchain would have modules "build" folder? Any solution?

Labels (1)
Tags (2)
0 Kudos
1 Solution
2,676 Views
sudomasaaki
Contributor II

With a bit of studying I learned that build/ folder is actually just a symlink to /usr/src/kernel, did a simple Makefile but still got errors about some scripts aren't being present. So, you have to execute a "make modules_prepare" in kernel folder to make your toolchain ready for kernel modules building. Hope this helps others!

View solution in original post

0 Kudos
3 Replies
2,676 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi Sudo,

Thats correct!  Before compile kernel driver you need to prepare the modules and install any software on your host such as.

$ sudo apt-get install build-essential module-assistant

Then:

$ sudo make modules_prepare

Regards

0 Kudos
2,677 Views
sudomasaaki
Contributor II

With a bit of studying I learned that build/ folder is actually just a symlink to /usr/src/kernel, did a simple Makefile but still got errors about some scripts aren't being present. So, you have to execute a "make modules_prepare" in kernel folder to make your toolchain ready for kernel modules building. Hope this helps others!

0 Kudos
1,384 Views
maral_e
Contributor I
Hi, I am new to yocto and Linux. I am trying to build a yocto image for MYD-C8MMX board.
I can't include CH341 and CP210X drivers in the image.
I built myir-image-core image and enabled drivers in "bitbake -c menuconfig virtual/kernel". And when I check Image, ch341 and cp210x are enabled. But when I boot it on the board, drivers are not there. (still enabled)

Can you please explain what should I do after "make modules_prepare"?
Also, "bitbake -e virtual/kernel | grep ^S="
output: S="/home/user/MYD-C8MMX-Yocto/build/tmp/work/myd-imx8mm-poky-linux/build/5.4-r0/git"
Is it kernel folder?
0 Kudos