Skip to contentSkip to conversation

update-alternatives and kernel modules

DISCUSSION Mark Hatle 3 participants 5 messages Mar 12, 2013 – Mar 13, 2013

lore
Share & tools
lore

Mark Hatle

author
#0 lore raw

I have someone who is trying to use update-alternatives with kernel modules.

They discovered that the rename code changes the name of the module to end in .ko.${BPN}. While the package.bbclass code specifically looks for the file name to end in '.ko' in order to avoid stripping the modules... so of course the modules get stripped and no longer work properly.

So my question is, is it even reasonable to use update-alternatives with kernel modules? If it is, we probably need to change the trigger in packages.bbclass to look for either .ko or .ko.${BPN} (or something similar).

Any comments/suggestions?
--Mark

#1 lore raw
Quoted 7 lines · Mark Hatle

I have someone who is trying to use update-alternatives with kernel modules.

They discovered that the rename code changes the name of the module to end in .ko.${BPN}. While the package.bbclass code specifically looks for the file name to end in '.ko' in order to avoid stripping the modules... so of course the modules get stripped and no longer work properly.

Quoted 6 lines

So my question is, is it even reasonable to use update-alternatives with kernel modules? If it is, we probably need to change the trigger in packages.bbclass to look for either .ko or .ko.${BPN} (or something similar).

Any comments/suggestions?

I'm having a hard time wrapping my head around what they are trying to achieve. Can you describe it from a non-packaging point of view ?

i.e. do they have two kernel modules that provide the same sort of services to the kernel and they want to switch between the two of them based on the alternatives mechanism ?

Cheers,

Bruce

Quoted 6 lines

--Mark

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"
author
#2 lore raw
Quoted 13 lines · Bruce Ashfield
Quoted 12 lines · Mark Hatle

I have someone who is trying to use update-alternatives with kernel modules.

They discovered that the rename code changes the name of the module to end in .ko.${BPN}. While the package.bbclass code specifically looks for the file name to end in '.ko' in order to avoid stripping the modules... so of course the modules get stripped and no longer work properly.

So my question is, is it even reasonable to use update-alternatives with kernel modules? If it is, we probably need to change the trigger in packages.bbclass to look for either .ko or .ko.${BPN} (or something similar).

Quoted 8 lines
Quoted 1 line

Any comments/suggestions?

I'm having a hard time wrapping my head around what they are trying to achieve. Can you describe it from a non-packaging point of view ?

i.e. do they have two kernel modules that provide the same sort of services to the kernel and they want to switch between the two of them based on the alternatives mechanism ?

Yes, that is exactly it. For some reason they have two kernel modules that have the same name, same external behavior.. but internally there are code changes. Using the update-alternatives mechanism they have selected one version is "better" then the other.

(Frankly this seems bogus to me.. which is why I'm asking the question. Is this even supported or is this simply "don't do that".)

--Mark

Quoted 13 lines

Cheers,

Bruce

Quoted 6 lines

--Mark

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 23 lines · Mark Hatle
Quoted 13 lines · Bruce Ashfield
Quoted 12 lines · Mark Hatle

I have someone who is trying to use update-alternatives with kernel modules.

They discovered that the rename code changes the name of the module to end in .ko.${BPN}. While the package.bbclass code specifically looks for the file name to end in '.ko' in order to avoid stripping the modules... so of course the modules get stripped and no longer work properly.

So my question is, is it even reasonable to use update-alternatives with kernel modules? If it is, we probably need to change the trigger in packages.bbclass to look for either .ko or .ko.${BPN} (or something similar).

Quoted 8 lines
Quoted 1 line

Any comments/suggestions?

I'm having a hard time wrapping my head around what they are trying to achieve. Can you describe it from a non-packaging point of view ?

i.e. do they have two kernel modules that provide the same sort of services to the kernel and they want to switch between the two of them based on the alternatives mechanism ?

Quoted 7 lines

Yes, that is exactly it. For some reason they have two kernel modules that have the same name, same external behavior.. but internally there are code changes. Using the update-alternatives mechanism they have selected one version is "better" then the other.

(Frankly this seems bogus to me.. which is why I'm asking the question. Is this even supported or is this simply "don't do that".)

Cannot you rename them in do_install to module-foo.${BPN}.ko and set ALTERNATIVE_TARGET_kernel-module-foo[foo] to module-foo.${BPN}.ko ?

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
author
#4 lore raw
Quoted 29 lines · Martin Jansa
Quoted 28 lines · Mark Hatle
Quoted 13 lines · Bruce Ashfield
Quoted 12 lines · Mark Hatle

I have someone who is trying to use update-alternatives with kernel modules.

They discovered that the rename code changes the name of the module to end in .ko.${BPN}. While the package.bbclass code specifically looks for the file name to end in '.ko' in order to avoid stripping the modules... so of course the modules get stripped and no longer work properly.

So my question is, is it even reasonable to use update-alternatives with kernel modules? If it is, we probably need to change the trigger in packages.bbclass to look for either .ko or .ko.${BPN} (or something similar).

Quoted 8 lines
Quoted 1 line

Any comments/suggestions?

I'm having a hard time wrapping my head around what they are trying to achieve. Can you describe it from a non-packaging point of view ?

i.e. do they have two kernel modules that provide the same sort of services to the kernel and they want to switch between the two of them based on the alternatives mechanism ?

Yes, that is exactly it. For some reason they have two kernel modules that have the same name, same external behavior.. but internally there are code changes. Using the update-alternatives mechanism they have selected one version is "better" then the other.

Quoted 5 lines
Quoted 2 lines

(Frankly this seems bogus to me.. which is why I'm asking the question. Is this even supported or is this simply "don't do that".)

Cannot you rename them in do_install to module-foo.${BPN}.ko and set ALTERNATIVE_TARGET_kernel-module-foo[foo] to module-foo.${BPN}.ko ?

My understanding (perhaps incorrect) is that depmod uses the ".ko" extension to figure out what to process and what to load. By having them all end in ".ko", it's going to affect automatic loading and you could get either one (or neither) to load properly.

But that was a suggestion I had originally thought of. I'm still wondering though if this whole premise is simply wrong.

--Mark

Quoted 1 line