--- /dev/null
+# These rules generate rules for the /dev/{cdrom,dvd,...} symlinks and
+# write them to /etc/udev/rules.d/z20_persistent-cd.rules.
+#
+# The default name for this file is z75_cd-aliases-generator.rules.
+
+ACTION=="add", SUBSYSTEM=="block", ENV{GENERATED}!="?*", ENV{ID_CDROM}=="?*", \
+ SUBSYSTEMS!="usb|ieee1394", \
+ PROGRAM="write_cd_rules", SYMLINK+="%c"
+
+ACTION=="add", SUBSYSTEM=="block", ENV{GENERATED}!="?*", ENV{ID_CDROM}=="?*", \
+ SUBSYSTEMS=="usb|ieee1394", \
+ PROGRAM="write_cd_rules by-id", SYMLINK+="%c"
+
# usbfs-like devices
SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", ACTION=="add", \
NAME="%c"
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}"
# serial devices
KERNEL=="ttyS[0-9]*", NAME="tts/%n"
KERNEL=="issm*", NAME="infiniband/%k"
KERNEL=="uverbs*", NAME="infiniband/%k"
KERNEL=="ucm*", NAME="infiniband/%k"
+KERNEL=="rdma_ucm", NAME="infiniband/%k"
# sound devices
KERNEL=="controlC[0-9]*", NAME="snd/%k"
SUBSYSTEM=="platform", ENV{MODALIAS}=="i82365", GOTO="hotplug_driver_loaded"
# load the drivers
-ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe --use-blacklist $env{MODALIAS}"
+ENV{MODALIAS}=="?*", \
+ RUN+="/sbin/modprobe --use-blacklist $env{MODALIAS}"
SUBSYSTEM=="ide", ENV{MODALIAS}!="?*", RUN+="ide.agent"
-SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", RUN+="/bin/sh -c 'while read id; do /sbin/modprobe --use-blacklist pnp:d$$id; done < /sys$devpath/id'"
+SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", \
+ RUN+="/bin/sh -c 'while read id; do /sbin/modprobe --use-blacklist 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=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN+="/sbin/modprobe tifm_sd"
+SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", RUN+="/sbin/modprobe tifm_ms"
SUBSYSTEM=="scsi_device", ATTRS{type}=="0|7|14", RUN+="/sbin/modprobe sd_mod"
SUBSYSTEM=="scsi_device", ATTRS{type}=="1", RUN+="/sbin/modprobe osst", \
+++ /dev/null
-# do not call hotplug.d and dev.d for "drivers" and "module" events
-SUBSYSTEM=="drivers", OPTIONS="last_rule"
-SUBSYSTEM=="module", OPTIONS="last_rule"
-
-# compatibility support for the obsolete hotplug.d and dev.d directories
-RUN+="udev_run_hotplugd $env{SUBSYSTEM}"
-RUN+="udev_run_devd $env{SUBSYSTEM}"
-
# workarounds needed to synchronize with sysfs
# only needed for kernels < v2.6.18-rc1
ENV{PHYSDEVPATH}!="?*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
-SUBSYSTEM=="scsi", WAIT_FOR_SYSFS="ioerr_cnt"
+SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", WAIT_FOR_SYSFS="ioerr_cnt"
# only needed for kernels < 2.6.16
SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
# only needed for kernels < 2.6.17
SUBSYSTEM=="net", ENV{DRIVER}=="?*", WAIT_FOR_SYSFS="device/driver"
+# 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)
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"
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_device", GROUP="plugdev", \
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="plugdev", \
ATTRS{idVendor}=="4102", ATTRS{idProduct}=="10[01][135789]"
# serial devices
KERNEL=="fuse", GROUP="fuse"
KERNEL=="kqemu", MODE="0666"
KERNEL=="kvm", GROUP="kvm"
-KERNEL=="tun", MODE="0666"
+KERNEL=="tun", MODE="0666",
KERNEL=="cdemu[0-9]*", GROUP="cdrom"
KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
KERNEL=="uverbs*", GROUP="rdma"
KERNEL=="ucm*", GROUP="rdma"
+KERNEL=="rdma_ucm", GROUP="rdma"
# printers and parallel devices
SUBSYSTEM=="printer", GROUP="lp"
KERNEL=="input[0-9]*", GOTO="persistent_input_end"
# usb devices
-SUBSYSTEMS=="usb", IMPORT{program}="usb_id -x"
+SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export"
SUBSYSTEMS=="usb", \
ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="01", \
ENV{ID_CLASS}="kbd"
ENV{ID_SERIAL}=="", ENV{ID_SERIAL}="noserial"
# by-id links, generic and for the event devices
-KERNEL=="mouse*", ENV{ID_BUS}=="?*", ENV{ID_CLASS}=="?*", \
+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 %p"
-KERNEL=="mouse*", ENV{ID_PATH}=="?*", \
+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}"
--- /dev/null
+# These rules generate rules to keep network interface names unchanged
+# across reboots write them to /etc/udev/rules.d/z25_persistent-net.rules.
+#
+# The default name for this file is z45_persistent-net-generator.rules.
+
+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 Xen virtual interfaces
+SUBSYSTEMS=="xen", GOTO="persistent_net_generator_end"
+
+# ignore UML virtual interfaces
+DRIVERS=="uml-netdev", GOTO="persistent_net_generator_end"
+
+# ignore VMWare virtual interfaces
+ATTR{address}=="00:0c:29:*|00:50:56:*", GOTO="persistent_net_generator_end"
+
+# ignore interfaces with random MAC addresses
+ATTR{address}=="?[2367abef]:*", GOTO="persistent_net_generator_end"
+
+# ignore "secondary" raw interfaces of the madwifi driver
+KERNEL=="ath*", ATTRS{type}=="802", GOTO="persistent_net_generator_end"
+
+# provide nice comments for the generated rules
+SUBSYSTEMS=="pci", \
+ ENV{COMMENT}="PCI device $attr{vendor}:$attr{device}"
+SUBSYSTEMS=="usb", \
+ ENV{COMMENT}="USB device $attr{idVendor}:$attr{idProduct}"
+SUBSYSTEMS=="ccwgroup", \
+ ENV{COMMENT}="S/390 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})"
+
+# ignore interfaces without a driver link like bridges and VLANs
+KERNEL=="eth*|ath*|wlan*|ra*|sta*|ctc*|lcs*|hsi*", DRIVERS=="?*",\
+ IMPORT{program}="write_net_rules $attr{address}"
+
+ENV{INTERFACE_NEW}=="?*", NAME="$env{INTERFACE_NEW}"
+
+LABEL="persistent_net_generator_end"
+
# This file contains the rules needed to create persistent device names.
# we are only interested in add actions for block devices
-SUBSYSTEM!="block", GOTO="no_volume_id"
-ACTION!="add", GOTO="no_volume_id"
+ACTION!="add", 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="no_volume_id"
+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="no_volume_id"
+ GOTO="persistent_storage_end"
KERNEL=="hd*[0-9]", ATTRS{removable}=="1", \
- GOTO="no_volume_id"
+ GOTO="persistent_storage_end"
+
+# ignore partitions that span the entire disk
+ATTR{whole_disk}=="*", GOTO="persistent_storage_end"
# skip xen virtual hard disks
DRIVERS=="vbd", GOTO="no_hardware_id"
IMPORT{program}="scsi_id -g -x -s $devpath -d $tempnode"
KERNEL=="sd*[!0-9]|sr*|st*|nst*", ENV{ID_SERIAL}=="", \
IMPORT{program}="scsi_id -g -x -a -s $devpath -d $tempnode"
+KERNEL=="cciss?c[0-9]d[0-9]", ENV{ID_SERIAL}=="",
+ IMPORT{program}="scsi_id -g -x -n -s $devpath -d $tempnode"
KERNEL=="sg*", ATTRS{type}=="8", ENV{ID_SERIAL}=="", \
IMPORT{program}="scsi_id -g -x -s $devpath -d $tempnode"
KERNEL=="sg*", ATTRS{type}=="8", 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*", ENV{ID_SERIAL_SHORT}=="?*", \
+KERNEL=="sd*[!0-9]|sr*|cciss?c[0-9]d[0-9]", ENV{ID_SERIAL_SHORT}=="?*", \
ENV{ID_VENDOR}=="ATA", \
SYMLINK+="disk/by-id/ata-$env{ID_MODEL}-$env{ID_SERIAL_SHORT}"
-KERNEL=="sd*[0-9]", ENV{ID_SERIAL_SHORT}=="?*", \
+KERNEL=="sd*[0-9]|cciss*p[0-9]", ENV{ID_SERIAL_SHORT}=="?*", \
ENV{ID_VENDOR}=="ATA", \
SYMLINK+="disk/by-id/ata-$env{ID_MODEL}-$env{ID_SERIAL_SHORT}-part%n"
KERNEL=="sg*", ATTRS{type}=="8", ENV{ID_SERIAL}=="?*", \
SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
-KERNEL=="*[!0-9]|sr*", ENV{ID_PATH}=="?*", \
+KERNEL=="*[!0-9]|sr*|cciss?c[0-9]d[0-9]", ENV{ID_PATH}=="?*", \
SYMLINK+="disk/by-path/$env{ID_PATH}"
+KERNEL=="*[0-9]|cciss*p[0-9]", ENV{ID_PATH}=="?*", \
+ SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
KERNEL=="st*", ENV{ID_PATH}=="?*", \
SYMLINK+="tape/by-path/$env{ID_PATH}"
-KERNEL=="sr*|st*", GOTO="no_volume_id"
-KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", \
- SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
+KERNEL=="sr*|st*", GOTO="persistent_storage_end"
# UUID and volume label
-KERNEL=="*[!0-9]", ATTR{removable}=="1", GOTO="no_volume_id"
+KERNEL=="hd*[!0-9]", ATTR{removable}=="1", GOTO="persistent_storage_end"
IMPORT{program}="vol_id --export $tempnode"
-ENV{ID_FS_UUID}=="?*", ENV{ID_FS_USAGE}=="filesystem|other|crypto", \
- SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
-ENV{ID_FS_LABEL_SAFE}=="?*", ENV{ID_FS_USAGE}=="filesystem|other", \
- SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
+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}"
# end of processing
-LABEL="no_volume_id"
+LABEL="persistent_storage_end"
# usbfs-like devices
SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", ACTION=="add", \
NAME="%c"
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}"
# serial devices
KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20"
KERNEL=="issm*", NAME="infiniband/%k"
KERNEL=="uverbs*", NAME="infiniband/%k"
KERNEL=="ucm*", NAME="infiniband/%k"
+KERNEL=="rdma_ucm", NAME="infiniband/%k"
# ALSA devices
KERNEL=="controlC[0-9]*", NAME="snd/%k"