Bug 6668

Summary: Kernel recipes imeta-intel override contents of KERNEL_MODULE_AUTOLAD
Product: [Build System, Metadata & Runtime] BSPs Reporter: josep.puigdemont
Component: bsps-meta-intelAssignee: Nitin Kamble <nitin.a.kamble>
Status: VERIFIED FIXED QA Contact: Andra Necula <andrax.g.necula>
Severity: normal    
Priority: Medium+ CC: alexandru.c.georgescu, tom.zanussi
Version: unspecified   
Target Milestone: 1.7 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Patch to fix this issue none

Description josep.puigdemont 2014-08-29 08:41:39 UTC
The current kernel recipes in the meta-intel layer use the following convention
for kernel modules that need to be autoloaded:
KERNEL_MODULE_AUTOLOAD_core2-32-intel-common += "uio"

When using the override with the += operator we're only appending to the
override variable (KERNEL_MODULE_AUTOLOAD_core2-32-intel-common). Bitbake will
thus eventually substitue KERNEL_MODULE_AUTOLOAD by whatever
KERNEL_MODULE_AUTOLOAD_core2-32-intel-common contains, if core2-32-intel-common
is found in the OVERRIDES variable, effectively overriding all previous content
of the variable KERNEL_MODULE_AUTOLOAD that other layers may have modified.

Unless this is intended, the preferred way to add a kernel module to the
autoload list would probably be the following:
KERNEL_MODULE_AUTOLOAD_append_core2-32-intel-common = " uio"

This will append to the KERNEL_MODULE_AUTOLOAD variable in case
core2-32-intel-common is found in the OVERRIDES variable (i.e. it will not
override the variable as it happened in the previous case).

Steps to reproduce the issue:
clone poky, meta-intel and meta-virtualization from git.yoctoproject.org
clone meta-openembedded from git.openembedded.org
Make sure the following layers are added in conf/bblayers.conf:
  meta-intel
  meta-openembedded/meta-networking
  meta-virtualization
In conf/local.conf make sure MACHINE is set properly, and add some kernel
modules to the image:
MACHINE = "intel-corei7-64"
IMAGE_INSTALL_append = " kernel-module-kvm kernel-module-kvm-intel kernel-module-uio"

Now build core-image-minimal:
bitbake core-image-minimal

In the final image, check the contents of /etc/modules-load.d/. Although
meta-virtualization adds kvm and kvm-intel to KERNEL_MODULE_AUTOLOAD, the
directory only contains the "uio" module. This is because all other modules
have been overriden by the kernel recipes in meta-intel.
Comment 1 josep.puigdemont 2014-08-29 08:44:04 UTC
Created attachment 2099 [details]
Patch to fix this issue

After applying this patch, and with the same setup provided in the description, build again core-image-minimal.
Check once more the contents of the /etc/modules-load.d/ directory. This time you should be able to see all modules:
kvm.conf  kvm-intel.conf  uio.conf
Comment 3 Andra Necula 2014-09-29 14:52:20 UTC
I followed the steps for reproducing the issue, but I get this error

ERROR:No recipes available for:
/home/andra/WEEKLY/pokynou/poky/meta-virtualization/recipes-kernel/linux/linux-yocto_3.4.bbappend

host Ubuntu 14.04
poky:8ac8eca2e3bd8c78e2b31ea974930ed0243258a3

I thinking that the virtualization layer is not updated for  the linux-yocto 3.4 kernel.

Can you attach a patch for linux-yocto_3.4?
Thank in advance
Comment 4 josep.puigdemont 2014-09-29 15:03:40 UTC
(In reply to comment #3)
> I followed the steps for reproducing the issue, but I get this error
> 
> ERROR:No recipes available for:
> /home/andra/WEEKLY/pokynou/poky/meta-virtualization/recipes-kernel/linux/
> linux-yocto_3.4.bbappend
> 
> host Ubuntu 14.04
> poky:8ac8eca2e3bd8c78e2b31ea974930ed0243258a3
> 
> I thinking that the virtualization layer is not updated for  the linux-yocto
> 3.4 kernel.
> 
> Can you attach a patch for linux-yocto_3.4?

You're right, the .bbappend for the 3.4 linux version should be removed in the meta-virtualization layer, and a new one for 3.17 be added to line up with the current available kernel versions in the upstream yocto project.

For the moment you can build with BB_DANGLINGAPPENDS_WARNONLY="1" in your local.conf, so you will only get a warning instead of an error.

> Thank in advance