summaryrefslogtreecommitdiffstats
path: root/rules.d
diff options
context:
space:
mode:
authorBryan Gurney <bgurney@redhat.com>2024-09-18 21:03:59 +0200
committerBryan Gurney <bgurney@redhat.com>2024-09-18 21:38:14 +0200
commit77d8f15262247514b3cecf640666742229d1511c (patch)
tree463a52375a61f90b07dc758879f2ccaa93b18a85 /rules.d
parentMerge pull request #34331 from yuwata/network-netdev-cleanups (diff)
downloadsystemd-77d8f15262247514b3cecf640666742229d1511c.tar.xz
systemd-77d8f15262247514b3cecf640666742229d1511c.zip
Pin obsolete NVMe symlinks to namespace 1
In order to preserve backwards compatibility with legacy NVMe devices, create the obsolete symlinks, but only if they are associated with namespace ID 1. Signed-off-by: Bryan Gurney <bgurney@redhat.com>
Diffstat (limited to 'rules.d')
-rw-r--r--rules.d/60-persistent-storage.rules.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/rules.d/60-persistent-storage.rules.in b/rules.d/60-persistent-storage.rules.in
index 76cab7fbc7..37f562c9e8 100644
--- a/rules.d/60-persistent-storage.rules.in
+++ b/rules.d/60-persistent-storage.rules.in
@@ -45,9 +45,9 @@ ENV{ID_WWN}=="?*", SYMLINK+="disk/by-id/nvme-$env{ID_WWN}$env{.PART_SUFFIX}"
# obsolete symlink with non-escaped characters, kept for backward compatibility
ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", 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}$env{.PART_SUFFIX}"
+ ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", ENV{ID_NSID}=="1", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}$env{.PART_SUFFIX}"
# obsolete symlink that might get overridden on adding a new nvme controller, kept for backward compatibility
-ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", OPTIONS="string_escape=replace", \
+ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", ENV{ID_NSID}=="1", OPTIONS="string_escape=replace", \
ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}$env{.PART_SUFFIX}"
ENV{ID_MODEL}=="?*", ENV{ID_SERIAL_SHORT}=="?*", ENV{ID_NSID}=="?*", OPTIONS="string_escape=replace", \
ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}_$env{ID_NSID}", SYMLINK+="disk/by-id/nvme-$env{ID_SERIAL}$env{.PART_SUFFIX}"