Bug 7591 - More reliable external kernel module selection
Summary: More reliable external kernel module selection
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: kernel (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 2.0
Assignee: California Sullivan
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-04-09 15:27 UTC by Paul Eggleton
Modified: 2015-10-21 19:25 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Eggleton 2015-04-09 15:27:37 UTC
If you have an out-of-tree kernel module recipe and simply add kernel-module-xyz to MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS in the machine config, the module may not actually appear in the image - the reason being that the kernel recipe itself claims via PACKAGES_DYNAMIC that it provides kernel-module-.* and thus the dependency is satisfied as far as bitbake is concerned, and since it is a RRECOMMENDS it doesn't matter that it isn't satisfied at runtime. The workaround is to explicitly name the external kernel module recipe somewhere (or the main dummy package it builds) such that it is forced to build.

It seems to me at minimum we need to document this in the kernel development manual. Another option would be to document that the user should explicitly add the package names to PACKAGES in their module recipe, which bitbake will take in preference to PACKAGES_DYNAMIC from the kernel - though someone would need to verify that this actually works.
Comment 1 California Sullivan 2015-07-27 22:04:35 UTC
I did some testing on the other option. It seems to work.

With no changes to any other recipes, adding MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS = "kernel-module-hello" to the machine conf (with "hello" being the module that hello-mod in yocto-skeleton creates), there was no error reported and the module was not put in the image.

After adding PACKAGES = "kernel-module-hello" to the hello-mod_0.1.bb recipe and rebuilding, the module "hello" was added to the image.
Comment 2 California Sullivan 2015-10-21 19:25:26 UTC
Documentation updated; see commit 2c51eae23b634cdace5a119ee1a6c8e8ba76dc45 in the yocto-docs repo.