diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2005-12-12 18:03:44 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-04 16:18:09 -0800 |
commit | 263756ec228f1cdd49fc50b1f87001a4cebdfe12 (patch) | |
tree | 502925a94655348a768f25180e49126688100a8d /drivers/ide/ide-cd.c | |
parent | f743ca5e10f4145e0b3e6d11b9b46171e16af7ce (diff) |
[PATCH] ide: MODALIAS support for autoloading of ide-cd, ide-disk, ...
IDE: MODALIAS support for autoloading of ide-cd, ide-disk, ...
Add MODULE_ALIAS to IDE midlayer modules: ide-disk, ide-cd, ide-floppy and
ide-tape, to autoload these modules depending on the probed media type of
the IDE device.
It is used by udev and replaces the former agent shell script of the hotplug
package, which was required to lookup the media type in the proc filesystem.
Using proc was racy, cause the media file is created after the hotplug event
is sent out.
The module autoloading does not take any effect, until something like the
following udev rule is configured:
SUBSYSTEM=="ide", ACTION=="add", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}"
The module ide-scsi will not be autoloaded, cause it requires manual
configuration. It can't be, and never was supported for automatic setup in
the hotplug package. Adding a MODULE_ALIAS to ide-scsi for all supported
media types, would just lead to a default blacklist entry anyway.
$ modinfo ide-disk
filename: /lib/modules/2.6.15-rc4-g1b0997f5/kernel/drivers/ide/ide-disk.ko
description: ATA DISK Driver
alias: ide:*m-disk*
license: GPL
...
$ modprobe -vn ide:m-disk
insmod /lib/modules/2.6.15-rc4-g1b0997f5/kernel/drivers/ide/ide-disk.ko
$ cat /sys/bus/ide/devices/0.0/modalias
ide:m-disk
It also adds attributes to the IDE device:
$ tree /sys/bus/ide/devices/0.0/
/sys/bus/ide/devices/0.0/
|-- bus -> ../../../../../../../bus/ide
|-- drivename
|-- media
|-- modalias
|-- power
| |-- state
| `-- wakeup
`-- uevent
$ cat /sys/bus/ide/devices/0.0/{modalias,drivename,media}
ide:m-disk
hda
disk
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r-- | drivers/ide/ide-cd.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index b4d7a3efb90f..70aeb3a60120 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c @@ -3509,6 +3509,7 @@ static int __init ide_cdrom_init(void) return driver_register(&ide_cdrom_driver.gen_driver); } +MODULE_ALIAS("ide:*m-cdrom*"); module_init(ide_cdrom_init); module_exit(ide_cdrom_exit); MODULE_LICENSE("GPL"); |