chiark / gitweb /
Added persistent name rules for block devices to gentoo rule file.
authorGreg Kroah-Hartman <gregkh@suse.de>
Tue, 2 Aug 2005 19:28:50 +0000 (12:28 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 2 Aug 2005 19:28:50 +0000 (12:28 -0700)
Copied from Kay's rules from the SuSE package.

Let the fun begin...

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
etc/udev/gentoo/udev.rules

index 75c192f..0c96969 100644 (file)
@@ -243,6 +243,38 @@ KERNEL=="issm*",   NAME="infiniband/%k"
 # tpm devices
 KERNEL=="tpm*",        NAME="%k", OWNER="tss", GROUP="tss", MODE="0600"
 
+# block device disk id's
+SUBSYSTEM=="block", GROUP="disk", MODE="0640"
+KERNEL=="hd*[!0-9]", ACTION=="add", IMPORT="/etc/udev/scripts/ata_id --export $tempnode"
+KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="$env{ID_TYPE}/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
+KERNEL=="hd*[0-9]", ACTION=="add", IMPORT{parent}=="ID_*", SYMLINK+="$env{ID_TYPE}/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
+
+KERNEL=="sd*[!0-9]", ACTION=="add", SYSFS{ieee1394_id}=="*", IMPORT="/bin/echo -e 'ID_SERIAL=$sysfs{ieee1394_id}\nID_BUS=ieee1394\nID_TYPE=disk'"
+KERNEL=="sd*[!0-9]", ACTION=="add", ENV{ID_SERIAL}=="", IMPORT="/etc/udev/scripts/usb_id -x"
+KERNEL=="sd*[!0-9]", ACTION=="add", ENV{ID_SERIAL}=="", IMPORT="/etc/udev/scripts/scsi_id -g -x -s %p"
+KERNEL=="sd*[!0-9]", ACTION=="add", ENV{ID_SERIAL}=="", IMPORT="/etc/udev/scripts/scsi_id -g -x -a -s %p"
+KERNEL=="sd*[!0-9]", ACTION=="add", ENV{ID_SERIAL}=="?*", SYMLINK+="$env{ID_TYPE}/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
+KERNEL=="sd*[0-9]", ACTION=="add", IMPORT{parent}=="ID_*"
+KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="$env{ID_TYPE}/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
+
+# Skip id for ram / loop / fd
+SUBSYSTEM=="block", KERNEL=="ram*", GOTO="no_volume_id"
+SUBSYSTEM=="block", KERNEL=="loop*", GOTO="no_volume_id"
+SUBSYSTEM=="block", KERNEL=="fd*", GOTO="no_volume_id"
+
+SUBSYSTEM=="block", KERNEL=="*[!0-9]", ACTION=="add", ENV{ID_TYPE}=="?*", IMPORT="/etc/udev/scripts/path_id %p", SYMLINK+="$env{ID_TYPE}/by-path/$env{ID_PATH}"
+SUBSYSTEM=="block", KERNEL=="*[0-9]", ACTION=="add", IMPORT{parent}=="ID_*"
+SUBSYSTEM=="block", KERNEL=="*[0-9]", ACTION=="add", ENV{ID_PATH}=="?*", SYMLINK+="$env{ID_TYPE}/by-path/$env{ID_PATH}-part%n"
+
+# volume-label/uuid
+SUBSYSTEM=="block", KERNEL=="*[!0-9]", SYSFS{removable}=="1", GOTO="no_volume_id"
+SUBSYSTEM=="block", KERNEL=="sr*", GOTO="no_volume_id"
+SUBSYSTEM=="block", KERNEL=="*[0-9]", ACTION=="add", IMPORT="/etc/udev/scripts/vol_id --export $tempnode"
+SUBSYSTEM=="block", KERNEL=="*[0-9]", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
+SUBSYSTEM=="block", KERNEL=="*[0-9]", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
+SUBSYSTEM=="block", LABEL="no_volume_id"
+
+
 # be backward compatible for a while with the /etc/dev.d and /etc/hotplug.d/ systems
 # run /etc/hotplug.d/ stuff only if we came from a hotplug event, not for udevstart
 ENV{UDEVD_EVENT}=="1", RUN+="/sbin/udev_run_hotplugd"
@@ -250,3 +282,5 @@ ENV{UDEVD_EVENT}=="1", RUN+="/sbin/udev_run_hotplugd"
 # always run /etc/dev.d/ stuff for now.
 RUN+="/sbin/udev_run_devd"
 
+# debugging monitor
+RUN+="socket:/org/kernel/udev/monitor"