summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorJamie Wellnitz <Jamie.Wellnitz@emulex.com>2007-02-27 21:02:07 +0100
committerKay Sievers <kay.sievers@suse.de>2007-02-27 21:02:07 +0100
commit0fe4cffde6628b54af6163b2fc253fb9bc556ded (patch)
tree7c733fdb50e5daefa9d3cfd0e364fa286e9dc6d9 /etc
parent1f889fb84fa14d1e7e3c2a1a3bc5e0df5c6fba23 (diff)
persistent device naming: tape devices and medium changers
This adds persistent symlinks for nst tape devices to the example rules. The symlinks live under /dev/tape/by-id/. Signed-off-by: Jamie Wellnitz <Jamie.Wellnitz@emulex.com>
Diffstat (limited to 'etc')
-rw-r--r--etc/udev/rules.d/60-persistent-storage.rules14
1 files changed, 13 insertions, 1 deletions
diff --git a/etc/udev/rules.d/60-persistent-storage.rules b/etc/udev/rules.d/60-persistent-storage.rules
index a0cb8caa68..ef9cb3f28b 100644
--- a/etc/udev/rules.d/60-persistent-storage.rules
+++ b/etc/udev/rules.d/60-persistent-storage.rules
@@ -2,6 +2,19 @@
# scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de>
ACTION!="add", GOTO="persistent_storage_end"
+ACTION!="add", GOTO="persistent_tape_end"
+
+KERNEL=="nst[0-9]", SUBSYSTEMS=="scsi", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode"
+KERNEL=="nst[0-9]", SUBSYSTEMS=="scsi", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode"
+KERNEL=="nst[0-9]", SUBSYSTEMS=="scsi", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst"
+
+# type 8 devices are "Medium Changers"
+KERNEL=="sg*", SUBSYSTEMS=="scsi", ATTRS{type}=="8", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -s %p -d $tempnode"
+KERNEL=="sg*", SUBSYSTEMS=="scsi", ATTRS{type}=="8", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x -a -s %p -d $tempnode"
+KERNEL=="sg*", SUBSYSTEMS=="scsi", ATTRS{type}=="8", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
+
+LABEL="persistent_tape_end"
+
SUBSYSTEM!="block", GOTO="persistent_storage_end"
# skip rules for inappropriate block devices
@@ -26,7 +39,6 @@ KERNEL=="sd*[!0-9]|sr*|st*", ENV{ID_SERIAL}=="", IMPORT{program}="scsi_id -g -x
KERNEL=="dasd*[!0-9]", IMPORT{program}="dasd_id --export $tempnode"
KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
-KERNEL=="st*", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
KERNEL=="mmcblk[0-9]", ATTR{name}=="?*", ATTR{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}"
KERNEL=="mmcblk[0-9]p[0-9]", ATTR{name}=="?*", ATTR{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}-part%n"