- How do I load a kernel module automatically?
- Posted by Tristan Miller on January 27th, 2004
Greetings.
I just got a new webcam which requires the pwc kernel module. I added the
appropriate options to /etc/modules.conf:
options pwc size=sif fps=5
and then loaded the module with modprobe. Fine; everything works great.
However, I need to redo the modprobe manually with every reboot.
Which configuration file do I need to modify to get Linux to automatically
load the pwc module every time it starts up? Is this something I have to
set in the bootloader (in my case, grub)?
Regards,
Tristan
--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
- Posted by Davide Bianchi on January 27th, 2004
In comp.os.linux.misc Tristan Miller <psychonaut@nothingisreal.com> wrote:
Not knowing which distribution are you using it's quite difficult
to say, check in /etc/rc.d/ if there is something that looks like
'local' or 'modules'.
Davide
--
| It is not too late to turn back from the GATES of hell. Use Linux -
| the free 32 bit operating system.
|
|
|
|
- Posted by Johan Lindquist on January 27th, 2004
["Followup-To:" header set to comp.os.linux.misc.]
So anyway, it was like, 14:40 CET Jan 27 2004, you know? Oh, and, yeah,
Tristan Miller was all like, "Dude,
/etc/modules.autoload.d/kernel-*
/etc/modules.autoload
(the latter, if it exists, is probably a symlink to the relevant file
in /etc/modules.autoload.d)
Or if you're using devfs you can set it up to be dynamically loaded
whenever something tries to access the device it creates.
hth.
--
Time flies like an arrow, fruit flies like a banana. Perth ---> *
14:51:50 up 2 days, 22:27, 2 users, load average: 2.06, 2.06, 2.01
$ cat /dev/bollocks Registered Linux user #261729
incubate robust networks
- Posted by Peter-Josef Meisch on January 27th, 2004
Davide Bianchi wrote:
probably a SuSE distro when asked in this group, try adding to
/etc/init.d/boot.local
Greetings
P.J.
--
Peter-Josef Meisch
pjmeisch (at) web (dot) de
- Posted by Tristan Miller on January 27th, 2004
Greetings.
In article <o57ie1-0vt.ln1@news.smilfinken.net>, Johan Lindquist wrote:
No such files/directory in /etc... in fact, nowhere in the /etc hierarchy is
there any file with the pattern *autoload*. 
Regards,
Tristan
--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
- Posted by Tristan Miller on January 27th, 2004
Greetings.
In article <bv5q53$obao3$2@ID-18487.news.uni-berlin.de>, Davide Bianchi
wrote:
SuSE 9.0... there is a file /etc/init.d/boot.loadmodules, but it doesn't
seem to do anything on its own (it tests a command-line parameter).
Moreover there is no other script in /etc/init.d or /etc which calls
boot.loadmodules.
I could just add the modprobe command to /etc/init.d/boot.local as another
poster suggested, but I suspect that the presence of this boot.loadmodules
script means that there is supposed to be a more "correct" way of doing it.
Here's the script contents, FWIW (posted here for purposes of criticism and
review, of course):
#! /bin/sh
#
# Copyright (c) 2002 SuSE Linux AG, Nuernberg, Germany. All rights reserved.
#
# File: /etc/init.d/boot.loadmodules
# Author: Jiri Srain <jsrain@suse.cz>
#
### BEGIN INIT INFO
# Provides: boot.loadmodules
# Required-Start: boot.localfs
# X-UnitedLinux-Should-Start:
# Required-Stop:
# Default-Start: B
# Default-Stop:
# Description: load modules required to be loaded in specific order
### END INIT INFO
.. /etc/rc.status
rc_reset
case "$1" in
start|restart)
# Read variable for sysconfig and load all mentioned modules
echo Loading required kernel modules
. /etc/sysconfig/kernel
for I in $MODULES_LOADED_ON_BOOT ; do
modprobe $I;
done
rc_status -v1 -r
;;
stop)
rc_failed 3
rc_status -v
;;
status)
rc_failed 4
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1
;;
esac
rc_exit
I can't find any other references to this MODULES_LOADED_ON_BOOT variable
anywhere in /etc or /etc/init.d either.
Regards,
Tristan
--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
- Posted by Davide Bianchi on January 27th, 2004
In comp.os.linux.misc Tristan Miller <psychonaut@nothingisreal.com> wrote:
That can be 'start' or 'stop', they are send automatically during
boot/shutdown.
So, the list of modules should be defined in /etc/sysconfig/kernel
in a variable called $MODULES_LOADED_ON_BOOT, but nothing stop you
to just add the insmod command at the end of this script.
Ok, it sucks, but probably it works.
Davide
--
| ...A Microsoft spokesperson said, "while fighting software piracy is
| good for our business, highway robbery is our business." -- From
| a Slashdot.org post
|
|
|
- Posted by Johan Lindquist on January 27th, 2004
["Followup-To:" header set to comp.os.linux.misc.]
So anyway, it was like, 18:31 CET Jan 27 2004, you know? Oh, and, yeah,
Tristan Miller was all like, "Dude,
I thought that was a kernel thing, not a distribution thing. Sorry. 
--
Time flies like an arrow, fruit flies like a banana. Perth ---> *
18:56:44 up 3 days, 2:32, 2 users, load average: 2.08, 2.12, 2.23
$ cat /dev/bollocks Registered Linux user #261729
incentivize mission-critical systems
- Posted by Kevin Nathan on January 27th, 2004
On Tue, 27 Jan 2004 18:38:43 +0100
Tristan Miller <psychonaut@nothingisreal.com> wrote:
That is what you want to change. You don't need to, and really should
not, change the script. Have you tried looking in YaST in the Editor
for sysconfig? You should be able to edit the /etc/sysconfig files
yourself, but YaST is easier . . . :-)
--
Kevin Nathan (Montana, USA)
Open standards. Open source. Open minds.
The command line is the front line.
Linux 2.4.22-10mdk
12:01:41 up 13 days, 19:02, 1 user, load average: 0.10, 0.07, 0.01
- Posted by Tristan Miller on January 27th, 2004
Greetings.
In article <bv68rl$ojiva$2@ID-18487.news.uni-berlin.de>, Davide Bianchi
wrote:
Ah... indeed, there it is. Thanks for pointing out where this variable was
defined!
Regards,
Tristan
--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
- Posted by npeodqy@fdsjez.com on January 28th, 2004
|I just got a new webcam which requires the pwc kernel module. I added the
|appropriate options to /etc/modules.conf:
|
|options pwc size=sif fps=5
|
|and then loaded the module with modprobe. Fine; everything works great.
|However, I need to redo the modprobe manually with every reboot.
|
|Which configuration file do I need to modify to get Linux to automatically
|load the pwc module every time it starts up? Is this something I have to
|set in the bootloader (in my case, grub)?
If there is a device that is referenced when you access your webcam then
you can create an alias from the device to the module. For example
here's what I use to load bttv:
alias char-major-81-0 bttv
options bttv pll=1 radio=1 card=2
Char device 81,0 is /dev/video0. Whenever the tuner is activated, say by
running a tuner app, it gets automatically loaded.
--