diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2007-08-03 00:06:00 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2007-08-03 00:06:00 +0200 |
commit | 538876cdc8cd1ad0cc7575d641feae2df91b507a (patch) | |
tree | 750ba763667d65a2cc2be8157e91ede2c25c1ae1 | |
parent | 56a8a8836d5d3955939c9cd0060d5ebdf00ddfc5 (diff) |
rules: Gentoo update
-rw-r--r-- | etc/udev/gentoo/50-udev.rules | 48 | ||||
-rw-r--r-- | etc/udev/gentoo/64-device-mapper.rules | 33 | ||||
-rw-r--r-- | etc/udev/gentoo/80-hotplug.rules | 54 |
3 files changed, 56 insertions, 79 deletions
diff --git a/etc/udev/gentoo/50-udev.rules b/etc/udev/gentoo/50-udev.rules index ddabe1acc6..dd329712dd 100644 --- a/etc/udev/gentoo/50-udev.rules +++ b/etc/udev/gentoo/50-udev.rules @@ -248,6 +248,7 @@ SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/u SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \ NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", GROUP="usb", MODE="0664" +# Timeouts for scsi devices # Setting timeout for tape-devices (type 1) to 900 seconds # and 60 seconds for device types 0, 7 and 14 # if you need timeouts for other devices add a similar rule @@ -255,53 +256,8 @@ SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \ SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="0|7|14", ATTR{timeout}="60" SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="1", ATTR{timeout}="900" -# Module autoloading -ACTION!="add", GOTO="hotplug_no_add_event" - -# check if the device has already been claimed by a driver -ENV{DRIVER}=="?*", SUBSYSTEM!="input", GOTO="hotplug_load_end" - -# this driver is broken and should not be loaded automatically -SUBSYSTEM=="platform", ENV{MODALIAS}=="i82365", GOTO="hotplug_load_end" - -# Autoload modules that lack aliases but have them defined inutoload modules -ENV{MODALIAS}=="?*", RUN{ignore_error}+="modprobe.sh $env{MODALIAS}" - -# /etc/modprobe.conf. -SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", RUN{ignore_error}+="/bin/sh -c 'while read id; do /lib/udev/modprobe.sh pnp:d$$id; done < /sys$devpath/id'" -# needed aliases are defined in /etc/modprobe.d/pnp-aliases - - -SUBSYSTEM=="i2o", RUN+="modprobe.sh i2o_block" -SUBSYSTEM=="mmc", RUN+="modprobe.sh mmc_block" - -# Parts taken from redhat-rules -# sd: 0 TYPE_DISK, 7 TYPE_MOD, 14 TYPE_RBC -# sr: 4 TYPE_WORM, 5 TYPE_ROM -# st/osst: 1 TYPE_TAPE - -# Load driver for scsi-device -SUBSYSTEM!="scsi_device", GOTO="hotplug_scsi_end" -ATTRS{type}=="?*", TEST!="[module/sg]", RUN+="modprobe.sh sg" -ATTRS{type}=="0|7|14", RUN+="modprobe.sh sd_mod" -ATTRS{type}=="4|5", RUN+="modprobe.sh sr_mod" -ATTRS{type}=="8", RUN+="modprobe.sh ch" - -ATTRS{type}=="1", ENV{ID_SCSI_TAPE_DRIVER}="st" -ATTRS{type}=="1", ATTRS{vendor}=="On[sS]tream", \ - ATTRS{model}!="ADR*", ENV{ID_SCSI_TAPE_DRIVER}="osst" -ENV{ID_SCSI_TAPE_DRIVER}=="?*", RUN+="modprobe.sh $env{ID_SCSI_TAPE_DRIVER}" -LABEL="hotplug_scsi_end" - - -SUBSYSTEM=="ide", ATTR{media}=="tape", RUN+="modprobe.sh ide-scsi" - -LABEL="hotplug_load_end" - # Load firmware -SUBSYSTEM=="firmware", RUN+="firmware.sh" - -LABEL="hotplug_no_add_event" +SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware.sh" LABEL="gentoo_device_rules_end" diff --git a/etc/udev/gentoo/64-device-mapper.rules b/etc/udev/gentoo/64-device-mapper.rules deleted file mode 100644 index e104a175d6..0000000000 --- a/etc/udev/gentoo/64-device-mapper.rules +++ /dev/null @@ -1,33 +0,0 @@ -# device mapper links hook into "change" events, when the dm table -# becomes available; some table-types must be ignored - -KERNEL=="device-mapper", NAME="mapper/control" - -KERNEL!="dm-*", GOTO="device_mapper_end" -ACTION!="add|change", GOTO="device_mapper_end" - -# lookup device name -# use dmsetup, until devmap_name is provided by sys-fs/device-mapper -PROGRAM=="/sbin/dmsetup -j %M -m %m --noopencount --noheadings -c -o name info", - ENV{DM_NAME}="%c" - -# do not do anything if dmsetup does not provide a name -ENV{DM_NAME}=="", NAME="", OPTIONS="ignore_device" - -# ignore luks crypt devices while not fully up -ENV{DM_NAME}=="temporary-cryptsetup-*", NAME="", OPTIONS="ignore_device" - -# use queried name -ENV{DM_NAME}=="?*", NAME="mapper/$env{DM_NAME}" - -SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}" - -PROGRAM!="/sbin/dmsetup status -j %M -m %m", GOTO="device_mapper_end" -RESULT=="|*snapshot*|*error*", GOTO="device_mapper_end" - -IMPORT{program}="vol_id --export $tempnode" -OPTIONS="link_priority=50" -ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_SAFE}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_SAFE}" -ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}" - -LABEL="device_mapper_end" diff --git a/etc/udev/gentoo/80-hotplug.rules b/etc/udev/gentoo/80-hotplug.rules new file mode 100644 index 0000000000..0637dbc83a --- /dev/null +++ b/etc/udev/gentoo/80-hotplug.rules @@ -0,0 +1,54 @@ +# /etc/udev/rules/80-hotplug.rules: module loading rules for udev +# +# Gentoo specific rules +# +# There are a number of modifiers that are allowed to be used in some of the +# fields. See the udev man page for a full description of them. +# +# Try not to modify this file, if you wish to change things, create a new rule +# file that can be run before this one. +# + +# Module autoloading +ACTION!="add", GOTO="hotplug_load_end" + +# check if the device has already been claimed by a driver +ENV{DRIVER}=="?*", SUBSYSTEM!="input", GOTO="hotplug_load_end" + +# this driver is broken and should not be loaded automatically +SUBSYSTEM=="platform", ENV{MODALIAS}=="i82365", GOTO="hotplug_load_end" + +# Autoload modules that lack aliases but have them defined in autoload modules +ENV{MODALIAS}=="?*", RUN{ignore_error}+="modprobe.sh $env{MODALIAS}" + +# /etc/modprobe.conf. +SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", RUN{ignore_error}+="/bin/sh -c 'while read id; do /lib/udev/modprobe.sh pnp:d$$id; done < /sys$devpath/id'" +# needed aliases are defined in /etc/modprobe.d/pnp-aliases + + +SUBSYSTEM=="i2o", RUN+="modprobe.sh i2o_block" +SUBSYSTEM=="mmc", RUN+="modprobe.sh mmc_block" +SUBSYSTEM=="tifm", RUN+="modprobe.sh tifm_sd" +SUBSYSTEM=="tifm", RUN+="modprobe.sh tifm_ms" +SUBSYSTEM=="ide", ATTR{media}=="tape", RUN+="modprobe.sh ide-scsi" + +# Load driver for scsi-device +SUBSYSTEM!="scsi_device", GOTO="hotplug_scsi_end" + + # Parts taken from redhat-rules + # sd: 0 TYPE_DISK, 7 TYPE_MOD, 14 TYPE_RBC + # sr: 4 TYPE_WORM, 5 TYPE_ROM + # st/osst: 1 TYPE_TAPE + + ATTRS{type}=="?*", TEST!="[module/sg]", RUN+="modprobe.sh sg" + ATTRS{type}=="0|7|14", RUN+="modprobe.sh sd_mod" + ATTRS{type}=="4|5", RUN+="modprobe.sh sr_mod" + ATTRS{type}=="8", RUN+="modprobe.sh ch" + + ATTRS{type}=="1", ATTRS{vendor}=="On[sS]tream", \ + ATTRS{model}!="ADR*", RUN+="modprobe.sh osst", GOTO="hotplug_scsi_end" + ATTRS{type}=="1", RUN+="modprobe.sh st" +LABEL="hotplug_scsi_end" + +LABEL="hotplug_load_end" + |