diff options
Diffstat (limited to 'rules')
37 files changed, 1687 insertions, 0 deletions
diff --git a/rules/debian/50-udev.rules b/rules/debian/50-udev.rules new file mode 100644 index 0000000000..e3a10701cf --- /dev/null +++ b/rules/debian/50-udev.rules @@ -0,0 +1,98 @@ +# import the properties of optical drives +KERNEL=="hd[a-z]|pcd[0-9]*", ACTION=="add|change", DRIVERS=="ide-cdrom|pcd", \ + IMPORT{program}="cdrom_id --export $tempnode" +KERNEL=="sr[0-9]*", ACTION=="add|change", \ + IMPORT{program}="cdrom_id --export $tempnode" + +# workarounds for devices which do not report media changes +SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", \ + ATTRS{model}=="IOMEGA_ZIP*|ZIP *", OPTIONS+="all_partitions" +SUBSYSTEMS=="scsi", KERNEL=="sd[a-z]", ATTR{removable}=="1", \ + ATTRS{model}=="IOMEGA_ZIP*|ZIP *", OPTIONS+="all_partitions" +SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", \ + ATTRS{media}=="floppy", OPTIONS+="all_partitions" + +# SCSI devices +SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", NAME="scd%n", SYMLINK+="sr%n" +SUBSYSTEM=="bsg", NAME="bsg/%k" + +# USB devices +SUBSYSTEMS=="usb", KERNEL=="auer[0-9]*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="cpad[0-9]*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="dabusb*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="hiddev*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="legousbtower*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="iowarrior[0-9]*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", \ + ATTRS{product}=="[Hh]andspring*Treo*|[Hh]andspring*Visor*|[Pp]alm*Handheld*", \ + SYMLINK+="pilot" + +# usbfs-like devices +SUBSYSTEM=="usb_device", ACTION=="add", \ + PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", ACTION=="add", \ + NAME="$result" +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}" + +# serial devices +KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20" +KERNEL=="capi[0-9]*", NAME="capi/%n" + +# video devices +KERNEL=="dvb*", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}", ACTION=="add", \ + NAME="$result" +KERNEL=="card[0-9]*", NAME="dri/%k" + +# misc devices +KERNEL=="hw_random", NAME="hwrng" +KERNEL=="tun", NAME="net/%k" +KERNEL=="evtchn", NAME="xen/%k" +KERNEL=="rtc0", SYMLINK+="rtc" + +KERNEL=="cdemu[0-9]*", NAME="cdemu/%n" +KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%n" +KERNEL=="pktcdvd", NAME="pktcdvd/control" + +KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid" +KERNEL=="msr[0-9]*", NAME="cpu/%n/msr" +KERNEL=="microcode", NAME="cpu/microcode" + +KERNEL=="umad*", NAME="infiniband/%k" +KERNEL=="issm*", NAME="infiniband/%k" +KERNEL=="uverbs*", NAME="infiniband/%k" +KERNEL=="ucm*", NAME="infiniband/%k" +KERNEL=="rdma_cm", NAME="infiniband/%k" + +# ALSA devices +KERNEL=="controlC[0-9]*", NAME="snd/%k" +KERNEL=="hwC[D0-9]*", NAME="snd/%k" +KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k" +KERNEL=="midiC[D0-9]*", NAME="snd/%k" +KERNEL=="timer", NAME="snd/%k" +KERNEL=="seq", NAME="snd/%k" + +# ieee1394 devices +KERNEL=="dv1394*", NAME="dv1394/%n" +KERNEL=="video1394*", NAME="video1394/%n" + +# input devices +KERNEL=="mice", NAME="input/%k" +KERNEL=="mouse[0-9]*", NAME="input/%k" +KERNEL=="event[0-9]*", NAME="input/%k" +KERNEL=="js[0-9]*", NAME="input/%k" +KERNEL=="ts[0-9]*", NAME="input/%k" +KERNEL=="uinput", NAME="input/%k" + +# Zaptel +KERNEL=="zapctl", NAME="zap/ctl" +KERNEL=="zapchannel", NAME="zap/channel" +KERNEL=="zappseudo", NAME="zap/pseudo" +KERNEL=="zaptimer", NAME="zap/timer" +KERNEL=="transcode", NAME="zap/transcode" +KERNEL=="zap[0-9]*", NAME="zap/%n" + +# AOE character devices +SUBSYSTEM=="aoe", NAME="etherd/%k" + +KERNEL=="device-mapper", NAME="mapper/control" + diff --git a/rules/debian/60-persistent-input.rules b/rules/debian/60-persistent-input.rules new file mode 100644 index 0000000000..8f49d250b1 --- /dev/null +++ b/rules/debian/60-persistent-input.rules @@ -0,0 +1,41 @@ +SUBSYSTEM!="input", GOTO="persistent_input_end" +ACTION!="add|change", GOTO="persistent_input_end" +# ignore the mid-level drivers +KERNEL=="input[0-9]*", GOTO="persistent_input_end" + +# usb devices +SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export" +SUBSYSTEMS=="usb", \ + ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="01", \ + ENV{ID_CLASS}="kbd" +SUBSYSTEMS=="usb", \ + ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="02", \ + ENV{ID_CLASS}="mouse" + +# other devices +DRIVERS=="pcspkr", ENV{ID_CLASS}="spkr" +DRIVERS=="atkbd", ENV{ID_CLASS}="kbd" +DRIVERS=="psmouse", ENV{ID_CLASS}="mouse" +ATTRS{name}=="*dvb*|*DVB*|* IR *", ENV{ID_CLASS}="ir" +# this means (ABS_X || ABS_WHEEL || ABS_THROTTLE) && !BTN_TOUCH +ATTRS{modalias}=="input:*-*a[068],*|input:*-*a*,[68],*m*", \ + ATTRS{modalias}!="input:*-*k*14A,*r*", \ + ENV{ID_CLASS}="joystick" + +ENV{ID_CLASS}=="?*", ENV{ID_SERIAL}=="", ENV{ID_SERIAL}="noserial" + +# by-id links, generic and for the event devices +KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{ID_CLASS}=="?*", \ + SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_CLASS}" +KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{ID_CLASS}=="?*", \ + SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-$env{ID_CLASS}" + +# by-path links +IMPORT{program}="path_id $devpath" +KERNEL=="mouse*|js*", ENV{ID_PATH}=="?*", \ + SYMLINK+="input/by-path/$env{ID_PATH}-$env{ID_CLASS}" +KERNEL=="event*", ENV{ID_PATH}=="?*", \ + SYMLINK+="input/by-path/$env{ID_PATH}-event-$env{ID_CLASS}" + +LABEL="persistent_input_end" + diff --git a/rules/debian/60-persistent-storage-tape.rules b/rules/debian/60-persistent-storage-tape.rules new file mode 100644 index 0000000000..94a0b816d4 --- /dev/null +++ b/rules/debian/60-persistent-storage-tape.rules @@ -0,0 +1,44 @@ +# This file contains the rules needed to create persistent device names. + +# we are only interested in add and change actions for block devices +ACTION!="add|change", GOTO="persistent_storage_tape_end" + +# "Medium Changers" +KERNEL=="sg[0-9]*", \ + SUBSYSTEMS=="scsi", ATTRS{type}=="8", \ + IMPORT{program}="scsi_id --export --sg-version=3 --whitelisted --device=$tempnode" + +KERNEL=="sg[0-9]*", ATTRS{type}=="8", ENV{ID_SERIAL}=="?*", \ + SYMLINK+="tape/by-id/scsi-$env{ID_SERIAL}" + +SUBSYSTEM!="scsi_tape", GOTO="persistent_storage_tape_end" + +KERNEL=="st*[0-9]|nst*[0-9]", ATTRS{ieee1394_id}=="?*", \ + ENV{ID_BUS}="ieee1394", ENV{ID_SERIAL}="$attr{ieee1394_id}" +KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", \ + SUBSYSTEMS=="usb", \ + IMPORT{program}="usb_id --export $devpath" + +KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", \ + SUBSYSTEMS=="scsi", KERNELS=="[0-9]*:*[0-9]", \ + ENV{BSG_DEV}="$root/bsg/$id" +KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", \ + WAIT_FOR="$env{BSG_DEV}", \ + ENV{ID_BUS}="scsi", \ + IMPORT{program}="scsi_id --export --device=$env{BSG_DEV}" + +KERNEL=="st*[0-9]", ENV{ID_SERIAL}=="?*", \ + SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}" +KERNEL=="nst*[0-9]", ENV{ID_SERIAL}=="?*", \ + SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst" + +KERNEL=="st*[0-9]|nst*[0-9]", \ + IMPORT{program}="path_id $devpath" +KERNEL=="st*[0-9]", ENV{ID_PATH}=="?*", \ + SYMLINK+="tape/by-path/$env{ID_PATH}" +KERNEL=="nst*[0-9]", ENV{ID_PATH}=="?*", \ + SYMLINK+="tape/by-path/$env{ID_PATH}-nst" + +# end of processing +LABEL="persistent_storage_tape_end" + diff --git a/rules/debian/60-persistent-storage.rules b/rules/debian/60-persistent-storage.rules new file mode 100644 index 0000000000..65e7204531 --- /dev/null +++ b/rules/debian/60-persistent-storage.rules @@ -0,0 +1,109 @@ +# This file contains the rules needed to create persistent device names. + +# forward scsi device events to the corresponding block device +ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", \ + TEST=="block", ATTR{block/*/uevent}="change" + +# we are only interested in add and change actions for block devices +ACTION!="add|change", GOTO="persistent_storage_end" +SUBSYSTEM!="block", GOTO="persistent_storage_end" + +# and we can safely ignore these kinds of devices +KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-*|md*", GOTO="persistent_storage_end" + +# skip removable ide devices, because open(2) on them causes an events loop +KERNEL=="hd*[!0-9]", ATTR{removable}=="1", DRIVERS=="ide-cs|ide-floppy", \ + GOTO="persistent_storage_end" +KERNEL=="hd*[0-9]", ATTRS{removable}=="1", \ + GOTO="persistent_storage_end" + +# ignore partitions that span the entire disk +TEST=="whole_disk", GOTO="persistent_storage_end" + +# skip xen virtual hard disks +DRIVERS=="vbd", GOTO="no_hardware_id" + +# check these attributes of /sys/class/block nodes +ENV{DEVTYPE}!="?*", ATTR{range}=="?*", ENV{DEVTYPE}="disk" +ENV{DEVTYPE}!="?*", ATTR{start}=="?*", ENV{DEVTYPE}="partition" + +# look for different kinds of unique identificators +KERNEL=="hd*[!0-9]", \ + IMPORT{program}="ata_id --export $tempnode" + +KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", \ + ENV{ID_BUS}="ieee1394", ENV{ID_SERIAL}="$attr{ieee1394_id}" +KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", \ + SUBSYSTEMS=="usb", \ + IMPORT{program}="usb_id --export $devpath" +KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", \ + ENV{ID_BUS}="scsi", \ + IMPORT{program}="scsi_id --export --whitelisted --device=$tempnode" +KERNEL=="cciss?c[0-9]d[0-9]*", ENV{ID_SERIAL}!="?*", \ + ENV{ID_BUS}="cciss", \ + IMPORT{program}="scsi_id --export --whitelisted --device=$tempnode" + +KERNEL=="dasd*[!0-9]", \ + IMPORT{program}="dasd_id --export $tempnode" + +KERNEL=="sd*[!0-9]|hd*[!0-9]", \ + IMPORT{program}="edd_id --export $tempnode" + +KERNEL=="sd*[!0-9]|sr*", ENV{ID_VENDOR}=="ATA", \ + PROGRAM="ata_id $tempnode", RESULT=="?*", ENV{ID_ATA_COMPAT}="$result" + +# find the physical path of the device +ENV{DEVTYPE}=="disk", IMPORT{program}="path_id $devpath" + +LABEL="no_hardware_id" + +# import the variables of partitions from the parent disks +ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*" + +# obsolete PATA driver +KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", \ + SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}" +KERNEL=="hd*[0-9]", ENV{ID_SERIAL}=="?*", \ + SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n" +# hd*-like compatibility links for libata and PATA devices +KERNEL=="sd*[!0-9]|sr*", ENV{ID_ATA_COMPAT}=="?*", \ + SYMLINK+="disk/by-id/ata-$env{ID_ATA_COMPAT}" +KERNEL=="sd*[0-9]", ENV{ID_ATA_COMPAT}=="?*", \ + SYMLINK+="disk/by-id/ata-$env{ID_ATA_COMPAT}-part%n" + +KERNEL=="mmcblk[0-9]", ATTR{name}=="?*", ATTR{serial}=="?*", \ + ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", \ + SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}" +KERNEL=="mmcblk[0-9]p[0-9]", ATTR{name}=="?*", ATTR{serial}=="?*", \ + ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", \ + SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}-part%n" + +ENV{DEVTYPE}=="disk", ENV{ID_EDD}=="?*", \ + SYMLINK+="disk/by-id/edd-$env{ID_EDD}" +ENV{DEVTYPE}=="partition", ENV{ID_EDD}=="?*", \ + SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n" + +KERNEL=="sd*[!0-9]|sr*|dasd[!0-9]*|cciss?c[0-9]d[0-9]*", ENV{ID_SERIAL}=="?*", \ + SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" +KERNEL=="sd*[0-9]|dasd*[0-9]|cciss*p[0-9]*", ENV{ID_SERIAL}=="?*", \ + SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" + +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", \ + SYMLINK+="disk/by-path/$env{ID_PATH}" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", \ + SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" + +# skip unpartitioned removable media devices from drivers which do not send +# "change" events +ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", \ + GOTO="persistent_storage_end" + +# UUID and volume label +IMPORT{program}="vol_id --export $tempnode" +ENV{ID_FS_UUID_ENC}=="?*", ENV{ID_FS_USAGE}=="filesystem|other|crypto", \ + SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" +ENV{ID_FS_LABEL_ENC}=="?*", ENV{ID_FS_USAGE}=="filesystem|other", \ + SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" + +LABEL="persistent_storage_end" + diff --git a/rules/debian/60-persistent-v4l.rules b/rules/debian/60-persistent-v4l.rules new file mode 100644 index 0000000000..5a317b6c18 --- /dev/null +++ b/rules/debian/60-persistent-v4l.rules @@ -0,0 +1,17 @@ +ACTION!="add|change", GOTO="persistent_v4l_end" +SUBSYSTEM!="video4linux", GOTO="persistent_v4l_end" + +# ignore devices without a valid "index" number +TEST!="index", GOTO="persistent_v4l_end" +ATTR{index}!="?*", GOTO="persistent_v4l_end" + +IMPORT{program}="path_id $devpath" + +KERNEL=="video*|vbi*", ENV{ID_PATH}=="?*", \ + SYMLINK+="v4l/by-path/$env{ID_PATH}-video-index$attr{index}" + +KERNEL=="audio*", ENV{ID_PATH}=="?*", \ + SYMLINK+="v4l/by-path/$env{ID_PATH}-audio-index$attr{index}" + +LABEL="persistent_v4l_end" + diff --git a/rules/debian/75-cd-aliases-generator.rules b/rules/debian/75-cd-aliases-generator.rules new file mode 100644 index 0000000000..6b178a0ae7 --- /dev/null +++ b/rules/debian/75-cd-aliases-generator.rules @@ -0,0 +1,11 @@ +# These rules generate rules for the /dev/{cdrom,dvd,...} symlinks and +# write them to /etc/udev/rules.d/70-persistent-cd.rules. + +ACTION=="add", SUBSYSTEM=="block", ENV{GENERATED}!="?*", ENV{ID_CDROM}=="?*", \ + SUBSYSTEMS!="usb|ieee1394", \ + PROGRAM="write_cd_rules", SYMLINK+="$result" + +ACTION=="add", SUBSYSTEM=="block", ENV{GENERATED}!="?*", ENV{ID_CDROM}=="?*", \ + SUBSYSTEMS=="usb|ieee1394", \ + PROGRAM="write_cd_rules by-id", SYMLINK+="$result" + diff --git a/rules/debian/75-persistent-net-generator.rules b/rules/debian/75-persistent-net-generator.rules new file mode 100644 index 0000000000..e8d3b888e0 --- /dev/null +++ b/rules/debian/75-persistent-net-generator.rules @@ -0,0 +1,86 @@ +# These rules generate rules to keep network interface names unchanged +# across reboots write them to /etc/udev/rules.d/70-persistent-net.rules. + +# variables used to communicate: +# MATCHADDR MAC address used for the match +# MATCHID bus_id used for the match +# MATCHDRV driver name used for the match +# MATCHIFTYPE interface type match +# COMMENT comment to add to the generated rule +# INTERFACE_NAME requested name supplied by external tool +# INTERFACE_NEW new interface name returned by rule writer + +ACTION!="add", GOTO="persistent_net_generator_end" +SUBSYSTEM!="net", GOTO="persistent_net_generator_end" + +# ignore the interface if a name has already been set +NAME=="?*", GOTO="persistent_net_generator_end" + +# ignore interfaces without a driver link like bridges and VLANs +DRIVERS!="?*", GOTO="persistent_net_generator_end" + +# device name whitelist +KERNEL!="eth*|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", \ + GOTO="persistent_net_generator_end" + +# ignore Xen virtual interfaces +SUBSYSTEMS=="xen", GOTO="persistent_net_generator_end" + +# ignore UML virtual interfaces +DRIVERS=="uml-netdev", GOTO="persistent_net_generator_end" + +# ignore "secondary" raw interfaces of the madwifi driver +KERNEL=="ath*", ATTRS{type}=="802", GOTO="persistent_net_generator_end" + +# ignore "secondary" monitor interfaces of mac80211 drivers +KERNEL=="wlan*", ATTRS{type}=="803", GOTO="persistent_net_generator_end" + +# by default match on the MAC address and interface type +ENV{MATCHADDR}="$attr{address}" +ENV{MATCHIFTYPE}="$attr{type}" + +# ignore interfaces with locally administered or null MAC addresses +# and VMWare virtual interfaces +ENV{MATCHADDR}=="?[2367abef]:*", ENV{MATCHADDR}="" +ENV{MATCHADDR}=="00:00:00:00:00:00", ENV{MATCHADDR}="" +ENV{MATCHADDR}=="00:0c:29:*|00:50:56:*", ENV{MATCHADDR}="" + +# ibmveth interfaces have stable locally administered MAC addresses +SUBSYSTEMS=="ibmveth", ENV{MATCHADDR}="$attr{address}" + +# S/390 interfaces are matched only by id +SUBSYSTEMS=="ccwgroup", \ + ENV{MATCHDRV}="$driver", ENV{MATCHID}="$id", ENV{MATCHADDR}="" + +# terminate processing if there are not enough conditions to create a rule +ENV{MATCHADDR}=="", ENV{MATCHID}=="", ENV{INTERFACE_NAME}=="", \ + GOTO="persistent_net_generator_end" + + +# provide nice comments for the generated rules +SUBSYSTEMS=="pci", \ + ENV{COMMENT}="PCI device $attr{vendor}:$attr{device}" +SUBSYSTEMS=="pcmcia", \ + ENV{COMMENT}="PCMCIA device $attr{card_id}:$attr{manf_id}" +SUBSYSTEMS=="usb", \ + ENV{COMMENT}="USB device 0x$attr{idVendor}:0x$attr{idProduct}" +SUBSYSTEMS=="ccwgroup", \ + ENV{COMMENT}="S/390 device at $id" +SUBSYSTEMS=="ibmveth", \ + ENV{COMMENT}="LPAR virtual device at $id" +SUBSYSTEMS=="ieee1394", \ + ENV{COMMENT}="Firewire device $attr{host_id}" +ENV{COMMENT}=="", \ + ENV{COMMENT}="Unknown $env{SUBSYSTEM} device ($env{DEVPATH})" +ATTRS{driver}=="?*", \ + ENV{COMMENT}="$env{COMMENT} ($attr{driver})" + + +# generate and write the rule +IMPORT{program}="write_net_rules" + +# rename the interface if requested +ENV{INTERFACE_NEW}=="?*", NAME="$env{INTERFACE_NEW}" + +LABEL="persistent_net_generator_end" + diff --git a/rules/debian/80-drivers.rules b/rules/debian/80-drivers.rules new file mode 100644 index 0000000000..edfcfa5394 --- /dev/null +++ b/rules/debian/80-drivers.rules @@ -0,0 +1,57 @@ +ACTION!="add", GOTO="hotplug_not_add_event" + +# check if the device has already been claimed by a driver +ENV{DRIVER}=="?*", SUBSYSTEM!="input", GOTO="hotplug_driver_loaded" + +# this driver is broken and should not be loaded automatically on kernels +# < 2.6.21 (see #398962) +SUBSYSTEM=="platform", ENV{MODALIAS}=="i82365", GOTO="hotplug_driver_loaded" + +# load the drivers +ENV{MODALIAS}=="?*", \ + RUN+="/sbin/modprobe --use-blacklist $env{MODALIAS}" + +SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", \ + RUN+="/bin/sh -c '/sbin/modprobe --use-blacklist --all $$(while read id; do echo pnp:d$$id; done < /sys$devpath/id)'" + +SUBSYSTEM=="pcmcia_socket", RUN+="/sbin/modprobe pcmcia" + +# rules for subsystems which lack proper hotplug support +SUBSYSTEM=="i2o", RUN+="/sbin/modprobe i2o_block" +SUBSYSTEM=="mmc", RUN+="/sbin/modprobe mmc_block" +SUBSYSTEM=="memstick", RUN+="/sbin/modprobe --all ms_block mspro_block" +SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN+="/sbin/modprobe tifm_sd" +SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", RUN+="/sbin/modprobe tifm_ms" + +# needed for kernels < 2.6.22 +SUBSYSTEM=="scsi_device", ATTRS{type}=="0|7|14", RUN+="/sbin/modprobe sd_mod" +SUBSYSTEM=="scsi_device", ATTRS{type}=="1", RUN+="/sbin/modprobe osst", \ + ATTRS{vendor}=="Onstream", ATTRS{model}!="ADR*" +SUBSYSTEM=="scsi_device", ATTRS{type}=="1", RUN+="/sbin/modprobe st", \ + ATTRS{vendor}=="Onstream", ATTRS{model}=="ADR*" +SUBSYSTEM=="scsi_device", ATTRS{type}=="1", RUN+="/sbin/modprobe st", \ + ATTRS{vendor}!="Onstream" +SUBSYSTEM=="scsi_device", ATTRS{type}=="[45]", RUN+="/sbin/modprobe sr_mod" +SUBSYSTEM=="scsi_device", ATTRS{type}=="8", RUN+="/sbin/modprobe ch" + +SUBSYSTEM=="scsi_device", ATTRS{type}=="[235689]", TEST!="[module/sg]", \ + RUN+="/sbin/modprobe sg" + +SUBSYSTEM=="ide", ATTR{media}=="tape", RUN+="/sbin/modprobe ide-scsi" + +# From here on follows the hotplug agents which do not load modules +LABEL="hotplug_driver_loaded" + +# FIXME: does a sane default exist? +#SUBSYSTEM=="scsi_device", ATTRS{idVendor}=="...", \ +# RUN+="scsi-re-add" + +SUBSYSTEM=="firmware", RUN+="firmware.agent" + +LABEL="hotplug_not_add_event" + +SUBSYSTEM=="net", RUN+="net.agent" + +# Log every event to /dev/hotplug.log (for debugging). +#RUN+="logger.agent" + diff --git a/rules/debian/91-permissions.rules b/rules/debian/91-permissions.rules new file mode 100644 index 0000000000..5182a4bd28 --- /dev/null +++ b/rules/debian/91-permissions.rules @@ -0,0 +1,130 @@ +ACTION!="add", GOTO="permissions_end" + +# devices needed to load the drivers providing them +KERNEL=="tun", OPTIONS+="ignore_remove" +KERNEL=="ppp", OPTIONS+="ignore_remove" +KERNEL=="loop[0-9]*", OPTIONS+="ignore_remove" + +# default permissions for block devices +SUBSYSTEM=="block", GROUP="disk" +# the aacraid driver is broken and reports that disks removable (see #404927) +SUBSYSTEM=="block", ATTRS{removable}=="1", \ + DRIVERS!="aacraid", GROUP="floppy" +# all block devices on these buses are "removable" +SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394|mmc|pcmcia", GROUP="floppy" + +KERNEL=="cbm", GROUP="floppy" + +# IDE devices +ENV{ID_CDROM}=="?*", GROUP="cdrom" +KERNEL=="ht[0-9]*", GROUP="tape" +KERNEL=="nht[0-9]*", GROUP="tape" + +# SCSI devices +SUBSYSTEMS=="scsi", ATTRS{type}=="1", GROUP="tape" +SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="HP", GROUP="scanner" +SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="Epson", GROUP="scanner" +SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="EPSON", GROUP="scanner" +SUBSYSTEMS=="scsi", ATTRS{type}=="4", GROUP="cdrom" +SUBSYSTEMS=="scsi", ATTRS{type}=="5", GROUP="cdrom" +SUBSYSTEMS=="scsi", ATTRS{type}=="6", GROUP="scanner" +SUBSYSTEMS=="scsi", ATTRS{type}=="8", GROUP="tape" + +# USB devices +KERNEL=="legousbtower*", MODE="0666" +KERNEL=="lp[0-9]*", SUBSYSTEMS=="usb", GROUP="lp" + +# usbfs-like devices +SUBSYSTEM=="usb_device", MODE="0664" +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \ + MODE="0664" + +# iRiver music players +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="plugdev", \ + ATTRS{idVendor}=="4102", ATTRS{idProduct}=="10[01][135789]" + +# serial devices +SUBSYSTEM=="tty", GROUP="dialout" +SUBSYSTEM=="capi", GROUP="dialout" +SUBSYSTEM=="slamr", GROUP="dialout" +SUBSYSTEM=="zaptel", GROUP="dialout" + +# vc devices (all members of the tty subsystem) +KERNEL=="ptmx", MODE="0666", GROUP="root" +KERNEL=="console", MODE="0600", GROUP="root" +KERNEL=="tty", MODE="0666", GROUP="root" +KERNEL=="tty[0-9]*", GROUP="root" +KERNEL=="pty*", MODE="0666", GROUP="tty" + +# video devices +SUBSYSTEM=="video4linux", GROUP="video" +SUBSYSTEM=="drm", GROUP="video" +SUBSYSTEM=="dvb", GROUP="video" +SUBSYSTEM=="em8300", GROUP="video" +SUBSYSTEM=="graphics", GROUP="video" +SUBSYSTEM=="nvidia", GROUP="video" + +# misc devices +KERNEL=="random", MODE="0666" +KERNEL=="urandom", MODE="0666" +KERNEL=="mem", MODE="0640", GROUP="kmem" +KERNEL=="kmem", MODE="0640", GROUP="kmem" +KERNEL=="port", MODE="0640", GROUP="kmem" +KERNEL=="full", MODE="0666" +KERNEL=="null", MODE="0666" +KERNEL=="zero", MODE="0666" +KERNEL=="inotify", MODE="0666" +KERNEL=="sonypi", MODE="0666" +KERNEL=="agpgart", GROUP="video" +KERNEL=="nvram", GROUP="nvram" +KERNEL=="rtc|rtc[0-9]*", GROUP="audio" +KERNEL=="tpm*", MODE="0600", OWNER="tss", GROUP="tss" +KERNEL=="fuse", GROUP="fuse" +KERNEL=="kqemu", MODE="0666" +KERNEL=="kvm", GROUP="kvm" +KERNEL=="tun", MODE="0666" + +KERNEL=="cdemu[0-9]*", GROUP="cdrom" +KERNEL=="pktcdvd[0-9]*", GROUP="cdrom" +KERNEL=="pktcdvd", MODE="0644" + +KERNEL=="uverbs*", GROUP="rdma" +KERNEL=="ucm*", GROUP="rdma" +KERNEL=="rdma_cm", GROUP="rdma" + +# printers and parallel devices +SUBSYSTEM=="printer", GROUP="lp" +SUBSYSTEM=="ppdev", GROUP="lp" +KERNEL=="irlpt*", GROUP="lp" +KERNEL=="pt[0-9]*", GROUP="tape" +KERNEL=="pht[0-9]*", GROUP="tape" + +# sound devices +SUBSYSTEM=="sound", GROUP="audio" + +# ieee1394 devices +KERNEL=="raw1394", GROUP="disk" +KERNEL=="dv1394*", GROUP="video" +KERNEL=="video1394*", GROUP="video" + +# input devices +KERNEL=="event[0-9]*", ATTRS{name}=="*dvb*|*DVB*|* IR *" \ + MODE="0664", GROUP="video" +KERNEL=="js[0-9]*", MODE="0664" +KERNEL=="event[0-9]*", ENV{ID_CLASS}=="joystick", \ + MODE="0664", GROUP="audio" +KERNEL=="lirc[0-9]*", GROUP="video" + +KERNEL=="sgi_*", MODE="0666" +KERNEL=="z90crypt", MODE="0666" +KERNEL=="iseries/ibmsis*", GROUP="disk" +KERNEL=="iseries/nvt*", GROUP="disk" +KERNEL=="iseries/vt*", GROUP="disk" +KERNEL=="iseries/vtty*", GROUP="dialout" + +# AOE character devices +SUBSYSTEM=="aoe", MODE="0220", GROUP="disk" +SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440", GROUP="disk" + +LABEL="permissions_end" + diff --git a/rules/debian/95-late.rules b/rules/debian/95-late.rules new file mode 100644 index 0000000000..622e019ef3 --- /dev/null +++ b/rules/debian/95-late.rules @@ -0,0 +1,18 @@ +# run a command on remove events +ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}" + +# ignore the events generated by virtual consoles +KERNEL=="ptmx", OPTIONS+="last_rule" +KERNEL=="console", OPTIONS+="last_rule" +KERNEL=="tty" , OPTIONS+="last_rule" +KERNEL=="tty[0-9]*", OPTIONS+="last_rule" +KERNEL=="pty*", OPTIONS+="last_rule" +SUBSYSTEM=="vc", OPTIONS+="last_rule" + +# do not delete static device nodes +ACTION=="remove", NAME=="?*", TEST=="/lib/udev/devices/$name", \ + OPTIONS+="ignore_remove" + +# debugging monitor +RUN+="socket:/org/kernel/udev/monitor" + diff --git a/rules/frugalware/50-udev-default.rules b/rules/frugalware/50-udev-default.rules new file mode 100644 index 0000000000..89ffd7b442 --- /dev/null +++ b/rules/frugalware/50-udev-default.rules @@ -0,0 +1,198 @@ +# 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. +# +# See the udev.rules.examples file for more examples of how to create rules +# + +# permissions for IDE CD devices +SUBSYSTEMS=="ide", KERNEL=="*[!0-9]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT=="cdrom*", NAME="%k", GROUP="cdrom", MODE="0660" + +# permissions for SCSI cd/sg/tape devices +SUBSYSTEMS=="scsi", KERNEL=="s[grt][0-9]*", ATTRS{type}=="5", NAME="%k", GROUP="cdrom", MODE="0660" + +# USB devices +KERNEL=="hiddev*", NAME="usb/%k" +KERNEL=="auer*", NAME="usb/%k" +KERNEL=="legousbtower*", NAME="usb/%k" +KERNEL=="dabusb*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k", GROUP="lp" + +# CAPI devices +KERNEL=="capi", NAME="capi20", SYMLINK="isdn/capi20" +KERNEL=="capi*", NAME="capi/%n" + +# Network devices +KERNEL=="tun", NAME="net/%k" + +# permissions +KERNEL=="pl2303", NAME="%k", OWNER="500", GROUP="500", MODE="0666" +KERNEL=="visor", NAME="%k", OWNER="root", GROUP="uucp", MODE="0666" +KERNEL=="camera*", NAME="%k", OWNER="root", GROUP="camera", MODE="0666" + +# console devices +KERNEL=="console", NAME="%k", OWNER="root", GROUP="tty", MODE="0600" +KERNEL=="tty", NAME="%k", OWNER="root", GROUP="tty", MODE="0666" +KERNEL=="tty[0-9]*", NAME="%k", OWNER="root", GROUP="tty", MODE="0660" +KERNEL=="vcs*", NAME="%k", OWNER="root", GROUP="tty", MODE="0620" +KERNEL=="tty[CIS]*", NAME="%k", OWNER="root", GROUP="uucp", MODE="0660" +KERNEL=="ttyUB[0-9]", NAME="%k", OWNER="root", GROUP="uucp", MODE="0660" +KERNEL=="ttyUSB0", NAME="%k", OWNER="root", GROUP="uucp", MODE="0660" +KERNEL=="ttyUSB1", NAME="%k", OWNER="root" GROUP="uucp", MODE="0666" + +# pty devices +KERNEL=="ptmx", NAME="%k", OWNER="root", GROUP="tty", MODE="0666" +KERNEL=="pty[p-za-e][0-9a-f]*", NAME="%k", OWNER="root", GROUP="tty", MODE="0666" +KERNEL=="tty[p-za-e][0-9a-f]*", NAME="%k", OWNER="root", GROUP="tty", MODE="0666" +KERNEL=="cu[abiu]*", NAME="%k", OWNER="root", GROUP="uucp", MODE="0660" + +# sound devices +KERNEL=="audio*", NAME="%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="beep", NAME="%k", OWNER="root", GROUP="audio", MODE="0644" +KERNEL=="dsp*", NAME="%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="midi*", NAME="%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="mixer*", NAME="%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="music", NAME="%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="sequencer*", NAME="%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="controlC[0-9]*", NAME="snd/%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="hw[CD0-9]*", NAME="snd/%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="pcm[CD0-9cp]*", NAME="snd/%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="midiC[D0-9]*", NAME="snd/%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="timer", NAME="snd/%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="seq", NAME="snd/%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="sndstat", NAME="%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="speaker", NAME="%k", OWNER="root", GROUP="audio", MODE="0644" +KERNEL=="sound/*", NAME="%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="admmidi*", NAME="%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="adsp*", NAME="%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="aload*", NAME="%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="amidi*", NAME="%k", OWNER="root", GROUP="audio", MODE="0666" +KERNEL=="amixer*", NAME="%k", OWNER="root", GROUP="audio", MODE="0666" + +# input devices (mouse, joystick, etc) +KERNEL=="mice", NAME="input/%k", OWNER="root", GROUP="root", MODE="0644" +KERNEL=="mouse*", NAME="input/%k", OWNER="root", GROUP="root", MODE="0644" +KERNEL=="event*", NAME="input/%k", OWNER="root", GROUP="root", MODE="0644" +KERNEL=="js*", NAME="input/%k", OWNER="root", GROUP="root", MODE="0644" +KERNEL=="ts*", NAME="input/%k", OWNER="root", GROUP="root", MODE="0644" +KERNEL=="input/js*", NAME="%k", OWNER="root", GROUP="games",0 MODE="0666" +KERNEL=="djs[0-3]", NAME="%k", OWNER="root", GROUP="games", MODE="0660" +KERNEL=="psaux", NAME="%k", OWNER="root", GROUP="sys", MODE="0660" +KERNEL=="crash", NAME="%k", OWNER="root", GROUP="root", MODE="0660" +KERNEL=="logibm", NAME="%k", OWNER="root", GROUP="sys", MODE="0660" +KERNEL=="jbm", NAME="%k", OWNER="root", GROUP="sys", MODE="0660" +KERNEL=="hwtrap", NAME="%k", OWNER="root", GROUP="root", MODE="0644" +KERNEL=="inportbm", NAME="%k", OWNER="root", GROUP="sys", MODE="0660" +KERNEL=="sexec", NAME="%k", OWNER="root", GROUP="root", MODE="0660" +KERNEL=="jsflash", NAME="%k", OWNER="root", GROUP="root", MODE="0660" + +# power manager device +KERNEL=="apm_bios", NAME="%k", OWNER="root", GROUP="root", MODE="0644" + +# printer device +KERNEL=="lp[0-9]", NAME="%k", OWNER="root", GROUP="lp", MODE="0660" +KERNEL=="parport*", NAME="%k", OWNER="root", GROUP="lp", MODE="0660" + +# video devices +KERNEL=="card*", NAME="dri/card%n", OWNER="root", GROUP="video", MODE="0666" +KERNEL=="fb[0-9]", NAME="%k", OWNER="root", GROUP="video", MODE="0660" +KERNEL=="agpgart", NAME="%k", OWNER="root", GROUP="video", MODE="0660" +KERNEL=="nvidia*", NAME="%k", OWNER="root", GROUP="video", MODE="0666" +KERNEL=="video*", NAME="%k", OWNER="root", GROUP="video", MODE="0660" +KERNEL=="vbi*", NAME="%k", OWNER="root", GROUP="video", MODE="0660" +KERNEL=="dvb*", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; A=$${K%%%%.*}; D=$${K#*.}; echo dvb/adapter$$A/$$D'", NAME="%c", GROUP="video", MODE="0660" + +# DISK devices +KERNEL=="ed[ab]*", NAME="%k", OWNER="root", GROUP="disk", MODE="0640" +KERNEL=="gscd0", NAME="%k", OWNER="root", GROUP="disk", MODE="0640" +KERNEL=="initrd", NAME="%k", OWNER="root", GROUP="disk", MODE="0640" +KERNEL=="lmscd", NAME="%k", OWNER="root", GROUP="disk", MODE="0640" +KERNEL=="mcd*", NAME="%k", OWNER="root", GROUP="disk", MODE="0640" +KERNEL=="md*", NAME="%k", OWNER="root", GROUP="disk", MODE="0640" +KERNEL=="mtd*", NAME="%k", OWNER="root", GROUP="disk", MODE="0640" +KERNEL=="userdma", NAME="%k", OWNER="root", GROUP="root", MODE="0660" + +# floppy devices +KERNEL=="fd[0-3]*", NAME="%k", OWNER="root", GROUP="floppy", MODE="0660" +KERNEL=="fd0", SYMLINK="floppy" + +# permissions for removable devices like cardreaders or sticks +KERNEL=="sd*", ATTRS{scsi_level}=="3", ATTRS{type}=="0", NAME="%k", GROUP="storage" + +# permissions for firewire external drives +KERNEL=="sd*", ATTRS{scsi_level}=="5", NAME="%k", GROUP="storage" + +# permissions for usb to scsi external adapters +KERNEL=="sd*", ATTRS{scsi_level}=="3", ATTRS{type}=="7", NAME="%k", GROUP="storage" + +# IDE devices (hd, cdrom) +KERNEL=="hd*", NAME="%k", OWNER="root", GROUP="disk", MODE="0660" +KERNEL=="ht0", NAME="%k", OWNER="root", GROUP="disk", MODE="0640" + +# RAID IDE +KERNEL=="ataraid[0-9]*", NAME="%k", OWNER="root", GROUP="disk", MODE="0660" +KERNEL=="ataraid/*", NAME="%k", OWNER="root", GROUP="disk", MODE="0660" + +# SCSI devices +KERNEL=="scsi/*/cd", NAME="%k", OWNER="root", GROUP="disk", MODE="0660" +KERNEL=="scsi/*", NAME="%k", OWNER="root", GROUP="disk", MODE="0660" +KERNEL=="sd[a-h]*", NAME="%k", OWNER="root", GROUP="disk", MODE="0640" +KERNEL=="s[rt][0-9]*", NAME="%k", OWNER="root", GROUP="disk", MODE="0640" +KERNEL=="scd*", NAME="%k", OWNER="root", GROUP="disk", MODE="0660" + +# generic scsi devices +KERNEL=="sg*", NAME="%k", OWNER="root", GROUP="root", MODE="0600" + +# old CD-ROM +KERNEL=="sbpcd*", NAME="%k", OWNER="root", GROUP="disk", MODE="0640" + +# loop devices +KERNEL=="loop[0-9]*", NAME="%k", OWNER="root", GROUP="disk", MODE="0660" + +# network block devices +KERNEL=="nb[0-7]", NAME="%k", OWNER="root", GROUP="disk", MODE="0660" +KERNEL=="nht0", NAME="%k", OWNER="root", GROUP="disk", MODE="0640" +KERNEL=="npt[0-3]", NAME="%k", OWNER="root", GROUP="disk", MODE="0660" +KERNEL=="n[qrs]*", NAME="%k", OWNER="root", GROUP="disk", MODE="0640" + +# memory access devices +KERNEL=="kmem", NAME="%k", OWNER="root", GROUP="kmem", MODE="0640" +KERNEL=="mem", NAME="%k", OWNER="root", GROUP="kmem", MODE="0640" +KERNEL=="null", NAME="%k", OWNER="root", GROUP="sys", MODE="0666" +KERNEL=="nvram", NAME="%k", OWNER="root", GROUP="root", MODE="0640" +KERNEL=="port", NAME="%k", OWNER="root", GROUP="kmem", MODE="0640" +KERNEL=="ram[0-9]*", NAME="%k", OWNER="root", GROUP="disk", MODE="0640" +KERNEL=="random", NAME="%k", OWNER="root", GROUP="root", MODE="0644" +KERNEL=="rtc", NAME="%k", OWNER="root", GROUP="root", MODE="0444" +KERNEL=="urandom", NAME="%k", OWNER="root", GROUP="root", MODE="0644" +KERNEL=="full", NAME="%k", OWNER="root", GROUP="sys", MODE="0666" +KERNEL=="zero", NAME="%k", OWNER="root", GROUP="root", MODE="0666" +KERNEL=="raw[0-9]*", NAME="raw/%k", OWNER="root", GROUP="disk", MODE="0660" +KERNEL=="modreq", NAME="%k", OWNER="root", GROUP="root", MODE="0644" +KERNEL=="msr", NAME="%k", OWNER="root", GROUP="root", MODE="0660" +KERNEL=="profile*", NAME="%k", OWNER="root", GROUP="root", MODE="0640" + +# ISDN devices +KERNEL=="isdn*", NAME="%k", OWNER="root", GROUP="tty", MODE="0660" + +# net devices +KERNEL=="ippp*", NAME="%k", OWNER="root", GROUP="root", MODE="0644" +KERNEL=="ipstate*", NAME="%k", OWNER="root", GROUP="root", MODE="0660" +KERNEL=="spx", NAME="%k", OWNER="root", GROUP="root", MODE="0644" +KERNEL=="fwmonitor*", NAME="%k", OWNER="root", GROUP="root", MODE="0660" + +# hotplug rules - module autoloading for different buses +ACTION=="add", SUBSYSTEM=="pci", ENV{MODALIAS}=="*", RUN+="/sbin/modprobe $env{MODALIAS}" +ACTION=="add", SUBSYSTEM=="usb", ENV{MODALIAS}=="*", RUN+="/sbin/modprobe $env{MODALIAS}" +ACTION=="add", SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="*", RUN+="/sbin/modprobe $env{MODALIAS}" +ACTION=="add", SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="*", RUN+="/bin/sh -c 'echo 1 > /sys/$DEVPATH/allow_func_id_match'" +ACTION=="add", SUBSYSTEM=="ieee1394", ENV{MODALIAS}=="*", RUN+="/sbin/modprobe $env{MODALIAS}" +ACTION=="add", SUBSYSTEM=="scsi", ATTRS{type}=="[07]", RUN+="/sbin/modprobe sd_mod" +ACTION=="add", SUBSYSTEM=="scsi", ATTRS{type}=="14", RUN+="/sbin/modprobe sd_mod" +ACTION=="add", SUBSYSTEM=="scsi", ATTRS{type}=="[45]", RUN+="/sbin/modprobe sr_mod" +ACTION=="add", SUBSYSTEM=="scsi", ATTRS{type}=="1", ATTRS{vendor}=="Onstream", ATTRS{model}!="ADR*", RUN+="/sbin/modprobe osst" +ACTION=="add", SUBSYSTEM=="scsi", ATTRS{type}=="1", ATTRS{vendor}=="Onstream", ATTRS{model}=="ADR*", RUN+="/sbin/modprobe st" +ACTION=="add", SUBSYSTEM=="scsi", ATTRS{type}=="1", ATTRS{vendor}!="Onstream", RUN+="/sbin/modprobe st" +ACTION=="add", SUBSYSTEM=="scsi", ATTRS{type}=="[23689]", RUN+="/sbin/modprobe sg" + +# firmware +ACTION=="add", SUBSYSTEM=="firmware", ENV{FIRMWARE}=="*", RUN+="/lib/udev/firmware.sh" diff --git a/rules/frugalware/64-device-mapper.rules b/rules/frugalware/64-device-mapper.rules new file mode 100644 index 0000000000..3837d3f2c7 --- /dev/null +++ b/rules/frugalware/64-device-mapper.rules @@ -0,0 +1,15 @@ +# device mapper links hook into "online" event, when the dm table +# is available, while some table types must be ignored + +KERNEL=="dm-*", ACTION=="add|online", GOTO="device_mapper_do" +GOTO="device_mapper_end" + +LABEL="device_mapper_do" +PROGRAM!="/sbin/dmsetup status -j %M -m %m", GOTO="device_mapper_end" +RESULT=="|*snapshot*|*error*", GOTO="device_mapper_end" + +IMPORT{program}="/sbin/vol_id --export $tempnode" +ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}" +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/rules/gentoo/30-kernel-compat.rules b/rules/gentoo/30-kernel-compat.rules new file mode 100644 index 0000000000..1f767df8d8 --- /dev/null +++ b/rules/gentoo/30-kernel-compat.rules @@ -0,0 +1,47 @@ +# do not edit this file, it will be overwritten on update + +ACTION!="add", GOTO="kernel_compat_end" + +# workarounds needed to synchronize with sysfs +DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus" + +# 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" + + + +# 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" + + + +# 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" + +# 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 + + 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" + + ATTRS{type}=="1", ATTRS{vendor}=="On[sS]tream", \ + ATTRS{model}!="ADR*", RUN+="/sbin/modprobe osst", GOTO="kernel_compat_end" + ATTRS{type}=="1", RUN+="/sbin/modprobe st" + +LABEL="kernel_compat_end" + + diff --git a/rules/gentoo/40-gentoo.rules b/rules/gentoo/40-gentoo.rules new file mode 100644 index 0000000000..99a1c66c69 --- /dev/null +++ b/rules/gentoo/40-gentoo.rules @@ -0,0 +1,12 @@ +# do not edit this file, it will be overwritten on update + +# capi devices +KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20" +KERNEL=="capi*", NAME="capi/%n" + +# old devfs path, removing this could break systems +# Bug 195839 +KERNEL=="md[0-9]*", SYMLINK+="md/%n" +KERNEL=="loop[0-9]*", SYMLINK+="loop/%n" +KERNEL=="ram[0-9]*", SYMLINK+="rd/%n" + diff --git a/rules/gentoo/40-video.rules b/rules/gentoo/40-video.rules new file mode 100644 index 0000000000..2d5e53411c --- /dev/null +++ b/rules/gentoo/40-video.rules @@ -0,0 +1,24 @@ +# do not edit this file, it will be overwritten on update + +# video4linux +KERNEL=="video[0-9]*", NAME="v4l/video%n", SYMLINK+="%k", GROUP="video" +KERNEL=="radio[0-9]*", NAME="v4l/radio%n", SYMLINK+="%k", GROUP="video" +KERNEL=="vbi[0-9]*", NAME="v4l/vbi%n", SYMLINK+="%k", GROUP="video" +KERNEL=="vtx[0-9]*", NAME="v4l/vtx%n", GROUP="video" + +SUBSYSTEM=="dvb", GROUP="video" + +# device node will be /dev/dri/card? +KERNEL=="card*", GROUP="video" +KERNEL=="nvidia*", GROUP="video" +KERNEL=="3dfx*", GROUP="video" + +# svgalib +KERNEL=="svga*", GROUP="video" + +# Framebuffer +KERNEL=="fb[0-9]*", GROUP="video" + +# IEEE1394 (firewire) devices +KERNEL=="dv1394*|video1394*|raw1394*", GROUP="video" + diff --git a/rules/gentoo/65-permissions.rules b/rules/gentoo/65-permissions.rules new file mode 100644 index 0000000000..494f19e63f --- /dev/null +++ b/rules/gentoo/65-permissions.rules @@ -0,0 +1,26 @@ +# do not edit this file, it will be overwritten on update + +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="usb", MODE="664" + +# cdrom devices +ENV{ID_CDROM}=="?*", GROUP="cdrom", MODE="660" +KERNEL=="pktcdvd|pktcdvd[0-9]*", GROUP="cdrom", MODE="660" +# assign cdrom-permission also to associated generic device (for cd-burning ...) +SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", ATTRS{type}=="[45]", GROUP="cdrom", MODE="660" + + +# tape devices +KERNEL=="st[0-9]*|nst[0-9]*|ht[0-9]*|nht[0-9]*|pt[0-9]*|npt[0-9]*", \ + GROUP="tape", MODE="660" +SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", ATTRS{type}=="[18]", GROUP="tape", MODE="660" + +# dialout devices +KERNEL=="ippp*|isdn*|dcbri*|capi*", GROUP="uucp" +KERNEL=="pilot", GROUP="uucp" + +# sound devices (sound=alsa, snd=oss) +SUBSYSTEM=="sound|snd", GROUP="audio" + +# Sony Vaio Jogdial sonypi device +KERNEL=="sonypi", MODE="0666" + diff --git a/rules/gentoo/90-network.rules b/rules/gentoo/90-network.rules new file mode 100644 index 0000000000..50903af157 --- /dev/null +++ b/rules/gentoo/90-network.rules @@ -0,0 +1,8 @@ +# do not edit this file, it will be overwritten on update + +# /etc/udev/rules/90-network.rules: triggering network init-scripts + +# Activate our network if we can +SUBSYSTEM=="net", ACTION=="add", RUN+="net.sh %k start" +SUBSYSTEM=="net", ACTION=="remove", RUN+="net.sh %k stop" + diff --git a/rules/packages/40-alsa.rules b/rules/packages/40-alsa.rules new file mode 100644 index 0000000000..d30a1da8fc --- /dev/null +++ b/rules/packages/40-alsa.rules @@ -0,0 +1,11 @@ +# do not edit this file, it will be overwritten on update + +KERNEL=="controlC[0-9]*", NAME="snd/%k" +KERNEL=="hwC[D0-9]*", NAME="snd/%k" +KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k" +KERNEL=="midiC[D0-9]*", NAME="snd/%k" +KERNEL=="timer", NAME="snd/%k" +KERNEL=="seq", NAME="snd/%k" +KERNEL=="mixer0", SYMLINK+="mixer" +KERNEL=="dsp0", SYMLINK+="dsp" +KERNEL=="audio0", SYMLINK+="audio" diff --git a/rules/packages/40-ia64.rules b/rules/packages/40-ia64.rules new file mode 100644 index 0000000000..5846f88b1b --- /dev/null +++ b/rules/packages/40-ia64.rules @@ -0,0 +1,4 @@ +# do not edit this file, it will be overwritten on update + +KERNEL=="sgi_*", MODE="0666" + diff --git a/rules/packages/40-pilot-links.rules b/rules/packages/40-pilot-links.rules new file mode 100644 index 0000000000..1242fff102 --- /dev/null +++ b/rules/packages/40-pilot-links.rules @@ -0,0 +1,4 @@ +# do not edit this file, it will be overwritten on update + +KERNEL=="ttyUSB*", ATTRS{product}=="[Hh]andspring*Treo*|[Hh]andspring*Visor*|[Pp]alm*Handheld*", SYMLINK+="pilot" + diff --git a/rules/packages/40-ppc.rules b/rules/packages/40-ppc.rules new file mode 100644 index 0000000000..8b62d79e0c --- /dev/null +++ b/rules/packages/40-ppc.rules @@ -0,0 +1,6 @@ +# do not edit this file, it will be overwritten on update + +KERNEL=="iseries/ibmsis*", NAME="%k", GROUP="disk" +KERNEL=="iseries/nvt*", NAME="%k", GROUP="disk" +KERNEL=="iseries/vt*", NAME="%k", GROUP="disk" +KERNEL=="iseries/vtty*", GROUP="uucp" diff --git a/rules/packages/40-s390.rules b/rules/packages/40-s390.rules new file mode 100644 index 0000000000..43035dbe60 --- /dev/null +++ b/rules/packages/40-s390.rules @@ -0,0 +1,4 @@ +# do not edit this file, it will be overwritten on update + +KERNEL=="z90crypt", MODE="0666" + diff --git a/rules/packages/40-zaptel.rules b/rules/packages/40-zaptel.rules new file mode 100644 index 0000000000..4313a9172e --- /dev/null +++ b/rules/packages/40-zaptel.rules @@ -0,0 +1,8 @@ +# do not edit this file, it will be overwritten on update + +KERNEL=="zap[0-9]*", NAME="zap/%n" +KERNEL=="zapchannel", NAME="zap/channel" +KERNEL=="zapctl", NAME="zap/ctl" +KERNEL=="zappseudo", NAME="zap/pseudo" +KERNEL=="zaptimer", NAME="zap/timer" + diff --git a/rules/packages/64-device-mapper.rules b/rules/packages/64-device-mapper.rules new file mode 100644 index 0000000000..8154ef3702 --- /dev/null +++ b/rules/packages/64-device-mapper.rules @@ -0,0 +1,4 @@ +# do not edit this file, it will be overwritten on update + +KERNEL=="device-mapper", NAME="mapper/control" + diff --git a/rules/packages/64-md-raid.rules b/rules/packages/64-md-raid.rules new file mode 100644 index 0000000000..d0510b3095 --- /dev/null +++ b/rules/packages/64-md-raid.rules @@ -0,0 +1,22 @@ +# do not edit this file, it will be overwritten on update + +SUBSYSTEM!="block", GOTO="md_end" +ACTION!="add|change", GOTO="md_end" + +# import data from a raid member and activate it +#ENV{ID_FS_TYPE}=="linux_raid_member", IMPORT{program}="/sbin/mdadm --examine --export $tempnode", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" +# import data from a raid set +KERNEL!="md*", GOTO="md_end" + +ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" + +IMPORT{program}="/sbin/mdadm --detail --export $tempnode" +ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}" +ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}" + +IMPORT{program}="vol_id --export $tempnode" +OPTIONS+="link_priority=100" +ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" +ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" + +LABEL="md_end" diff --git a/rules/redhat/40-redhat.rules b/rules/redhat/40-redhat.rules new file mode 100644 index 0000000000..446cc6d1d5 --- /dev/null +++ b/rules/redhat/40-redhat.rules @@ -0,0 +1,25 @@ +# do not edit this file, it will be overwritten on update + +KERNEL=="hd*[!0-9]", SUBSYSTEMS=="ide", ATTRS{media}=="floppy", SYMLINK+="floppy floppy-%k", OPTIONS+="ignore_remove" +KERNEL=="hd*[0-9]", ATTRS{media}=="floppy", ATTRS{removable}=="1", SYMLINK+="floppy-%k", OPTIONS+="ignore_remove" + +KERNEL=="fw*", PROGRAM="fw_unit_symlinks.sh %k %n", SYMLINK+="$result" + +ACTION=="add", KERNEL=="sg[0-9]*", BUS=="scsi", ATTRS{type}=="3|6", SYMLINK+="scanner scanner-%k", MODE="0660" + +ACTION=="add", KERNEL=="sg[0-9]*", BUS=="scsi", ATTRS{type}=="8", SYMLINK+="changer changer-%k", MODE="0660", GROUP="disk" + +BUS=="usb", KERNEL=="sd*", ATTRS{bInterfaceClass}=="08", ATTRS{bInterfaceSubClass}=="04", GROUP="floppy", MODE="0660", SYMLINK+="floppy floppy-%k" + +KERNEL=="fd[0-9]*", SYMLINK+="floppy floppy-%k" + +ACTION=="add", SUBSYSTEM=="scsi_device", ATTRS{type}=="0|7|14", \ + RUN+="/sbin/modprobe sd_mod" +ACTION=="add", SUBSYSTEM=="scsi_device", ATTRS{type}=="[45]", \ + RUN+="/sbin/modprobe sr_mod" + +KERNEL=="vcs", OWNER="vcsa", GROUP="tty" +KERNEL=="vcs[0-9]*", OWNER="vcsa", GROUP="tty" +KERNEL=="vcsa", OWNER="vcsa", GROUP="tty" +KERNEL=="vcsa[0-9]*", OWNER="vcsa", GROUP="tty" +KERNEL=="vcc/*", OWNER="vcsa", GROUP="tty" diff --git a/rules/redhat/95-pam-console.rules b/rules/redhat/95-pam-console.rules new file mode 100644 index 0000000000..cbb2d4aaf9 --- /dev/null +++ b/rules/redhat/95-pam-console.rules @@ -0,0 +1 @@ +ENV{STARTUP}!="1", ACTION=="add", SYSFS{dev}=="?*", KERNEL=="?*", RUN+="/sbin/pam_console_apply $env{DEVNAME} $env{DEVLINKS}" diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules new file mode 100644 index 0000000000..718d1899f5 --- /dev/null +++ b/rules/rules.d/50-udev-default.rules @@ -0,0 +1,107 @@ +# do not edit this file, it will be overwritten on update + +KERNEL=="pty[pqrstuvwxyzabcdef][0123456789abcdef]", GROUP="tty", MODE="0660", OPTIONS+="last_rule" +KERNEL=="tty[pqrstuvwxyzabcdef][0123456789abcdef]", GROUP="tty", MODE="0660", OPTIONS+="last_rule" +KERNEL=="ptmx", GROUP="tty", MODE="0666", OPTIONS+="last_rule" +KERNEL=="tty", GROUP="tty", MODE="0666", OPTIONS+="last_rule" +KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620", OPTIONS+="last_rule" +KERNEL=="vcs|vcs[0-9]*|vcsa|vcsa[0-9]*", GROUP="tty", OPTIONS+="last_rule" +KERNEL=="console", MODE="0600", OPTIONS+="last_rule" + +# serial +KERNEL=="tty[A-Z]*|pppox*|ircomm*|noz*", GROUP="uucp" +KERNEL=="ppp", MODE="0600", OPTIONS+="ignore_remove" +KERNEL=="mwave", NAME="modems/mwave", GROUP="uucp" +KERNEL=="hvc*|hvsi*", GROUP="uucp" +KERNEL=="lirc0", SYMLINK+="lirc" + +# mem +KERNEL=="null|zero|full|random|urandom", MODE="0666" +KERNEL=="null", SYMLINK+="XOR" +KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640" +KERNEL=="ram0", SYMLINK+="ramdisk" +KERNEL=="ram1", SYMLINK+="ram" + +# input +KERNEL=="mouse*|mice|event*", NAME="input/%k", MODE="0640" +KERNEL=="ts[0-9]*|uinput", NAME="input/%k", MODE="0600" +KERNEL=="js[0-9]*", NAME="input/%k", MODE="0644", SYMLINK+="%k" + +# video4linux +KERNEL=="vbi0", SYMLINK+="vbi" +KERNEL=="radio0", SYMLINK+="radio" +KERNEL=="video0", SYMLINK+="video" + +# graphics +KERNEL=="agpgart", MODE="0600" +KERNEL=="card[0-9]*", NAME="dri/%k", MODE="0666" +KERNEL=="fb0", SYMLINK+="fb" + +# DVB video +SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", NAME="%c" + +# Firewire +KERNEL=="dv1394*", SYMLINK+="dv1394/%n" +KERNEL=="video1394*", NAME="video1394/%n" + +# firmware class requests +SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware.sh" + +# libusb device nodes +SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644" + +# printer +KERNEL=="parport[0-9]*", GROUP="lp" +SUBSYSTEM=="printer", KERNEL=="lp*", GROUP="lp" +SUBSYSTEM=="usb", KERNEL=="lp*", NAME="usb/%k", SYMLINK+="usb%k", GROUP="lp" +KERNEL=="lp[0-9]*", GROUP="lp", SYMLINK+="par%n" +KERNEL=="irlpt[0-9]*", GROUP="lp" + +# block, tapes, block-releated +SUBSYSTEM=="block", GROUP="disk", MODE="0640" +SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n" +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" +KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="floppy", OPTIONS+="all_partitions" +KERNEL=="fd[0-9]", GROUP="floppy" +KERNEL=="fd[0-9]", ACTION=="add", ATTRS{cmos}=="?*", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0640 -G floppy $root/%k" +KERNEL=="sch[0-9]*", GROUP="disk" +KERNEL=="sg[0-9]*", ATTRS{type}!="3|6", GROUP="disk", MODE="0640" +KERNEL=="ht[0-9]*|nht[0-9]*", GROUP="disk" +KERNEL=="pg[0-9]*", GROUP="disk" +KERNEL=="pt[0-9]*|npt[0-9]*", GROUP="disk" +KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*", GROUP="disk" +KERNEL=="rawctl", NAME="raw/%k", GROUP="disk" +SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", NAME="raw/%k", GROUP="disk" +KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%k" +KERNEL=="pktcdvd", NAME="pktcdvd/control" +KERNEL=="qft0", SYMLINK+="ftape" +SUBSYSTEM=="bsg", NAME="bsg/%k" +SUBSYSTEM=="aoe", NAME="etherd/%k", GROUP="disk" + +# network +KERNEL=="tun", NAME="net/%k", MODE="0666", OPTIONS+="ignore_remove" + +# CPU +KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid" +KERNEL=="msr[0-9]*", NAME="cpu/%n/msr" +KERNEL=="microcode", NAME="cpu/microcode", MODE="0600" + +# miscellaneous +KERNEL=="fuse", MODE="0666" +KERNEL=="rtc|rtc0", MODE="0644" +KERNEL=="rtc0", SYMLINK+="rtc" +KERNEL=="auer[0-9]*", NAME="usb/%k" +KERNEL=="hw_random", NAME="hwrng", SYMLINK+="%k" +KERNEL=="mmtimer", MODE="0644" +KERNEL=="rflash[0-9]*", MODE="0400" +KERNEL=="rrom[0-9]*", MODE="0400" +KERNEL=="sbpcd0", SYMLINK+="sbpcd" +KERNEL=="slram[0-9]*", SYMLINK+="xpram%n" +KERNEL=="sxctl", NAME="specialix_sxctl", SYMLINK+="%k" +KERNEL=="rioctl", NAME="specialix_rioctl", SYMLINK+="%k" +KERNEL=="iowarrior[0-9]*", NAME="usb/%k" + +# do not delete static device nodes +ACTION=="remove", NAME=="?*", TEST=="/lib/udev/devices/$name", OPTIONS+="ignore_remove" + diff --git a/rules/rules.d/60-persistent-input.rules b/rules/rules.d/60-persistent-input.rules new file mode 100644 index 0000000000..34d5ef1557 --- /dev/null +++ b/rules/rules.d/60-persistent-input.rules @@ -0,0 +1,32 @@ +# do not edit this file, it will be overwritten on update + +ACTION!="add|change", GOTO="persistent_input_end" +SUBSYSTEM!="input", GOTO="persistent_input_end" +KERNEL=="input[0-9]*", GOTO="persistent_input_end" + +# usb devices +SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export" +SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="01", ENV{ID_CLASS}="kbd" +SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="02", ENV{ID_CLASS}="mouse" + +# other devices +DRIVERS=="pcspkr", ENV{ID_CLASS}="spkr" +DRIVERS=="atkbd", ENV{ID_CLASS}="kbd" +DRIVERS=="psmouse", ENV{ID_CLASS}="mouse" +ATTRS{name}=="*dvb*|*DVB*|* IR *", ENV{ID_CLASS}="ir" +ATTRS{modalias}=="input:*-*a[068],*|input:*-*a*,[68],*m*", ATTRS{modalias}!="input:*-*k*14A,*r*", ENV{ID_CLASS}="joystick" + +# fill empty serial number +ENV{ID_CLASS}=="?*", ENV{ID_SERIAL}=="", ENV{ID_SERIAL}="noserial" + +# by-id links +KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{ID_CLASS}=="?*", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_CLASS}" +KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{ID_CLASS}=="?*", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-$env{ID_CLASS}" + +# by-path +IMPORT{program}="path_id %p" +ENV{ID_PATH}=="?*", KERNEL=="mouse*|js*", SYMLINK+="input/by-path/$env{ID_PATH}-$env{ID_CLASS}" +ENV{ID_PATH}=="?*", KERNEL=="event*", SYMLINK+="input/by-path/$env{ID_PATH}-event-$env{ID_CLASS}" + +LABEL="persistent_input_end" + diff --git a/rules/rules.d/60-persistent-storage-tape.rules b/rules/rules.d/60-persistent-storage-tape.rules new file mode 100644 index 0000000000..d3226f1320 --- /dev/null +++ b/rules/rules.d/60-persistent-storage-tape.rules @@ -0,0 +1,24 @@ +# do not edit this file, it will be overwritten on update + +# persistent storage links: /dev/tape/{by-id,by-path} + +ACTION!="add|change", GOTO="persistent_storage_tape_end" + +# type 8 devices are "Medium Changers" +KERNEL=="sg[0-9]*", SUBSYSTEMS=="scsi", ATTRS{type}=="8", IMPORT{program}="scsi_id --sg-version=3 --export --whitelisted -d $tempnode", SYMLINK+="tape/by-id/scsi-$env{ID_SERIAL}" + +SUBSYSTEM!="scsi_tape", GOTO="persistent_storage_tape_end" + +KERNEL=="st*[0-9]|nst*[0-9]", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394" +KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p" +KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", KERNELS=="[0-9]*:*[0-9]", ENV{BSG_DEV}="$root/bsg/$id" +KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", WAIT_FOR="$env{BSG_DEV}", IMPORT="scsi_id --whitelisted --export --device=$env{BSG_DEV}", ENV{ID_BUS}="scsi" +KERNEL=="st*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}" +KERNEL=="nst*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst" + +# by-path (parent device path) +KERNEL=="st*[0-9]|nst*[0-9]", IMPORT{program}="path_id %p" +KERNEL=="st*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}" +KERNEL=="nst*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}-nst" + +LABEL="persistent_storage_tape_end" diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules new file mode 100644 index 0000000000..5ae0c7fec9 --- /dev/null +++ b/rules/rules.d/60-persistent-storage.rules @@ -0,0 +1,63 @@ +# do not edit this file, it will be overwritten on update + +# persistent storage links: /dev/disk/{by-id,by-uuid,by-label,by-path} +# scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de> + +# forward scsi device event to corresponding block device +ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change" + +ACTION!="add|change", GOTO="persistent_storage_end" +SUBSYSTEM!="block", GOTO="persistent_storage_end" + +# skip rules for inappropriate block devices +KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-*|md*", GOTO="persistent_storage_end" + +# never access non-cdrom removable ide devices, the drivers are causing event loops on open() +KERNEL=="hd*[!0-9]", ATTR{removable}=="1", DRIVERS=="ide-cs|ide-floppy", GOTO="persistent_storage_end" +KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GOTO="persistent_storage_end" + +# ignore partitions that span the entire disk +TEST=="whole_disk", GOTO="persistent_storage_end" + +# /sys/class/block will export this +ENV{DEVTYPE}!="?*", ATTR{range}=="?*", ENV{DEVTYPE}="disk" +ENV{DEVTYPE}!="?*", ATTR{start}=="?*", ENV{DEVTYPE}="partition" + +# for partitions import parent information +ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*" + +# by-id (hardware serial number) +KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode" +KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}" +KERNEL=="hd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n" + +KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394" +KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p" +KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="scsi" +KERNEL=="cciss?c[0-9]d[0-9]*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="cciss" +KERNEL=="sd*[!0-9]|sr*|cciss?c[0-9]d[0-9]*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" +KERNEL=="sd*[0-9]|cciss*p[0-9]*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" + +# libata compat (links like hd*) +KERNEL=="sd*[!0-9]|sr*", ENV{ID_VENDOR}=="ATA", PROGRAM="ata_id $tempnode", RESULT=="?*", ENV{ID_ATA_COMPAT}="$result", SYMLINK+="disk/by-id/ata-$env{ID_ATA_COMPAT}" +KERNEL=="sd*[0-9]", ENV{ID_ATA_COMPAT}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_ATA_COMPAT}-part%n" + +KERNEL=="mmcblk[0-9]", SUBSYSTEMS=="mmc", ATTRS{name}=="?*", ATTRS{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}" +KERNEL=="mmcblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}-part%n" + +# by-path (parent device path) +ENV{DEVTYPE}=="disk", IMPORT{program}="path_id %p" +ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" +ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" + +# skip unpartitioned removable media devices from drivers which do not send "change" events +ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end" + +# import filesystem metadata +IMPORT{program}="vol_id --export $tempnode" + +# by-label/by-uuid links (filesystem metadata) +ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" +ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" + +LABEL="persistent_storage_end" diff --git a/rules/rules.d/60-persistent-v4l.rules b/rules/rules.d/60-persistent-v4l.rules new file mode 100644 index 0000000000..0d673ab396 --- /dev/null +++ b/rules/rules.d/60-persistent-v4l.rules @@ -0,0 +1,14 @@ +# do not edit this file, it will be overwritten on update + +ACTION!="add|change", GOTO="persistent_v4l_end" +SUBSYSTEM!="video4linux", GOTO="persistent_v4l_end" + +# check for valid "index" number +TEST!="index", GOTO="persistent_v4l_end" +ATTR{index}!="?*", GOTO="persistent_v4l_end" + +IMPORT{program}="path_id %p" +ENV{ID_PATH}=="?*", KERNEL=="video*|vbi*", SYMLINK+="v4l/by-path/$env{ID_PATH}-video-index$attr{index}" +ENV{ID_PATH}=="?*", KERNEL=="audio*", SYMLINK+="v4l/by-path/$env{ID_PATH}-audio-index$attr{index}" + +LABEL="persistent_v4l_end" diff --git a/rules/rules.d/80-drivers.rules b/rules/rules.d/80-drivers.rules new file mode 100644 index 0000000000..881d7581bf --- /dev/null +++ b/rules/rules.d/80-drivers.rules @@ -0,0 +1,17 @@ +# do not edit this file, it will be overwritten on update + +ACTION!="add", GOTO="drivers_end" + +DRIVER!="?*", ENV{MODALIAS}=="?*", RUN{ignore_error}+="/sbin/modprobe $env{MODALIAS}" +SUBSYSTEM=="pnp", DRIVER!="?*", ENV{MODALIAS}!="?*", \ + RUN{ignore_error}+="/bin/sh -c '/sbin/modprobe -a $$(while read id; do echo pnp:d$$id; done < /sys$devpath/id)'" +SUBSYSTEM=="tifm", RUN+="/sbin/modprobe --all tifm_sd tifm_ms" +SUBSYSTEM=="memstick", RUN+="/sbin/modprobe --all ms_block mspro_block" +SUBSYSTEM=="mmc", RUN+="/sbin/modprobe mmc_block" +SUBSYSTEM=="i2o", RUN+="/sbin/modprobe i2o_block" +SUBSYSTEM=="ide", ATTR{media}=="tape", RUN+="/sbin/modprobe ide-scsi" +SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST!="[module/sg]", RUN+="/sbin/modprobe sg" +SUBSYSTEM=="module", KERNEL=="parport_pc", RUN+="/sbin/modprobe ppdev" + +LABEL="drivers_end" + diff --git a/rules/rules.d/95-udev-late.rules b/rules/rules.d/95-udev-late.rules new file mode 100644 index 0000000000..7207081d46 --- /dev/null +++ b/rules/rules.d/95-udev-late.rules @@ -0,0 +1,8 @@ +# do not edit this file, it will be overwritten on update + +# run a command on remove events +ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}" + +# event to be catched by udevmonitor +RUN+="socket:@/org/kernel/udev/monitor" + diff --git a/rules/slackware/udev.rules b/rules/slackware/udev.rules new file mode 100644 index 0000000000..12dac4d84d --- /dev/null +++ b/rules/slackware/udev.rules @@ -0,0 +1,355 @@ +# /etc/udev/udev.rules: device naming rules for udev +# +# 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. +# +# This rules file is a mix of 10.2 Slackware udev.rules file and some +# rules from the udev examples. +# + +# wait for sysfs +ACTION=="add", DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus" +ACTION=="add", SUBSYSTEM=="scsi", WAIT_FOR_SYSFS="ioerr_cnt" +ACTION=="add", SUBSYSTEM=="net", WAIT_FOR_SYSFS="address" + +# all block devices +SUBSYSTEM=="block", GROUP="disk" + +# permissions for IDE CD devices (without symbolic link creation) +BUS=="ide", KERNEL=="*[!0-9]", ENV{PHYSDEVDRIVER}=="ide-cdrom", NAME="%k", GROUP="cdrom", MODE="0660" + +# permissions for IDE CD devices (with symbolic link creation) +# THIS RULE COMMENTED OUT BY DEFAULT: read /lib/udev/rc.optical-symlinks for more information... +#BUS=="ide", KERNEL=="*[!0-9]", ENV{PHYSDEVDRIVER}=="ide-cdrom", NAME="%k", GROUP="cdrom", MODE="0660", RUN+="/lib/udev/cdrom-symlinks.sh %k" + +# permissions for IDE floppy devices +BUS=="ide", KERNEL=="*[!0-9]", ENV{PHYSDEVDRIVER}=="ide-floppy*", NAME="%k", GROUP="floppy", MODE="0660" + +# permissions for SCSI cd/sg/tape devices +BUS=="scsi", KERNEL=="s[grt][0-9]*", SYSFS{type}=="5", NAME="%k", GROUP="cdrom", MODE="0660" + +# load modules to scsi disks, if they aren't in kernel +SUBSYSTEM=="scsi_device", ACTION=="add", SYSFS{device/type}=="0|7|14", RUN+="/sbin/modprobe sd_mod" +SUBSYSTEM=="scsi_device", ACTION=="add", SYSFS{device/type}=="1", SYSFS{device/vendor}=="On[sS]tream", RUN+="/sbin/modprobe osst" +SUBSYSTEM=="scsi_device", ACTION=="add", SYSFS{device/type}=="1", RUN+="/sbin/modprobe st" +SUBSYSTEM=="scsi_device", ACTION=="add", SYSFS{device/type}=="[45]", RUN+="/sbin/modprobe sr_mod" +SUBSYSTEM=="scsi_device", ACTION=="add", RUN+="/sbin/modprobe sg" + +# disk devices +KERNEL=="sd*", NAME="%k", GROUP="disk" +KERNEL=="dasd*", NAME="%k", GROUP="disk" +KERNEL=="ataraid*", NAME="%k", GROUP="disk" + +# persistent storage links: /dev/disk/{by-id,by-uuid,by-label,by-path} + +ACTION!="add", GOTO="persistent_end" +SUBSYSTEM!="block", GOTO="persistent_end" + +# skip rules for inappropriate block devices +KERNEL=="ram*|loop*|fd*|nbd*", GOTO="persistent_end" + +# never access removable ide devices, the drivers are causing event loops on open() +BUS=="ide", DRIVER!="ide-cdrom", SYSFS{removable}=="1", GOTO="persistent_end" + +# by-id (hardware serial number) +KERNEL=="hd*[!0-9]", IMPORT{program}="/lib/udev/ata_id --export $tempnode" +KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}" +KERNEL=="hd*[0-9]", IMPORT{parent}=="ID_*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n" + +KERNEL=="sd*[!0-9]|sr*", SYSFS{ieee1394_id}=="*", ENV{ID_SERIAL}="$sysfs{ieee1394_id}", ENV{ID_BUS}="ieee1394" +KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="/lib/udev/usb_id -x" +KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="/lib/udev/scsi_id -g -x -s %p -d $tempnode" +KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="/lib/udev/scsi_id -g -x -a -s %p -d $tempnode" +KERNEL=="dasd*[!0-9]", IMPORT{program}="/lib/udev/dasd_id --export $tempnode" +KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}" + +# for partitions import parent information +KERNEL=="sd*[0-9]|dasd*[0-9]", IMPORT{parent}=="ID_*" +KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n" + +# by-path (shortest physical path) +KERNEL=="*[!0-9]|sr*", ENV{ID_TYPE}=="?*", IMPORT{program}="/lib/udev/path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}" +KERNEL=="st*", ENV{ID_TYPE}=="?*", IMPORT{program}="/lib/udev/path_id %p", SYMLINK+="tape/by-path/$env{ID_PATH}" +KERNEL=="sr*|st*", GOTO="persistent_end" +KERNEL=="*[0-9]", IMPORT{parent}=="ID_*" +KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" + +# by-label/by-uuid (filesystem properties) +KERNEL=="*[!0-9]", SYSFS{removable}=="1", GOTO="persistent_end" +IMPORT{program}="/lib/udev/vol_id --export $tempnode" +ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}" +ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}" + +# BIOS Enhanced Disk Device +KERNEL=="*[!0-9]", IMPORT{program}="/lib/udev/edd_id --export $tempnode" +KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}" +KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n" + +# LVM2 dmsetup +KERNEL=="dm-[0-9]*", ACTION=="add", PROGRAM="/sbin/dmsetup info -c --noopencount --noheadings -o name -j %M -m %m", SYMLINK+="disk/by-name/%c" + +LABEL="persistent_end" + +# ALSA devices +SUBSYSTEM=="sound", GROUP="audio" +SUBSYSTEM=="snd", GROUP="audio" +KERNEL=="controlC[0-9]*", NAME="snd/%k", MODE="0666" +KERNEL=="hw[CD0-9]*", NAME="snd/%k", MODE="0662" +KERNEL=="pcm[CD0-9]*c", NAME="snd/%k", MODE="0662" +KERNEL=="pcm[CD0-9]*p", NAME="snd/%k", MODE="0666" +KERNEL=="midiC[D0-9]*", NAME="snd/%k", MODE="0666" +KERNEL=="timer", NAME="snd/%k", MODE="0666" +KERNEL=="seq", NAME="snd/%k", MODE="0666" + +# IEEE1394 raw devices (often used for video) +KERNEL=="raw1394", NAME="%k", GROUP="video" +KERNEL=="dv1394*", NAME="dv1394/%n", GROUP="video" +KERNEL=="video1394*", NAME="video1394/%n", GROUP="video" + +# capi devices +KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20" +KERNEL=="capi*", NAME="capi/%n" + +# cpu devices +KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid" +KERNEL=="msr[0-9]*", NAME="cpu/%n/msr" +KERNEL=="microcode", NAME="cpu/microcode" + +# dm devices (ignore them) +KERNEL=="dm-[0-9]*", NAME="" +# create a symlink named after the device map name +# note devmap_name comes with extras/multipath +#KERNEL=="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k", SYMLINK+="%c" +KERNEL=="device-mapper", NAME="mapper/control" + + +# floppy devices +KERNEL=="fd[0-9]*", NAME="floppy/%n", SYMLINK+="%k", GROUP="floppy", PROGRAM="/lib/udev/floppy-extra-devs.sh %k %b %n" + +# i2c devices +KERNEL=="i2c-[0-9]*", NAME="i2c/%n", SYMLINK+="%k" + +# input devices +KERNEL=="mice", NAME="input/%k", MODE="0644", SYMLINK+="mouse" +KERNEL=="mouse*", NAME="input/%k", MODE="0644" +KERNEL=="event*", NAME="input/%k", MODE="0640" +KERNEL=="js*", NAME="input/%k", MODE="664" +KERNEL=="ts*", NAME="input/%k", MODE="0600" +SUBSYSTEM=="input[0-9]*", RUN+="/lib/udev/input_device.sh" +KERNEL=="input[0-9]*", ACTION=="add", ENV{ABS}=="[1-9]*", RUN+="/sbin/modprobe joydev" + +# loop devices +KERNEL=="loop[0-9]*", NAME="loop/%n", SYMLINK+="%k", GROUP="disk" + +# md block devices +KERNEL=="md[0-9]*", NAME="md/%n", SYMLINK+="%k", GROUP="disk" + +# aoe char devices, +SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k", GROUP="disk", MODE="0220" +SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k", GROUP="disk", MODE="0440" +SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k", GROUP="disk", MODE="0220" + +# netlink devices +KERNEL=="route", NAME="netlink/%k" +KERNEL=="skip", NAME="netlink/%k" +KERNEL=="usersock", NAME="netlink/%k" +KERNEL=="fwmonitor", NAME="netlink/%k" +KERNEL=="tcpdiag", NAME="netlink/%k" +KERNEL=="nflog", NAME="netlink/%k" +KERNEL=="xfrm", NAME="netlink/%k" +KERNEL=="arpd", NAME="netlink/%k" +KERNEL=="route6", NAME="netlink/%k" +KERNEL=="ip6_fw", NAME="netlink/%k" +KERNEL=="dnrtmsg", NAME="netlink/%k" +KERNEL=="tap*", NAME="netlink/%k" + +# ramdisk devices +KERNEL=="ram[0-9]*", NAME="rd/%n", SYMLINK+="%k" + +# raw devices +KERNEL=="raw[0-9]*", NAME="raw/%k", GROUP="disk" +KERNEL=="ram*", NAME="%k", GROUP="disk" + +# sound devices +KERNEL=="adsp", NAME="sound/%k", SYMLINK+="%k", GROUP="audio", MODE="0662" +KERNEL=="adsp[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="audio", MODE="0662" +KERNEL=="audio", NAME="sound/%k", SYMLINK+="%k", GROUP="audio", MODE="0662" +KERNEL=="audio[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="audio", MODE="0662" +KERNEL=="dsp", NAME="sound/%k", SYMLINK+="%k", GROUP="audio", MODE="0662" +KERNEL=="dsp[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="audio", MODE="0662" +KERNEL=="mixer", NAME="sound/%k", SYMLINK+="%k", GROUP="audio", MODE="0662" +KERNEL=="mixer[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="audio", MODE="0662" +KERNEL=="sequencer", NAME="sound/%k", SYMLINK+="%k", GROUP="audio", MODE="0662" +KERNEL=="sequencer[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="audio", MODE="0662" + +# tty devices +KERNEL=="console", NAME="%k", GROUP="tty", MODE="0600" +KERNEL=="tty", NAME="%k", GROUP="tty", MODE="0666" +KERNEL=="tty[0-9]*", NAME="vc/%n", SYMLINK+="%k", GROUP="tty" +KERNEL=="ttyS[0-9]*", NAME="tts/%n", SYMLINK+="%k", GROUP="tty" +KERNEL=="ttyUSB[0-9]*", NAME="tts/USB%n", GROUP="tty", MODE="0660" +KERNEL=="ippp0", NAME="%k", GROUP="tty" +KERNEL=="isdn*", NAME="%k", GROUP="tty" +KERNEL=="dcbri*", NAME="%k", GROUP="tty" +KERNEL=="ircomm*", NAME="%k", GROUP="tty" + +# pty devices +KERNEL=="ptmx", NAME="%k", GROUP="tty", MODE="0666" +KERNEL=="pty[p-za-e][0-9a-f]*", NAME="pty/m%m", SYMLINK+="%k", GROUP="tty" +KERNEL=="tty[p-za-e][0-9a-f]*", NAME="pty/s%m", SYMLINK+="%k", GROUP="tty" + +# vc devices +KERNEL=="vcs", NAME="vcc/0", SYMLINK+="%k", GROUP="tty" +KERNEL=="vcs[0-9]*", NAME="vcc/%n", SYMLINK+="%k", GROUP="tty" +KERNEL=="vcsa", NAME="vcc/a0", SYMLINK+="%k", GROUP="tty" +KERNEL=="vcsa[0-9]*", NAME="vcc/a%n", SYMLINK+="%k", GROUP="tty" + +# memory devices +KERNEL=="random", NAME="%k", MODE="0664" +KERNEL=="urandom", NAME="%k", MODE="0664" +KERNEL=="mem", NAME="%k", GROUP="kmem", MODE="0640" +KERNEL=="kmem", NAME="%k", GROUP="kmem", MODE="0640" +KERNEL=="port", NAME="%k", GROUP="kmem", MODE="0640" +KERNEL=="nvram", NAME="%k", GROUP="kmem", MODE="600" +KERNEL=="full", NAME="%k", MODE="0666" +KERNEL=="null", NAME="%k", MODE="0666" +KERNEL=="zero", NAME="%k", MODE="0666" + +# misc devices +KERNEL=="agpgart", NAME="misc/%k", SYMLINK+="%k" +KERNEL=="psaux", NAME="misc/%k", SYMLINK+="%k" +KERNEL=="rtc", NAME="misc/%k", SYMLINK+="%k", MODE="0664" +KERNEL=="uinput", NAME="misc/%k", SYMLINK+="%k" +KERNEL=="inotify", NAME="misc/%k", SYMLINK+="%k", MODE="0666" + +# usb devices +KERNEL=="hiddev*", NAME="usb/%k" +KERNEL=="auer*", NAME="usb/%k" +KERNEL=="legousbtower*", NAME="usb/%k" +KERNEL=="dabusb*", NAME="usb/%k" + +# fb devices +KERNEL=="fb[0-9]*", NAME="fb/%n", SYMLINK+="%k", GROUP="video" + +# DRI devices +KERNEL=="card*", NAME="dri/card%n", GROUP="video" +KERNEL=="nvidia*", NAME="%k", GROUP="video" +KERNEL=="3dfx*", NAME="%k", GROUP="video" + +# v4l devices +KERNEL=="video[0-9]*", NAME="v4l/video%n", SYMLINK+="video%n", GROUP="video" +KERNEL=="radio[0-9]*", NAME="v4l/radio%n", SYMLINK+="radio%n", GROUP="video" +KERNEL=="vbi[0-9]*", NAME="v4l/vbi%n", SYMLINK+="vbi%n", GROUP="video" +KERNEL=="vtx[0-9]*", NAME="v4l/vtx%n", GROUP="video" + +# dvb devices +SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'X=%k; X=$${X#dvb}; A=$${X%%%%.*}; D=$${X#*.}; echo dvb/adapter$$A/$$D'", NAME="%c", GROUP="video" + +# Asterix Zaptel devices +KERNEL=="zapctl", NAME="zap/ctl" +KERNEL=="zaptimer", NAME="zap/timer" +KERNEL=="zapchannel", NAME="zap/channel" +KERNEL=="zappseudo", NAME="zap/pseudo" +KERNEL=="zap[0-9]*", NAME="zap/%n" + +# pilot/palm devices +KERNEL=="pilot", NAME="%k", GROUP="uucp" + +# jaz devices +KERNEL=="jaz*", NAME="%k", GROUP="disk" + +# zip devices +KERNEL=="pocketzip*", NAME="%k", GROUP="disk" +KERNEL=="zip*", NAME="%k", GROUP="disk" + +# ls120 devices +KERNEL=="ls120", NAME="%k", GROUP="disk" + +# lp devices +KERNEL=="irlpt", NAME="%k", GROUP="lp", MODE="0664" +SUBSYSTEM=="usb", KERNEL=="lp*", NAME="usb/%k", SYMLINK+="usb%k", GROUP="lp", MODE="0664" +SUBSYSTEM=="printer", KERNEL=="lp*", NAME="%k", GROUP="lp", MODE="0664" +KERNEL=="parport*", NAME="%k", GROUP="lp", MODE="0664" + +# tape devices +KERNEL=="ht*", NAME="%k" +KERNEL=="nht*", NAME="%k" +KERNEL=="pt*", NAME="%k" +KERNEL=="npt*", NAME="%k" +KERNEL=="st*", NAME="%k" +KERNEL=="nst*", NAME="%k" +KERNEL=="osst*", NAME="%k" +KERNEL=="nosst*", NAME="%k" + +# diskonkey devices +KERNEL=="diskonkey*", NAME="%k", GROUP="disk" + +# rem_ide devices +KERNEL=="microdrive*", NAME="%k", GROUP="disk" + +# kbd devices +KERNEL=="kbd", NAME="%k", MODE="0664" + +# Sony Vaio Jogdial sonypi device +KERNEL=="sonypi", NAME="%k", MODE="0666" + +# packet devices +KERNEL=="pktcdvd", NAME="pktcdvd/control", GROUP="cdrom", MODE="0660" +KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/pktcdvd%n", GROUP="cdrom", MODE="0660" + +# infiniband devices +KERNEL=="umad*", NAME="infiniband/%k" +KERNEL=="issm*", NAME="infiniband/%k" + +# PnP +SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", \ + RUN+="/bin/sh -c 'while read id; do /sbin/modprobe pnp:d$$id; done < /sys$devpath/id'" + +# firewire +SUBSYSTEM=="ieee1394", ENV{MODALIAS}!="?*", IMPORT{program}="modalias_ieee1394" + +# libusb device access +DEVPATH=="/module/usbcore", ACTION=="add", \ + RUN+="/bin/sh -c 'sleep 1; /bin/mount none -t usbfs /proc/bus/usb -o devmode=0666,devgid=10'" +SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'X=%k X=$${X#usbdev}; B=$${X%%%%.*}; D=$${X#*.}; echo bus/usb/$$B/$$D'", SYMLINK+="%c" + +# firmware loader +SUBSYSTEM=="firmware", ACTION=="add", RUN+="/lib/udev/firmware_helper" + +# load module +ACTION=="add", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}" + +# PCMCIA devices: +# +# Very few CIS firmware entries (which we use for matching) +# are so broken that we need to read out random bytes of it +# instead of the manufactor, card or product ID. Then the +# matching is done in userspace. +ACTION=="add", SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", \ + RUN+="/sbin/pcmcia-check-broken-cis" + +# However, the "weak" matching by func_id is only allowed _after_ modprobe +# returns, so that "strong" matches have a higher priority. +ACTION=="add", SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", \ + RUN+="/bin/sh -c 'echo 1 > /sys/$DEVPATH/allow_func_id_match'" + +# PCMCIA sockets: +# +# modprobe the pcmcia bus module so that 16-bit PCMCIA devices work +ACTION=="add", SUBSYSTEM=="pcmcia_socket", RUN+="/sbin/modprobe pcmcia" + +# if this is a PCMCIA socket which needs a resource database, +# pcmcia-socket-startup sets it up +ACTION=="add", SUBSYSTEM=="pcmcia_socket", RUN+="/sbin/pcmcia-socket-startup" + +# network devices +KERNEL=="tun", NAME="net/%k" +SUBSYSTEM=="net", ACTION=="add", RUN+="/lib/udev/nethelper.sh $env{INTERFACE} start" +SUBSYSTEM=="net", ACTION=="remove", RUN+="/lib/udev/nethelper.sh $env{INTERFACE} stop" + +# if you use HAL, try this: +# send all events to HAL +#RUN+="socket:/org/freedesktop/hal/udev_event" + +# catch the event in udevmonitor +RUN+="socket:/org/kernel/udev/monitor" diff --git a/rules/suse/40-suse.rules b/rules/suse/40-suse.rules new file mode 100644 index 0000000000..d07a72eced --- /dev/null +++ b/rules/suse/40-suse.rules @@ -0,0 +1,14 @@ +# do not edit this file, it will be overwritten on update + +KERNEL=="pmu", GROUP="video" +KERNEL=="nvidia*|nvidiactl*", GROUP="video" +KERNEL=="nvidia*|nvidiactl*", GROUP="video" +KERNEL=="dv1394*|video1394*|raw1394*", GROUP="video" +KERNEL=="vttuner*", GROUP="video" +KERNEL=="vtx*|vbi*", GROUP="video" +KERNEL=="winradio*", GROUP="video" +SUBSYSTEM=="dvb", GROUP="video" +SUBSYSTEM=="graphics", GROUP="video" +SUBSYSTEM=="video4linux", GROUP="video" +KERNEL=="agpgart", GROUP="video" + diff --git a/rules/suse/64-device-mapper.rules b/rules/suse/64-device-mapper.rules new file mode 100644 index 0000000000..b065aec554 --- /dev/null +++ b/rules/suse/64-device-mapper.rules @@ -0,0 +1,23 @@ +# do not edit this file, it will be overwritten on update + +KERNEL=="device-mapper", SYMLINK+="mapper/control" + +KERNEL!="dm-*", GOTO="device_mapper_end" +ACTION!="add|change", GOTO="device_mapper_end" + +IMPORT{program}="/sbin/dmsetup export -j%M -m%m" +ENV{DM_NAME}!="?*", GOTO="device_mapper_end" + +SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}" +ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}" + +ENV{DM_STATE}=="SUSPENDED", GOTO="device_mapper_end" +ENV{DM_TARGET_TYPES}=="|*error*", GOTO="device_mapper_end" + +IMPORT{program}="vol_id --export $tempnode" +OPTIONS+="link_priority=-100" +ENV{DM_TARGET_TYPES}=="*snapshot-origin*", OPTIONS+="link_priority=-90" +ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" +ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" + +LABEL="device_mapper_end" |