How to load a kernel module automatically?

Till Maas opensource at till.name
Sun Apr 1 11:36:58 UTC 2007


On So April 1 2007, Julian Sikorski wrote:
> Hi. In my effort to update thinkfinger to 0.3, I have noticed that the
> new version requires uinput module to be loaded. My question is, how to
> solve thins in rpm? I.e what scriptlets/config files to add so that
> uinput would be added to the list of automatically loaded ones upon
> install and removed upon erase.

I would do the following:

In /etc/sysconfig/modules/thinkfinger.modules (needs to be executable):

#!/bin/sh
/sbin/modprobe uinput &>/dev/null

In the spec:

%post
%{_sysconfdir}/sysconf/modules/%{name}.modules || :

%preun
rmmod uinput || :

/etc/sysconfig/modules/*.modules are executed at boottime, and the scriptlets 
load and remove the module at the right moment.

Regards,
Till
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-maintainers/attachments/20070401/44752457/attachment.sig>


More information about the Fedora-maintainers mailing list