]> git.ipfire.org Git - thirdparty/systemd.git/commit - rules.d/60-persistent-storage.rules.in
udev: restore compat symlink for nvme devices
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 6 Apr 2023 10:28:14 +0000 (12:28 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 7 Apr 2023 19:50:04 +0000 (04:50 +0900)
commitd05e1be86e6b14bd22d57af17efcc3b8fb7ecd82
treed28e5e5e3786eec8961702b285e87532f78d1ada
parent8f5a8d7c361f0a3e479bc5c2d2a8cee25ea54d9d
udev: restore compat symlink for nvme devices

In 5118e8e71dda211d20e34ec8d3012186ba27d3d3, the rules were changed to add
OPTIONS="string_escape=replace" to creation of
ENV{ID_SERIAL}="$env{ID_MODEL}_$env{ID_SERIAL_SHORT}", so that "/" would be
escaped. But this also changes how the symlink looks for devices that do not
have "/". This adds back the old symlink for compat, except when a slash
is present.

In the meantime, we changed the symlink format to include ${ND_NSID}. Since
the symlink with unescaped characters are older than that, for compat we
only need to cover the older type. (Symlinks without escaping and with ${ND_NSID}
were never created.)  This makes it slightly easier on users: the non-deprecated
symlinks are with "_${ND_NSID}", so they are easier to distinguish.

Fixes #27155.

Mostly untested :(  I only have a boring nvme device with no special characters
in the id, and the symlinks are unchanged for it by this patch.
rules.d/60-persistent-storage.rules.in