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.
To find out about this, have a look at '/usr/src/linux/arch/i386/defconfig'. This file contains the standard configuration of the Mandrake kernel. You will see that the Mandrake kernel is thoroughly modularized and that most of the modules have been built and are ready to run.
The entries in 'defconfig' look like this:
{OPTION}={m,y}
m
y
If you see an entry like this:
# {OPTION} is not set
and you really need this option to be enabled, you have to recompile the kernel. This should be seldom necessary, though.
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
You can configure as many devices as you like. You usually start with trying them out at the boot prompt or via
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 usingloadlin
- 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."
Spaces are allowed after
append
append
image=/boot/vmlinuz label=linux root=/dev/hda{x} initrd=/boot/initrd.img append="{device1}={value1},{value2} etc." read-only
In GRUB's 'menu.lst' you just have to append the value pairs to the set boot command line.
Run-time Configuration
Most likely you need to configure a driver that is available as a module.
Some basic commands first:
-
/sbin/lsmod
-
/sbin/modprobe -l
-
/sbin/modprobe -c
alias eth0 off
-
/sbin/modprobe {module}
insmod
insmod ...
modprobe ...
-
/sbin/modprobe -r {module}
rmmod
-
man modprobe
Run
depmod -a
modprobe {module name}
The module name is the file name of the driver without its ending (e.g. 'joy-sidewinder.o' becomes 'joy-sidewinder'). If you get no error messages here, the module has loaded OK (run
lsmod
If you get
Device or resource busy
modprobe {module} {options}
Configuration and loading of modules is done via '/etc/modules.conf' (or 'conf.modules' in some releases). If you have a look at it, you will see that there's already some configuration done. You will also note that there are some switches which allow you to control the loading procedure:
-
alias {class} {module}
alias eth0 ne2k-pci
alias {class} off
-
options {class or module} {value1} {value2}
-
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'. Runmodprobe -c
block-major-11
sr_mod
Now put it all together:
pre-install sr_mod modprobe scsi_hostadapter
Obviously this line must be inserted into '/etc/conf.modules' below the alias for the adapter...
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 ;-)).
Related Resources:
The Linux ~BootPrompt-HOWTO
'Configure.help' and 'modules.txt' in 'linux/Documentation'
man modprobe
Revision / Modified: Sep. 10, 2001
Author: Tom Berger
Legal: This page is covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB and Mandrakesoft.
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!