2007-08-29 15:19:16 +04:00
# do not edit this file, it will be overwritten on update
2008-11-25 19:13:07 +03:00
ACTION!="add|change", GOTO="kernel_compat_end"
#
# rules to workaround bad sysfs timing
#
ACTION!="add", GOTO="kernel_compat_wait_end"
2007-08-29 15:19:16 +04:00
# workarounds needed to synchronize with sysfs
2008-11-25 19:13:07 +03:00
# needed for kernels < v2.6.18-rc1
2007-08-29 15:19:16 +04:00
DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
2008-11-25 19:13:07 +03:00
SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", WAIT_FOR_SYSFS="ioerr_cnt"
2007-08-29 15:19:16 +04:00
# needed for kernels <2.6.16
SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
# needed for kernels <2.6.17
SUBSYSTEM=="net", ENV{PHYSDEVDRIVER}=="?*", WAIT_FOR_SYSFS="device/driver"
2008-11-25 19:13:07 +03:00
LABEL="kernel_compat_wait_end"
2007-08-29 15:19:16 +04:00
2008-11-25 19:13:07 +03:00
#
# naming device rules
#
2007-08-29 15:19:16 +04:00
2008-11-25 19:13:07 +03:00
# old style usb sysfs devices
2007-08-29 15:19:16 +04:00
# needed for kernels <2.6.22
SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="usb", MODE="0664"
2008-11-25 19:13:07 +03:00
# /sys/class/block will export this
# needed for kernels <2.6.25-rc1
SUBSYSTEM!="block", GOTO="block_devtype_end"
ENV{DEVTYPE}!="?*", ATTR{range}=="?*", ENV{DEVTYPE}="disk"
ENV{DEVTYPE}!="?*", ATTR{start}=="?*", ENV{DEVTYPE}="partition"
LABEL="block_devtype_end"
2007-08-29 15:19:16 +04:00
2008-11-25 19:13:07 +03:00
#
# module loading rules
#
ACTION!="add", GOTO="kernel_compat_end"
2007-08-29 15:19:16 +04:00
# this driver is broken and should not be loaded automatically
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=398962
# needed for kernels <2.6.21
SUBSYSTEM=="platform", ENV{MODALIAS}=="i82365", ENV{MODALIAS}=""
# No need for more code, as MODALIAS is present
ENV{MODALIAS}=="?*", GOTO="kernel_compat_end"
2008-11-25 19:13:07 +03:00
# needed for kernel <2.6.27-rc5
# acpi will do on newer kernels
SUBSYSTEM=="pnp", DRIVER!="?*", \
RUN{ignore_error}+="/bin/sh -c '/sbin/modprobe -a $$(while read id; do echo pnp:d$$id; done < /sys$devpath/id)'"
2007-08-29 15:19:16 +04:00
# needed for kernels <2.6.22
SUBSYSTEM!="scsi_device", GOTO="kernel_compat_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
2007-09-24 04:59:22 +04:00
ATTRS{type}=="0|7|14", RUN+="/sbin/modprobe sd_mod"
ATTRS{type}=="4|5", RUN+="/sbin/modprobe sr_mod"
ATTRS{type}=="8", RUN+="/sbin/modprobe ch"
2007-08-29 15:19:16 +04:00
ATTRS{type}=="1", ATTRS{vendor}=="On[sS]tream", \
2007-09-24 04:59:22 +04:00
ATTRS{model}!="ADR*", RUN+="/sbin/modprobe osst", GOTO="kernel_compat_end"
ATTRS{type}=="1", RUN+="/sbin/modprobe st"
2007-08-29 15:19:16 +04:00
LABEL="kernel_compat_end"