imx6ul: Yocto toolchain can't build kernel modules

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

imx6ul: Yocto toolchain can't build kernel modules

跳至解决方案
6,275 次查看
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?

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
4,235 次查看
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 项奖励
回复
3 回复数
4,235 次查看
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 项奖励
回复
4,236 次查看
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 项奖励
回复
2,943 次查看
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 项奖励
回复