]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: decrease devlink priority for encrypted partitions
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 2 Aug 2023 14:33:14 +0000 (23:33 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 2 Aug 2023 21:03:14 +0000 (22:03 +0100)
Decrease devlink priority for encrypted partitions, and make the priority for
decrypted DM devices relatively higher. This is for the case that an encrypted
partition and its decrypted DM device have the same label.

rules.d/60-persistent-storage.rules.in

index f08fc0da2fcaae1e68be70d5e244fd846c91eb92..c89d8a3e0e5b137d5363ebfdb9f959f35ede788c 100644 (file)
@@ -138,6 +138,11 @@ LABEL="persistent_storage_blkid_probe_end"
 # See issue #28468.
 ENV{ID_FS_TYPE}=="iso9660", ENV{DEVTYPE}=="disk", OPTIONS+="link_priority=-10"
 
+# Decrease devlink priority for encrypted partitions, and make the priority for
+# decrypted DM devices relatively higher. This is for the case that an encrypted
+# partition and its decrypted DM device have the same label.
+ENV{ID_FS_USAGE}=="crypto", OPTIONS+="link_priority=-10"
+
 # by-label/by-uuid links (filesystem metadata)
 ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
 ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"