xref: /freebsd/sys/contrib/openzfs/udev/rules.d/69-vdev.rules.in (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
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