Kernel modules not in root filesystem

Yocto related software discussions are here

Kernel modules not in root filesystem

Postby pcglue » Mon Oct 26, 2015 2:03 am

When building Yocto for wandboard-dual, kernel modules are not in the root fs. My root fs has no '/lib/modules' directory. I am expecting things like the usbserial and ftdi_sio driver modules to be there, or somewhere, but they are nowhere to be found. Do you have a /lib/modules directory in your yocto image for wandboard? Where else can kernel modules be?
pcglue
 
Posts: 6
Joined: Sat May 23, 2015 6:57 am

Re: Kernel modules not in root filesystem

Postby madisox » Mon Oct 26, 2015 12:00 pm

You could try adding this to your conf/local.conf file:
Code: Select all
IMAGE_INSTALL += "kernel-modules"

which should force the build to include all of the kernel modules in your image. If you still don't see the modules you're expecting, check your kernel config to make sure they're being included in the kernel build.
madisox
 
Posts: 18
Joined: Sat Jan 17, 2015 3:33 pm

Re: Kernel modules not in root filesystem

Postby pcglue » Wed Oct 28, 2015 6:40 am

Thanks madisox, that worked. My kernel config is actually another problem I have. I created a defconfig and bbappend recipe for the kernel config I want, but the .config with my kernel config in it gets overwritten by another .config (and the .config with my stuff in it gets renamed .config.old). I can't figure out what is doing that or why. Have you come across this before?
pcglue
 
Posts: 6
Joined: Sat May 23, 2015 6:57 am

Re: Kernel modules not in root filesystem

Postby madisox » Wed Oct 28, 2015 12:13 pm

What's in your bbappend, and what did you name your replacement config file?

The typical approach to doing this is to create your own metadata layer and put your recipe modifications in there, typically using a directory structure identical to the other layers. So you'd have a file called meta-yourlayer/recipes-kernel/linux/linux-wandboard_3.14.28.bbappend (the specific version will vary depending on which version of the Yocto system you're using, it must match whatever you have in your copy of meta-fsl-arm-extra) with at least this line:
Code: Select all
FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:"

Then, in a subdirectory called linux-wandboard-3.14.28 under where the recipe resides, you'd put your copy of the kernel configuration, in a file called "defconfig".

If that's how you did this, make sure the top-level directory for your layer is listed in the BBLAYERS setting in your conf/bblayers.conf file. If it's there, you can do some debugging with
Code: Select all
bitbake -e linux-wandboard >xx.log

to dump bitbake's environment info and examine xx.log for references to your bbappend file. If you don't see it mentioned there, then something's messed up with your layer configuration. If you do see it there, try
Code: Select all
bitbake -c fetch linux-wandboard

and examine the resulting log.do_fetch file under tmp/work/... to see where bitbake was looking for "defconfig". If you don't see your directory mentioned, then something was probably wrong with your FILESEXTRAPATHS setting.
madisox
 
Posts: 18
Joined: Sat Jan 17, 2015 3:33 pm

Re: Kernel modules not in root filesystem

Postby pcglue » Thu Oct 29, 2015 7:41 am

I did create my own meta layer and my bbappend is named linux-wandboard_3.14.28.bbappend and just contains:

Code: Select all
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://defconfig"

When I did bitbake -e, I do find a reference to my bbappend file. It is the last entry in BBINCLUDED.

The directory containing my defconfig is the first one in log.do_fetch.

I don't think there's an issue with my defconfig being used or not. It is being used. But something then overwrites my defconfig.

I found my defconfig in build/tmp/work/wandboard-dual-poky-linux-gnueabi/linux-wandboard/3.14.28-r0
It is also in .config.old in build/tmp/work/wandboard-dual-poky-linux-gnueabi/linux-wandboard/3.14.28-r0/build

But the .config in in build/tmp/work/wandboard-dual-poky-linux-gnueabi/linux-wandboard/3.14.28-r0/build is not mine.
My .config seems to have been renamed to .config.old and replaced with this one.

The only culprit it might be is this in my do_configure (My complete do_configure here: http://pastebin.com/zPfuSwTV):
Code: Select all
eval oe_runmake_call -C /home/user/yocto/fsl-bsp/build/tmp/work/wandboard-dual-poky-linux-gnueabi/linux-wandboard/3.14.28-r0/git O=/home/user/yocto/fsl-bsp/build/tmp/work/wandboard-dual-poky-linux-gnueabi/linux-wandboard/3.14.28-r0/build oldnoconfig || yes '' | oe_runmake -C /home/user/yocto/fsl-bsp/build/tmp/work/wandboard-dual-poky-linux-gnueabi/linux-wandboard/3.14.28-r0/git O=/home/user/yocto/fsl-bsp/build/tmp/work/wandboard-dual-poky-linux-gnueabi/linux-wandboard/3.14.28-r0/build oldconfig

There's that "oldconfig" at the end there that seems suspicious, but I don't know what this is for or what to do about it.

Thank you for your help.
pcglue
 
Posts: 6
Joined: Sat May 23, 2015 6:57 am

Re: Kernel modules not in root filesystem

Postby madisox » Thu Oct 29, 2015 11:56 am

pcglue wrote:I did create my own meta layer and my bbappend is named linux-wandboard_3.14.28.bbappend and just contains:

Code: Select all
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://defconfig"

When I did bitbake -e, I do find a reference to my bbappend file. It is the last entry in BBINCLUDED.

The directory containing my defconfig is the first one in log.do_fetch.

Great. The SRC_URI addition is redundant (harmlessly so), since "file://defconfig" is already part of it in the base recipe. You only need the FILESEXTRAPATHS prepend to override where it's looking for that file.

The only culprit it might be is this in my do_configure (My complete do_configure here: http://pastebin.com/zPfuSwTV):
Code: Select all
eval oe_runmake_call -C /home/user/yocto/fsl-bsp/build/tmp/work/wandboard-dual-poky-linux-gnueabi/linux-wandboard/3.14.28-r0/git O=/home/user/yocto/fsl-bsp/build/tmp/work/wandboard-dual-poky-linux-gnueabi/linux-wandboard/3.14.28-r0/build oldnoconfig || yes '' | oe_runmake -C /home/user/yocto/fsl-bsp/build/tmp/work/wandboard-dual-poky-linux-gnueabi/linux-wandboard/3.14.28-r0/git O=/home/user/yocto/fsl-bsp/build/tmp/work/wandboard-dual-poky-linux-gnueabi/linux-wandboard/3.14.28-r0/build oldconfig

There's that "oldconfig" at the end there that seems suspicious, but I don't know what this is for or what to do about it.


That looks normal enough. You could try running the run.do_configure script manually with bash -x to see what commands are being executed, but if you're starting from a clean build tree, it should be copying your defconfig to git/.config and running the above commands to have the kernel build system process that file and spit out a complete configuration into build/.config. That configuration should be the same or a superset of what's in your configuration, depending on how you created yours.

How did you create your defconfig? It's usually best to use
Code: Select all
bitbake -c menuconfig linux-wandboard
to use the kernel's configurator to tweak things, and use the save option in that tool to create your modified config file, just to make sure you're not missing out on any configuration dependencies or conflicts.
madisox
 
Posts: 18
Joined: Sat Jan 17, 2015 3:33 pm

Re: Kernel modules not in root filesystem

Postby pcglue » Mon Nov 02, 2015 4:12 am

I think the ultimate issue is that the config I wanted (CONFIG_REMOTEPROC) can't be specified by itself. It's intended as a dependency for other modules and those top-level modules are the ones I need to include, which will in turn include CONFIG_REMOTEPROC. The kernel configuration process somehow knows this and removes it when it's by itself.
pcglue
 
Posts: 6
Joined: Sat May 23, 2015 6:57 am

Re: Kernel modules not in root filesystem

Postby Umamahesh » Fri Oct 06, 2017 3:05 pm

Hi

I am trying to add an sample char driver in the yocto's kernel as built in. When menuconfig it display the driver added. but when I compile and boot the kernel I do not see the driver coming up there and I don't see the device node too being created. Can anyone help me for the procedure. I have posted already in another thread for reference.

Anyone have idea where IMAGE_INSTALL_append= "ltp" package get downloaded?? and how to add test cases in the ltp.

Looking for suggestions, please do needful.

Thanks
Umamahesh
 
Posts: 14
Joined: Fri May 26, 2017 11:56 am


Return to Software - Yocto

Who is online

Users browsing this forum: No registered users and 2 guests