Tuesday, April 19, 2011

Linux kernel modules configuration on Yocto Project Bernard

For the last two weeks, I have been working on developing custom Linux OS image using Yocto Project system. One of the requirement is that the device should support V4L(1|2) and various USB webcam. However the default kernel configuration does not contain the required options.

I have been trying to:
- add defconfig file into recipes but it is always been ignored by Bitbake
- add partial kernel config fragment into recipes but not applied by Bitbake
- overriding defconfig in the build source directly but ignored by Bitbake

Finally I could do that by using "menuconfig" command. Here is the step:

$ bitbake -f -c compile virtual/kernel

let it finish, call menuconfig and recompile

$ bitbake -f -c menuconfig virtual/kernel

Select the appropriate drivers you require

$ bitbake -f -c compile virtual/kernel
$ bitbake -f -c deploy virtual/kernel

Go to the "tmp/deploy/images", check your modules-xxx.tgz to see if you can find your modules. For me, the way I check is like this:

$ tar -ztf modules-xxx.tgz | grep v4l

Hope this is useful.