summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMing Lin <minggr@gmail.com>2016-04-29 04:02:57 -0700
committerLennart Poettering <lennart@poettering.net>2016-04-29 13:02:57 +0200
commit427a28ecbe0eb170e651e0530ab58d6e6f6c498c (patch)
tree7e7ecc3b04c46605215c426ba003a28621031a78
parent365007369b4539ffda378fec7ce2188f11e72982 (diff)
rules: add NVMe rules (#3136)
Add NVMe rules using the "wwid" attribute. root@target:~# cat /sys/block/nvme0n1/wwid eui.3825004235000591 root@target:~# ls /dev/disk/by-id/ -l |grep nvme lrwxrwxrwx 1 root root 13 Apr 27 16:08 nvme-eui.3825004235000591 -> ../../nvme0n1 lrwxrwxrwx 1 root root 15 Apr 27 16:08 nvme-eui.3825004235000591-part1 -> ../../nvme0n1p1 lrwxrwxrwx 1 root root 15 Apr 27 16:08 nvme-eui.3825004235000591-part2 -> ../../nvme0n1p2
-rw-r--r--rules/60-persistent-storage.rules4
1 files changed, 4 insertions, 0 deletions
diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules
index 0b14bb4a11..7ad8a557ff 100644
--- a/rules/60-persistent-storage.rules
+++ b/rules/60-persistent-storage.rules
@@ -14,6 +14,10 @@ TEST=="whole_disk", GOTO="persistent_storage_end"
# for partitions import parent information
ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*"
+# NVMe
+KERNEL=="nvme*[0-9]n*[0-9]", ATTR{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}"
+KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{wwid}=="?*", SYMLINK+="disk/by-id/nvme-$attr{wwid}-part%n"
+
# virtio-blk
KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}"
KERNEL=="vd*[0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}-part%n"