]> err.no Git - systemd/commitdiff
rules: Debian update
authorMarco d'Itri <md@Linux.IT>
Tue, 7 Aug 2007 08:41:42 +0000 (10:41 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Tue, 7 Aug 2007 08:41:42 +0000 (10:41 +0200)
etc/udev/debian/cd-aliases-generator.rules [new file with mode: 0644]
etc/udev/debian/devfs.rules
etc/udev/debian/hotplug.rules
etc/udev/debian/hotplugd.rules [deleted file]
etc/udev/debian/permissions.rules
etc/udev/debian/persistent-input.rules
etc/udev/debian/persistent-net-generator.rules [new file with mode: 0644]
etc/udev/debian/persistent.rules
etc/udev/debian/udev.rules

diff --git a/etc/udev/debian/cd-aliases-generator.rules b/etc/udev/debian/cd-aliases-generator.rules
new file mode 100644 (file)
index 0000000..f655488
--- /dev/null
@@ -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"
+
index 2e0caa1d6938832bc37fd6eefd8896aa5a5288fa..56ed1a8807cd90539295121cf98afdd2bd03436b 100644 (file)
@@ -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"
index 0b2fc57126efb730064d62c54a2e05425780a06d..662e997c816746dbba9a250210232d14b23fab54 100644 (file)
@@ -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 (file)
index cd30fa4..0000000
+++ /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}"
-
index ac6c0be38be8dd0a9c4694b043c2f45b61d5ae87..205b7332920bcb413bb6d3e3403462eccc865da7 100644 (file)
@@ -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"
index a9005e075b99e8e68a3cdbc3932797ee5f7a1ba5..47c4ae98cb0beb05adc288ded99a619ec7fd703a 100644 (file)
@@ -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 (file)
index 0000000..6df00bf
--- /dev/null
@@ -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"
+
index c82a639556724366d919764aaaf4fbf5da9ec4e2..de2fa2a928452adb02e96749f605b14e52039fad 100644 (file)
@@ -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"
 
index 3f7b704f783e70149e46e1fa2abe2024f34a40c3..af16c17f48dad1d062bb1820ac5ff1ba9187e05b 100644 (file)
@@ -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"