Compiling and loading kernel module drivers with Y

2019-07-25 15:19发布

问题:

I'm compiling a Linux kernel and root file system for a Dart board from this manual: http://variwiki.com/index.php?title=VAR-SOM-MX6_Yocto_Fido_New_R2

Now, I want to include extra drivers for attaching a WiFi USB dongle to my compiled version. I figured out how to compile the modules myself with the kernel Makefile, but I want them to be compiled and packaged with the RFS when I run bitbake on the project. I know the names of the kernel objects I need - ath.ko, ath9k.ko, ath9k_common.ko, ath0k_hw.ko and ath9k_htc.ko.

I have no prior experience with Yocto, so I would appreciate a somewhat detailed explanation.

So my questions are, given the kernel objects / modules / drivers I need:

  • How do I make Yocto compile them when compiling the kernel?
  • How do I make Yocto package the resulting compiled kernel modules in the RFS image it creates?

回答1:

Clean up the Kernel sstate-cache bitbake -c cleansstate kernelName

To do configuration to the kernel, you could use this command

bitbake kernelName -c menuconfig

Then, Compile the kernel after configuration

bitbake kernelName

There is a kernel lab tutorial in Yocto that teaches the basic of kernel configuration, available here.