From 7134ab1b332250e03b58da9f39e1823f2ae6c172 Mon Sep 17 00:00:00 2001 From: Marco d'Itri Date: Tue, 7 Aug 2007 10:41:42 +0200 Subject: [PATCH] rules: Debian update --- etc/udev/debian/cd-aliases-generator.rules | 13 +++++ etc/udev/debian/devfs.rules | 2 + etc/udev/debian/hotplug.rules | 8 +++- etc/udev/debian/hotplugd.rules | 8 ---- etc/udev/debian/permissions.rules | 16 +++++-- etc/udev/debian/persistent-input.rules | 6 +-- .../debian/persistent-net-generator.rules | 48 +++++++++++++++++++ etc/udev/debian/persistent.rules | 39 ++++++++------- etc/udev/debian/udev.rules | 2 + 9 files changed, 108 insertions(+), 34 deletions(-) create mode 100644 etc/udev/debian/cd-aliases-generator.rules delete mode 100644 etc/udev/debian/hotplugd.rules create mode 100644 etc/udev/debian/persistent-net-generator.rules diff --git a/etc/udev/debian/cd-aliases-generator.rules b/etc/udev/debian/cd-aliases-generator.rules new file mode 100644 index 000000000..f65548816 --- /dev/null +++ b/etc/udev/debian/cd-aliases-generator.rules @@ -0,0 +1,13 @@ +# 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" + diff --git a/etc/udev/debian/devfs.rules b/etc/udev/debian/devfs.rules index 2e0caa1d6..56ed1a880 100644 --- a/etc/udev/debian/devfs.rules +++ b/etc/udev/debian/devfs.rules @@ -50,6 +50,7 @@ SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", \ # 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" @@ -104,6 +105,7 @@ KERNEL=="umad*", NAME="infiniband/%k" 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" diff --git a/etc/udev/debian/hotplug.rules b/etc/udev/debian/hotplug.rules index 0b2fc5712..662e997c8 100644 --- a/etc/udev/debian/hotplug.rules +++ b/etc/udev/debian/hotplug.rules @@ -7,16 +7,20 @@ ENV{DRIVER}=="?*", SUBSYSTEM!="input", GOTO="hotplug_driver_loaded" 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", \ diff --git a/etc/udev/debian/hotplugd.rules b/etc/udev/debian/hotplugd.rules deleted file mode 100644 index cd30fa49b..000000000 --- a/etc/udev/debian/hotplugd.rules +++ /dev/null @@ -1,8 +0,0 @@ -# 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}" - diff --git a/etc/udev/debian/permissions.rules b/etc/udev/debian/permissions.rules index ac6c0be38..205b73329 100644 --- a/etc/udev/debian/permissions.rules +++ b/etc/udev/debian/permissions.rules @@ -3,12 +3,17 @@ ACTION!="add", GOTO="permissions_end" # 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) @@ -30,6 +35,7 @@ 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" @@ -39,10 +45,11 @@ 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_device", GROUP="plugdev", \ +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="plugdev", \ ATTRS{idVendor}=="4102", ATTRS{idProduct}=="10[01][135789]" # serial devices @@ -85,7 +92,7 @@ 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=="tun", MODE="0666", KERNEL=="cdemu[0-9]*", GROUP="cdrom" KERNEL=="pktcdvd[0-9]*", GROUP="cdrom" @@ -93,6 +100,7 @@ KERNEL=="pktcdvd", MODE="0644" KERNEL=="uverbs*", GROUP="rdma" KERNEL=="ucm*", GROUP="rdma" +KERNEL=="rdma_ucm", GROUP="rdma" # printers and parallel devices SUBSYSTEM=="printer", GROUP="lp" diff --git a/etc/udev/debian/persistent-input.rules b/etc/udev/debian/persistent-input.rules index a9005e075..47c4ae98c 100644 --- a/etc/udev/debian/persistent-input.rules +++ b/etc/udev/debian/persistent-input.rules @@ -4,7 +4,7 @@ ACTION!="add", GOTO="persistent_input_end" 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" @@ -25,14 +25,14 @@ ATTRS{modalias}=="input:*-*a[068],*|input:*-*a*,[68],*m*", \ 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}" diff --git a/etc/udev/debian/persistent-net-generator.rules b/etc/udev/debian/persistent-net-generator.rules new file mode 100644 index 000000000..6df00bff2 --- /dev/null +++ b/etc/udev/debian/persistent-net-generator.rules @@ -0,0 +1,48 @@ +# 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" + diff --git a/etc/udev/debian/persistent.rules b/etc/udev/debian/persistent.rules index c82a63955..de2fa2a92 100644 --- a/etc/udev/debian/persistent.rules +++ b/etc/udev/debian/persistent.rules @@ -1,17 +1,20 @@ # 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" @@ -28,6 +31,8 @@ KERNEL=="sd*[!0-9]|sr*|st*|nst*", ENV{ID_SERIAL}=="", \ 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}=="", \ @@ -51,10 +56,10 @@ 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*", 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" @@ -81,22 +86,22 @@ KERNEL=="nst*", ENV{ID_SERIAL}=="?*", \ 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" diff --git a/etc/udev/debian/udev.rules b/etc/udev/debian/udev.rules index 3f7b704f7..af16c17f4 100644 --- a/etc/udev/debian/udev.rules +++ b/etc/udev/debian/udev.rules @@ -35,6 +35,7 @@ SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", \ # 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" @@ -62,6 +63,7 @@ KERNEL=="umad*", NAME="infiniband/%k" 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" -- 2.30.2