Skip to contentSkip to conversation

Need advice on changing kernel.bbclass

DISCUSSION Mike (mwester) 3 participants 7 messages Jun 7, 2007

lore
Share & tools
lore
#0 lore raw

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 situation.

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 learn.

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 kernel.bbclass:

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))

Thanks!
Mike (mwester)

#1 lore raw

RPROVIDES_kernel-2.4.22-xfs = "kernel-image-2.4.22-xfs" should solve your problem.

Change was in kernel*.bbclass and it was discussed on this list - thread "[oe] RFC: Kernel image packaging" from 14 March this year.

Signature · 4 lines
JID: hrw-jabber.org
OpenEmbedded developer/consultant

                 change your mind. it's starting to smell.
#2 lore raw

----- Original Message -----
From: "Marcin Juszkiewicz" <[email protected]>
To: <[email protected]>
Sent: Thursday, June 07, 2007 1:39 AM
Subject: Re: [oe] Need advice on changing kernel.bbclass

Quoted 3 lines

RPROVIDES_kernel-2.4.22-xfs = "kernel-image-2.4.22-xfs" should solve your problem.

I've made the change, and the build is starting...

but I'm not sure about this. This will instruct ipkg that the package "kernel-2.4.22-xfs" will satisify the dependency for "kernel-image-2.4.22-xfs", right? That's not the problem I've faced with right now; I don't need to generate extra information for the kernel-*.ipk --- that won't help the hundreds and hundreds of devices already installed. I need instead to alter the information in the generated kernel-module-*.ipk files so that they do not have a dependency on kernel-2.4.22-xfs (as the installed devices do not, according to the old packaging, have that dependency satisfied -- instead they feature only kernel-image-2.4.22-xfs).
Or do I misunderstand the RPROVIDES/RDEPENDS mechanism?

Quoted 2 lines

Change was in kernel*.bbclass and it was discussed on this list - thread "[oe] RFC: Kernel image packaging" from 14 March this year.

I'll dig up that thread for review. Clearly this is not a high-priority problem, if it's taken almost 3 months for this issue to surface since this change to kernel.bbclass was made -- clearly adding kernel modules to the feeds for the older releases is not a common things any more. But there is a (reasonable) request in the queue, so I'd like to find a way to get those modules built (that doesn't require the user to "upgrade" their installation entirely, especially since I have no intention at this time of building a new release for them to upgrade to!)

Thanks!
Mike (mwester)

#3 lore raw
In reply to Marcin Juszkiewicz

Build completed, with this suggestion. :( No joy:

Package: kernel-module-binfmt-misc
Version: 2.4.22.l2.3r63-r18.5
Depends: update-modules, kernel-2.4.22-xfs
Section: kernel

The kernel modules built remain firm in their conviction that they depend upon the kernel, not kernel-image.

Mike (mwester)

----- Original Message -----
From: "Marcin Juszkiewicz" <[email protected]>
To: <[email protected]>
Sent: Thursday, June 07, 2007 1:39 AM
Subject: Re: [oe] Need advice on changing kernel.bbclass

Quoted 20 lines

RPROVIDES_kernel-2.4.22-xfs = "kernel-image-2.4.22-xfs" should solve your problem.

Change was in kernel*.bbclass and it was discussed on this list - thread "[oe] RFC: Kernel image packaging" from 14 March this year.

Signature · 11 lines
JID: hrw-jabber.org
OpenEmbedded developer/consultant

                 change your mind. it's starting to smell.



_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
#4 lore raw
Quoted 5 lines · Mike (mwester)
Quoted 2 lines

RPROVIDES_kernel-2.4.22-xfs = "kernel-image-2.4.22-xfs" should solve your problem.

Build completed, with this suggestion.  :(  No joy:

Quoted 7 lines

Package: kernel-module-binfmt-misc
Version: 2.4.22.l2.3r63-r18.5
Depends: update-modules, kernel-2.4.22-xfs
Section: kernel

The kernel modules built remain firm in their conviction that they depend upon the kernel, not kernel-image.

OK, they depend on kernel-2.4.22-xfs but it provide kernel-image-2.4.22-xfs so your users should be able to upgrade rather.

Or I have bug in thinking (which is possible).

Signature · 4 lines
JID: hrw-jabber.org
OpenEmbedded developer/consultant

     Linux in the cellular phone is not a question of 'if', but 'when'
#5 lore raw
In reply to Mike (mwester)
Quoted 9 lines · Mike (mwester)

Build completed, with this suggestion. :( No joy:

Package: kernel-module-binfmt-misc
Version: 2.4.22.l2.3r63-r18.5
Depends: update-modules, kernel-2.4.22-xfs
Section: kernel

The kernel modules built remain firm in their conviction that they depend upon the kernel, not kernel-image.

I stand by the reasoning for the reasoning for the change as detailed by the thread mentioned - it did address some underlying problems. It was assumed anyone rebuilding the modules could release a new kernel package too hence avoiding this dependency problem.

On the NSLU2, kernel-image-2.4.22-xfs is probably an empty package? as will be kernel-2.4.22-xfs? Would it be possible to have both 'empty' packages in the feed? You could always have one have a Depends: on the other?

Cheers,

Richard

#6 lore raw

Yes indeed - I agree with the reasoning for the change; I think the current scheme is far closer to "correct" in terms of dependencies than the old one.

I poked at the existing kernel-2.4.22-xfs and kernel-image-2.4.22-xfs ipkgs and dependencies on both the original (in the field) Unslung images, and on the images as built by OE today. As it turns out, on the original image, kernel-image-2.4.22-xfs is not empty (it claims to contain the compressed kernel image), however kernel-2.4.22-xfs does not exist at all. So if I understand ipkg and dependencies correctly, I believe that your suggestion (adding an empty package to the feeds) should work fine.

Thanks for you suggestion -- I'll go work on that direction instead!

Regards,
Mike (mwester)

----- Original Message -----
From: "Richard Purdie" <[email protected]>
To: <[email protected]>
Sent: Thursday, June 07, 2007 1:45 PM
Subject: Re: [oe] Need advice on changing kernel.bbclass

Quoted 9 lines · Mike (mwester)
Quoted 8 lines

Build completed, with this suggestion. :( No joy:

Package: kernel-module-binfmt-misc
Version: 2.4.22.l2.3r63-r18.5
Depends: update-modules, kernel-2.4.22-xfs
Section: kernel

The kernel modules built remain firm in their conviction that they

depend

Quoted 15 lines
Quoted 1 line

upon the kernel, not kernel-image.

I stand by the reasoning for the reasoning for the change as detailed by the thread mentioned - it did address some underlying problems. It was assumed anyone rebuilding the modules could release a new kernel package too hence avoiding this dependency problem.

On the NSLU2, kernel-image-2.4.22-xfs is probably an empty package? as will be kernel-2.4.22-xfs? Would it be possible to have both 'empty' packages in the feed? You could always have one have a Depends: on the other?

Cheers,

Richard