Quando viene caricato un modulo con
modprobe (da riga di comando, da Discover, Hotplug o altro) il comportamento è determinato da alcuni file di configurazione.
|Kernel 2.6||/etc/modprobe.d/*||Files in this directory will tell which modules will be loaded and how. In a Debian system with a kernel 2.5.48 or above, kernel modules are managed with
|Kernel 2.6||/etc/modprobe.conf||Deprecated, use
|Kernel 2.4.x||/etc/modules.conf||Refer to the Debian package
|Kernel 2.4.x||/etc/modutils/*||In a Debian system the /etc/modules.conf is generated by update-modules merging files from this directory.|
|Kernel 2.4.x||/etc/conf.modules||Deprecated, use
List of kernel modules to be loaded. Edit it by hand to force loading of modules not loaded by discover, hotplug or others.
NOTE: starting from Debian Etch, it is preferable to install the
udev package instead of
Instead of using
/etc/modules file, with Discover you can try an automatic approach in loading kernel modules.
Discover is a tool that reports information about a system's hardware, it supports many methods for querying the host operating system (OS) about installed devices. Discover's role is to answer questions like “What Linux kernel module do I need to load for this device to work?”.
Two applications are provided with Discover: the command-line utility discover - which provides an extensible hardware detection and reporting interface - and discover-modprobe which loads Linux kernel modules identified by discover. It will typically be invoked automatically at boot time.
In the configuration file
/etc/discover-modprobe.conf you can control which categories of hardware do you want kernel modules automatically modprobed for. With this line every suitable module will be modprobed:
Available types are: audio, bridge, broadband, display, fixeddisk, humaninput, imaging, miscellaneous, modem, network, optical, printer, removabledisk, tape and video.
NOTE: in Debian Etch the package the
udev is the prefferred choice instead of
Hotplug is mainly intended to let the kernel notify user mode software when hardware related events take place. But this means also that hotplug will load modules when devices are found say at bootstrap on PCI bus. To prevent some modules to be loaded, add a file
/etc/hotplug/blacklist.d/local and list the module names to be skipped.
If you want to entirely disable hotplug functionality for a single bus type (e.g. PCI), remove execute permission from the script
This should be the preferred way, on a modern Debian system, to automatically load kernel modules, to handle hotplug events and to dynamically create devices into
/dev/ hierarchy. See filesystem virtuali in Linux.
Mounting devices by unprivileged user, automounting of devices, CD-ROM, USB keys, USB cameras, … those issues in a modern Debian system (Etch) are addressed by several programs:
|udev|| Daemon for the kernel hotplug events. Manages the creation of devices into
|pmount|| Mount arbitrary hotpluggable devices as normal user. The standard
|fuse|| Filesystem in USErspace. This is an alternative to the
|hal||Hardware Abstraction Layer. HAL is a piece of user-space software that maintains a list of device with well-defined properties for each device. Existing libraries can adopt HAL for accessing devices. The simplest use-case would be accessing a camera. The application programmer uses HAL for finding a camera device; he then tosses the HAL device id to the camera library and gets the pictures.|
hal run as normal user, do not modify
/etc/fstab at all and instead use a program called
pmount (policy mount) that allows normal users to mount removable devices without an
Introducing a new group called
plugdev. Every user who is a member of this group can access hotpluggable devices (digital cameras, USB drives etc.). pmount can only be executed by members of this group (it is root:plugdev 4754), hal runs in this group to be able to detect file systems (but it does not run in
disk), and udev assigns the
plugdev group to removable devices (static drives remain in group
Per rendere più o meno automatico il montaggio di filesystem (CD-ROM, Floppy, USB, network share, …) sono state sviluppate diverse soluzioni.
|Supermount||Adottata principalmente da Mandrake, per floppy e CD-ROM. Non supporta share NFS. Disponibile come patch per il kernel. Vedere supermount-ng.|
|AutoFS||Nasce per dischi di rete, ma può essere adattata ad altri casi. Integrata nel kernel di Linux a partire dalla versione 2.2|
Secondo i dettami di FHS (http://www.pathname.com/fhs/) deve esistere la gerarchia /media che contiene i punti di montaggio per floppy, cdrom, eccetera. Si estende il concetto e si creano anche punti di montaggio per cose non standard, ad esempio partizioni Windows o share NFS.