[oe] Need advice on changing kernel.bbclass

Mike (mwester) mwester at dls.net
Thu Jun 7 04:30:31 UTC 2007

Deep inside kernel.bbclass, do_split_packages() is invoked, and one of the
arguments passed in is:
   "extra_depends='update-modules kernel-%s'...".

I need to make that conditional, so that when DISTRO=="unslung", it becomes:
   "extra_depends='update-modules kernel-image-%s'...".

Why, you ask?  Well, for good or bad, there are numerous NSLU2's out there
that are expecting kernel modules to depend upon "kernel-image-2.4.22-xfs",
not on "kernel-2.4.22-xfs".  Since we can't reinstall those systems to make
them accomodate the change (something changed, perhaps along with bitbake
1.8?), the reasonable solution is to adjust the build process so that we
generate kernel module ipks with the same dependencies that they used to be
built with.  Kernel modules are build "on the fly" inside kernel.bbclass
with some python code; that python code is what is establishing the
dependencies, and that's the code that needs to be adjusted to handle this

Before I commit hideous hackery on kernel.bbclass, I thought perhaps I
should appeal to the community for some advice and feedback on how best to
do this.  I was thinking a conditional in the python code would be easiest,
and cleanest.  I don't know how to write such a conditional, but lack of
knowlege has never stopped me before ;-)  Python can't be that hard to

If there's a better, suggestion, I'm open for it.  The Unslung kernel is
frozen at 2.4.22-xfs (since that's what Linksys ships, and we need to remain
compatible with their kernel modules and software).  That sort of means that
spending a lot of work on an elegant solution for Unslung is pretty much a
waste of time -- quick and simple, so that we can go about building some new
kernel modules and getting them into the feeds (with correct dependencies),
is the goal.

For completeness, below is the entire original source line out of

   do_split_packages(d, root='/lib/modules', file_regex=module_regex,
output_pattern=module_pattern, description='%s kernel module',
postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata,
extra_depends='update-modules kernel-%s' % bb.data.getVar("KERNEL_VERSION",
d, 1))

Mike (mwester)

More information about the Openembedded-devel mailing list