summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2005-08-02 12:28:50 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2005-08-02 12:28:50 -0700
commit74f1ce92c462a8df8927a121b3b7a43fdcfdecaa (patch)
treef5186e0f9bf927f6d228b55480579092666a6ab9 /etc
parent97b7aa1f7813cbe26f5fb928d44956ddb7bc70a9 (diff)
Added persistent name rules for block devices to gentoo rule file.
Copied from Kay's rules from the SuSE package. Let the fun begin... Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'etc')
-rw-r--r--etc/udev/gentoo/udev.rules34
1 files changed, 34 insertions, 0 deletions
diff --git a/etc/udev/gentoo/udev.rules b/etc/udev/gentoo/udev.rules
index 75c192ffaa..0c96969dbc 100644
--- a/etc/udev/gentoo/udev.rules
+++ b/etc/udev/gentoo/udev.rules
@@ -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"