Bug 4423

Summary: module autoload fails on danny when ipk is used
Product: [Documentation] General Docs Reporter: Trevor Woerner <twoerner>
Component: docs-generalAssignee: Tom Zanussi <tom.zanussi>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: Medium CC: richard.purdie, ross.burton, sgw, tom.zanussi
Version: 1.3.2   
Target Milestone: 1.3.2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Bug Depends on: 4484    
Bug Blocks:    
Attachments:
Description Flags
these files required to complete the "steps to reproduce" none

Description Trevor Woerner 2013-04-26 01:27:09 UTC
Created attachment 1201 [details]
these files required to complete the "steps to reproduce"

This issue is in reference to the Yocto Project's kernel lab, as
presented at ELC 2013:
https://www.yoctoproject.org/tools-resources/presentations/working-kernel

Following the steps for lab 3, when PACKAGE_CLASSES is set to "package_ipk" the
auto-loaded module is not automatically loaded as expected. It does work,
however, when the default "package_rpm" is used.

I noticed this initially on openSUSE 12.2. I have since upgraded to openSUSE
12.3 and can no longer run these labs because qemu-native fails to build
(due to unrelated isssues). I have, however, installed Fedora 18 (64) in a
VM and can reproduce these same steps with that distribution. NOTE: openSUSE
12.3 can build qemu-native from poky's HEAD just fine.

All of my steps assume you are performing these exercises in
/home/trevor/devel/yocto/lab, you'll have to adjust the attached files
as necessary for your layout


Steps to reproduce:
- download https://www.yoctoproject.org/sites/yoctoproject.org/files/elc-2013-layers.tar.bz2
  to $HOME
$ cd
$ tar -xf files.tar [from this issue's attachment]
$ mkdir -p $HOME/devel/yocto/lab
$ cd /home/trevor/devel/yocto/lab
$ mkdir lab_rpm
$ cd lab_rpm
$ git clone git://git.yoctoproject.org/poky.git
$ cd poky
$ git checkout -b danny remotes/origin/danny
$ bzip2 -d < $HOME/elc-2013-layers.tar.bz2
$ source oe-init-build-env
$ cp $HOME/files/local.conf conf
[edit and adjust paths in conf/local.conf as necessary]
$ cp $HOME/files/bblayers.conf conf
[edit and adjust paths in conf/bblayers.conf as necessary]
$ cp $HOME/files/lab3-qemux86.conf ../meta-lab3-qemux86/conf/machine
$ cp $HOME/files/linux-yocto-custom.bb ../meta-lab3-qemux86/recipes-kernel/linux
$ bitbake core-image-minimal
$ runqemu tmp/deploy/images/bzImage-lab3-qemux86.bin tmp/deploy/images/core-image-minimal-lab3-qemux86.ext3

When the image comes up, login as root and run:
# lsmod

In this case you'll see that the yocto module is loaded (as expected)

Now terminate your shell. Starting with a brand-new shell repeat all of the
above steps again. This time, however, do your work in
/home/trevor/devel/yocto/lab/lab_ipk instead. Also, when you adjust your
conf/local.conf, switch the PACKAGE_CLASSES to "package_ipk" from the
default "package_rpm".

This time when you log into your image and run "lsmod" there won't be any
kernel modules loaded.


NOTE: when performing these exact steps with poky's HEAD (instead of using the
danny branch) everything works just fine whether the packaging is rpm or ipk.
Comment 1 Tom Zanussi 2013-04-30 19:07:45 UTC
I'm changing the summary from "elc-2013 kernel lab: lab3 fails if PACKAGE_CLASSES = package_ipk" to better reflect the problem.

Because the labs need to be upgraded anyway for dylan, doing that will fix this problem for users and a new bug has been opened for that:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=4440

The root problem however still needs to be fixed in danny.
Comment 2 Richard Purdie 2013-05-29 09:48:32 UTC
This is a danny bug, move to danny.
Comment 3 Ross Burton 2013-05-29 10:08:30 UTC
Tom, I've not looked at the kernel lab yet, do you have a hunch as to what the problem could be?
Comment 4 Tom Zanussi 2013-05-29 13:25:06 UTC
No idea, but I'll look into it now..
Comment 5 Tom Zanussi 2013-06-07 14:57:06 UTC
In danny with ipk, there is no /etc/modules file, and /etc/init.d/modutils.sh only looks at /etc/modules when autoloading modules.

In danny with rpm, /etc/modules exists and /etc/init.d/modutils.sh finds it and loads the modules listed there, including our yocto-testmod module from the lab.

In dylan with ipk, there is still no /etc/modules, but there is /etc/modules-load.d/*.conf files including our yocto-testmod.conf from the lab.  /etc/init.d/modutils.sh in dylan has been changed to autoload the modules named in the *.conf files listed in /etc/init.d/modutils.sh, so in this case correctly autoloads the test module from the lab.

In danny with ipk, the /etc/modules-load.d/yocto-testmod.conf file for the lab is there, but modutils.sh in danny doesn't look for it, but /etc/modules instead, so doesn't autoload the module.

So, either figure out why /etc/modules doesn't get generated in the ipk case, or bring the modutils.sh change that reads /etc/modules-load.d from dylan to danny.
Comment 6 Tom Zanussi 2013-06-10 19:33:48 UTC
So it seems /etc/modules doesn't get created because update-modules doesn't get run at postinstall, because we're using core-image-minimal for the lab, which doesn't have package-management and therefore doesn't run postinstalls.

I believe this bug describes the problem:

Bug 4484 - Postinstalls don't run for ipk if package-management is disabled

So marking this bug as blocking on 4484.
Comment 7 Tom Zanussi 2013-07-03 13:51:39 UTC
Please see bug 4484 for a more detailed explanation, but the proper fix for this doesn't seem trivial:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=4484

There are a couple hacks that can work around this, but they don't seem like things that would be accepted into danny.

Because this is a problem that goes back at least to denzil, it's also not a regression, so for that reason as well wouldn't normally be a candidate for a point release either.

Also, because this is not a problem in dylan and because the kernel lab has been updated to dylan, the easy workaround is to use the new dylan kernel lab:

https://www.yoctodev.org/tools-resources/training/kernel-lab

If this is really still a problem anyone thinks is something we need to put resources into to fix in danny, please let me know, and I'll open a brand new bug with the same title as 4484 but for danny.