[elrepo-devel] how to require a kernel module
Farkas Levente
lfarkas at lfarkas.org
Fri Feb 19 06:35:45 EST 2010
On 02/18/2010 10:04 PM, Dag Wieers wrote:
> On Wed, 17 Feb 2010, Farkas Levente wrote:
>
>> On 02/17/2010 04:34 PM, Akemi Yagi wrote:
>>> On Wed, Feb 17, 2010 at 5:32 AM, Farkas Levente<lfarkas at lfarkas.org> wrote:
>>>> hi,
>>>> now we've a lot's of kernel module 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
>>>> but now comes 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.
>>>> 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)?
>>>> anybody has any solution to this?
>>>
>>> The kernel type such as PAE and xen are defined first in
>>> 'knownvariants' in kmodtool. Then there is subsequently 'dashvariant'
>>> that is used to pull the appropriate kernel-(type)-devel as in:
>>>
>>> echo "BuildRequires: kernel${dashvariant}-devel-%{_target_cpu} = ${verrel}"
>>>
>>> So, something similar can be applied ?
>>
>> in the kmod package spec file of course, but in an independent package
>> it's not working (even kmodtool not included etc).
>> it should have to discover the running system's 'dashvariant' and
>> install the proper rpm. so some kind of virtual provides would be
>> required...
>
> I don't think you can do this :-( The problem is that if you have a
> seperate package that requires a kmod package, you are not interested
> whether one kernel variant is installed (eg. Requires: ocfs2-kmod) or
> whether a specific kernel variant is installed (eg.: Requires:
> kmod-ocfs2-PAE), you are basically interested in whether the kmod for your
> running kernel is installed.
>
> And that is simply not possible with RPM packages. You could hijack a
> pre-script to bail out when your condition is not met, but how that
> interacts with an RPM transaction set including more than one package, and
> depsolver behaviour, I doubt that is advisable.
>
> The best way is to check if the kmod is installed in general, assume it
> works for the current kernel, and assume it is loaded (which is another
> step that you cannot check as part of dependencies) and hope the tool
> requiring the kernel module does its own checks and proper reporting.
yes it's true. but 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 ocfs2-kmod
- kernel-PAE-2.6.18-164.11.1.el5 then install kmod-ocfs2-PAE
isn't it possible?
anyway what the yum-fedorakmod (yum-kmod in rhel/centos) and
yum-kernel-module are good for?
--
Levente "Si vis pacem para bellum!"
More information about the elrepo-devel
mailing list