aboutsummaryrefslogtreecommitdiff
path: root/rules
diff options
context:
space:
mode:
authorgwendalcr <gwendal@chromium.org>2017-10-10 01:03:38 -0700
committerLennart Poettering <lennart@poettering.net>2017-10-10 10:03:38 +0200
commite2c2d70ba7cc7497b03c4a377bfb529035540aa7 (patch)
tree8fa0b36b45e549938dfc891bbafc0cb5e7c779de /rules
parentnamespace: fall back gracefully when kernel doesn't support network namespace... (diff)
downloadsystemd-e2c2d70ba7cc7497b03c4a377bfb529035540aa7.tar.gz
systemd-e2c2d70ba7cc7497b03c4a377bfb529035540aa7.tar.bz2
systemd-e2c2d70ba7cc7497b03c4a377bfb529035540aa7.zip
rules: Add MODEL_ID for NVMe device (#7037)
To mimic MODEL_ID variable built for ATA and SCSI devices, add rules to add MODEL_ID variable for NVMe devices. TEST: Check on a system with NVMe device that MODEL_ID variable is present: udevadm info --query=all -n /dev/nvme0n1p1 | grep ID_MODEL and udevadm info --query=all -n /dev/nvme0n1p1 | grep ID_MODEL return: E: ID_MODEL=SAMSUNG...
Diffstat (limited to 'rules')
-rw-r--r--rules/60-persistent-storage.rules8
1 files changed, 6 insertions, 2 deletions
diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules
index 72fec5c88..0de8cf3a1 100644
--- a/rules/60-persistent-storage.rules
+++ b/rules/60-persistent-storage.rules
@@ -21,10 +21,14 @@ KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{wwid}=="?*"
KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{serial}=="?*", ENV{ID_SERIAL_SHORT}="$attr{serial}"
KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{wwid}=="?*", ENV{ID_WWN}="$attr{wwid}"
-KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{model}=="?*", ENV{ID_SERIAL_SHORT}=="?*", ENV{ID_SERIAL}="$attr{model}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}"
+KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ATTRS{model}=="?*", ENV{ID_MODEL}="$attr{model}"
+KERNEL=="nvme*[0-9]n*[0-9]", ENV{DEVTYPE}=="disk", ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", \
+ ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}"
KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{serial}=="?*", ENV{ID_SERIAL_SHORT}="$attr{serial}"
-KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{model}=="?*", ENV{ID_SERIAL_SHORT}=="?*", ENV{ID_SERIAL}="$attr{model}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}-part%n"
+KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ATTRS{model}=="?*", ENV{ID_MODEL}="$attr{model}"
+KERNEL=="nvme*[0-9]n*[0-9]p*[0-9]", ENV{DEVTYPE}=="partition", ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", \
+ ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}-part%n"
# virtio-blk
KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}"