Hardware Configuration II
Summary:- 4.2 Kernel-space Configuration
- '/etc/lilo.conf' vs. '/etc/modules.conf'
- Boot-time Configuration
- Run-time Configuration
4.2 Kernel-space Configuration
'/etc/lilo.conf' vs. '/etc/modules.conf'
GNU/Linux may use drivers in two different ways: as part of the kernel itself or as modules. Nowadays it is commonplace practice to take modules rather than built-in drivers whenever possible:- The Linux kernel must be kept in system memory all the time. The bigger the kernel the less system resources remain for other tasks.
- Most modules are loaded when needed and unloaded after not having been needed for one minute. This ensures efficient use of system resources.
- A modularized kernel may run on more than one machine or with less difficulties on a machine with changing hardware.
- To upgrade a modularized driver you just need to recompile the module. If the driver is part of the kernel, you have to recompile the kernel.
The entries in 'defconfig' look like this:
{OPTION}={m,y}
m
y
If you see an entry like this:
# {OPTION} is not set
Boot-time Configuration
In the rare case you need to configure a built-in driver, have a look at The Linux Bootprompt HOWTO. It lists all available devices and their optional values.Many drivers support auto-probing, so just supplying their names without any values will already help in many cases. Example:
hdc=cdrom
loadlin
boot : {device}={value1},{value2} {device2}={value1} etc.
This is one line. Spaces are only allowed between different device configuration entries, all entries are case-sensitive. Note that the keyboard isn't mapped to your local language yet, so some keys may work differently if you're using a non-US keyboard.loadlin {image} {root} {device}={value1},{value2} {device2}={value1} etc.
if you're booting via DOS using. Again, this is one line.loadlin
- If you are using the GRUB boot loader, just hit 'e' twice and append all the entries you need. When you're ready, hit the 'Enter' key and then 'b'.
append="{device1}={value1},{value2} {device2}={value1} etc."append
append
Run-time Configuration
Most likely you need to configure a driver that is available as a module. Some basic commands first:- shows all configured modules on your system.
/sbin/lsmod
- lists all available modules.
/sbin/modprobe -l
- lists all configured aliases, options and commands concerning modules. Note that system defaults (like
/sbin/modprobe -c
) overridden by entries in '/etc/modules.conf' are listed nevertheless (which may be somewhat confusing).alias eth0 off
- loads a module. It is the successor to
/sbin/modprobe {module}
. So if you readinsmod
somewhere replace it withinsmod ...
.modprobe ...
- unloads a module. Successor to
/sbin/modprobe -r {module}
.rmmod
- is a must-read. Concise and really easy to understand.
man modprobe
depmod -a
modprobe {module name}
lsmod
If you get
Device or resource busy
modprobe {module} {options}
- . This assigns a specified module / driver to a class of devices.
alias {class} {module}
for example tells GNU/Linux to use a networking card controlled by the ne2k-pci driver as the first Ethernet interface. Other popular classes are 'scsi_hostadapter' and 'sound'.alias eth0 ne2k-pci
tells GNU/Linux to refrain from loading any driver for this device class.alias {class} off
- Some modules may require further configuration, like IRQ numbers or I/O addresses. Valid options are either described in the documentation file of the module (in /usr/src/linux/Documentation), in a README file included in the source directory of the module (subdirectories of '/usr/src/linux/drivers') or in the source file itself ('{module}.c'}).
options {class or module} {value1} {value2}
- tells GNU/Linux to run a command before or after a module is loaded into memory. In ML 7 for example, you found this line (if you had a SCSI controller, that is):
pre/postinstall {module} {command}
post-install supermount modprobe scsi_hostadapter
This means: after the 'supermount' module is loaded, load the module 'scsi_hostadapter'. Loading this module will allow 'supermount' to handle devices which are connected to the SCSI bus.
OK, let's say you do not use 'supermount', but want to load the module for the SCSI host adapter every time you are mounting your SCSI-CD drive. Look at 'devices.txt' in 'linux/Documentation' and you'll find that SCSI CD-ROMs are block devices with the major number '11'. Runand you see that there's already an alias formodprobe -c
calledblock-major-11
.sr_mod
Now put it all together:
pre-install sr_mod modprobe scsi_hostadapter
Fun, isn't it? ;-) Now you are on your own: Read the docs for the modules and try the available options. If you still can't figure it out, use Google (that's what I usually do - the 'net knows everything1.1 ;-)). section index
Related Resources:
The Linux ~BootPrompt-HOWTO'Configure.help' and 'modules.txt' in 'linux/Documentation'
man modprobe
Author: Tom Berger
Legal: This page is covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB and Mandrakesoft.
Hardware Configuration II
Version 1.3 last modified by AdminWiki on 22/03/2004 at 09:44
Version 1.3 last modified by AdminWiki on 22/03/2004 at 09:44
Document data
- Lost account?
- Join the community, be part of the Club: it's free!
- Get the PWP Download Subscription!
Mandriva.com
Store
Club

