xref: /freebsd/sys/contrib/openzfs/udev/rules.d/69-vdev.rules.in (revision 994297b01b98816bea1abf45ae4bac1bc69ee7a0)
1#
2# @udevdir@/rules.d/69-vdev.rules
3#
4
5ENV{DEVTYPE}=="disk", IMPORT{program}="@udevdir@/vdev_id -d %k"
6ENV{DEVTYPE}=="partition", IMPORT{program}="@udevdir@/vdev_id -d %k"
7
8KERNEL=="*[!0-9]", ENV{SUBSYSTEM}=="block", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}"
9KERNEL=="nvme*[0-9]n*[0-9]", ENV{SUBSYSTEM}=="block", ENV{DEVTYPE}=="disk", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}"
10KERNEL=="*[0-9]", ENV{SUBSYSTEM}=="block", ENV{DEVTYPE}=="partition", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}-part%n"
11KERNEL=="dm-[0-9]*", ENV{SUBSYSTEM}=="block", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}"
12
13# Enclosure device symlink rules
14ENV{SUBSYSTEM}=="scsi_generic", IMPORT{program}="@udevdir@/vdev_id -e"
15ENV{SUBSYSTEM}=="scsi_generic", ENV{ID_ENCLOSURE}=="?*", SYMLINK+="$env{ID_ENCLOSURE_PATH}"
16