aboutsummaryrefslogtreecommitdiffstats
path: root/udev/rules.d
diff options
context:
space:
mode:
authorTony Hutter <[email protected]>2018-12-14 17:27:49 -0800
committerBrian Behlendorf <[email protected]>2018-12-14 17:27:49 -0800
commitc66401fae036b22ecb3fa9af3337e1f9ecffb5e7 (patch)
treec52b231a099ae57908e550b2d85ef32c0433167e /udev/rules.d
parent7c46894081300410612a34f7c05377848b277dab (diff)
Add enclosure_symlinks option to vdev_id
Add an 'enclosure_symlinks' option to vdev_id.conf. This creates consistently named symlinks to the enclosure devices (/dev/sg*) based off the configuration in vdev_id.conf. The enclosure symlinks show up in /dev/by-enclosure/<prefix>-<channel><num>. The links make it make it easy to run sg_ses on a particular enclosure device. The enclosure links are created in addition to the normal /dev/disk/by-vdev links. 'enclosure_symlinks' is only valid in sas_direct configurations. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Simon Guest <[email protected]> Signed-off-by: Tony Hutter <[email protected]> Closes #8194
Diffstat (limited to 'udev/rules.d')
-rw-r--r--udev/rules.d/69-vdev.rules.in4
1 files changed, 4 insertions, 0 deletions
diff --git a/udev/rules.d/69-vdev.rules.in b/udev/rules.d/69-vdev.rules.in
index 2b9e5d600..36a1a8ed5 100644
--- a/udev/rules.d/69-vdev.rules.in
+++ b/udev/rules.d/69-vdev.rules.in
@@ -8,3 +8,7 @@ ENV{DEVTYPE}=="partition", IMPORT{program}="@udevdir@/vdev_id -d %k"
KERNEL=="*[!0-9]", ENV{SUBSYSTEM}=="block", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}"
KERNEL=="*[0-9]", ENV{SUBSYSTEM}=="block", ENV{DEVTYPE}=="partition", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}-part%n"
KERNEL=="dm-[0-9]*", ENV{SUBSYSTEM}=="block", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}"
+
+# Enclosure device symlink rules
+ENV{SUBSYSTEM}=="scsi_generic", IMPORT{program}="@udevdir@/vdev_id -e"
+ENV{SUBSYSTEM}=="scsi_generic", ENV{ID_ENCLOSURE}=="?*", SYMLINK+="$env{ID_ENCLOSURE_PATH}"