[Yum-devel] how to require a kernel module

Farkas Levente lfarkas at lfarkas.org
Thu Mar 11 11:56:20 UTC 2010


On 03/09/2010 11:55 PM, Jack Neely wrote:
> On Mon, Mar 08, 2010 at 01:30:34PM +0100, Farkas Levente wrote:
>> hi,
>> on rhel/centos-5w we've a lot's of kernel module (thanks to the elrepo)
>> and we can build our own on a nearly standardized way for rhel/centos.
>> but i now run into a problem how to add a require kmod line into another
>> package's spec file. it seems to very easy, if i've got package x.spec:
>> Requires: y-kmod
>> first question whether y-kmod or kmod-y (tha package name or the virtual
>> provides)? and if we go a bit further and have a i386 machine with 4gb
>> ram which install by default kernel-PAE and like to install x into that
>> machine i wish to pull (yum pull) kmod-x-PAE and not kmod-x since it
>> can't be used on a PAE kernel. what's more if x pull kmod-y that also
>> pull the none PAE kernel too which is also not a good think. there are
>> two plugins in yum-utils yum-kernel-module and yum-fedorakmod, but none
>> of the seems to working (yum-fedorakmod instal the proper kmod-x-PAE too
>> if i set installforallkernels=1, but still install the non PAE one and
>> the none PAE kernel too).
>>
>> so what's the good and proper solution to require y kernel module into
>> package x (in a way that works with yum on all kernel variant)?
>>
>> i even like to modify any of the yum-kernel-module or yum-fedorakmod to
>> be able to use, but the problem is that i can't write conditional
>> requires in a package spec file which depend on the runtime kernel
>> variant:-(
>>
>> if there would be some tricky yum plugins which do this:
>> - if yum needs to install a package
>> - check whether the package provide kabi-module or kernel-module. if yes
>> it's a kernel module.
>> - if it's a kernel module than check the currently running kernel (and
>> optionally all installed kernel) and install the proper kernel module
>> variant. eg. if the running kernel is:
>>    - kernel-2.6.18-164.11.1.el5 then install kmod-ocfs2
>>    - kernel-PAE-2.6.18-164.11.1.el5 then install kmod-ocfs2-PAE
>>
>> anybody has any solution to this?
>> thanks in advance.
>> regards.
>>
>
> For RHEL5-ish systems still using the kmod v1 standard, you need to
> require "foo-kmod".  That's the virtual provides that all the variants
> should provide.
>
> Yum/RPM don't know how to properly dep solve that without the
> yum-fedorakmod plugin.  Yes, the installforallkernels=1 will make sure
> that the other matching variants are installed for each kernel.
>
> However, if kmod-foo gets in the transaction set, the fedorakmod plugin
> doesn't know to remove it if the normal kernel package isn't installed.
> Which probably means the normal kernel package gets sucked into the
> transaction set as well in some cases.

if you wrote the yum-fedorakmod plugin than you can help me:-)
in elrepo:
http://elrepo.org/tiki/tiki-index.php
we use kabi tracking kernel modules since all rhel kernel are kabi 
compatible with eachother (which is not true for fedora, but a nice 
feature in the enterprise target), so don't have to rebuild for each 
kernel. for the same reason it's not provide "kernel-modules" but 
provides "kabi-modules".
the problem
- even if i require the virtual provides foo-kmod and
- even if i have installed yum-fedorakmod plugin and
- even if i only have installed kernel-PAE (ie. not the normal kernel)
yum still install the kmod-foo (and not only kmod-foo-PAE) and because 
of this it will pull also the normal kernel too.
so i'd like to install one such yum plugin which solve this problem and 
somehow install the proper kernel-variant kmod-foo packages.

can you help me in this? if we can have such a yum plugin it can be add 
to elrepo so everybody can use it on all rhel/centos where elrepo used.

thanks in advance.

-- 
   Levente                               "Si vis pacem para bellum!"


More information about the Yum-devel mailing list