diff mbox

[26/31] kpartx.rules: create by-partuuid and by-partlabel symlinks

Message ID 20170902223900.7339-27-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show

Commit Message

Martin Wilck Sept. 2, 2017, 10:38 p.m. UTC
The LVM rules do this since 2.02.173 (c48149cf80 "udev: also
create /dev/disk/by-part{label,uuid} and gpt-auto-root symlinks").
We have to do it here for partitions on unaccessible mpath maps.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 kpartx/kpartx.rules | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/kpartx/kpartx.rules b/kpartx/kpartx.rules
index 4e5a6d07..b05181a8 100644
--- a/kpartx/kpartx.rules
+++ b/kpartx/kpartx.rules
@@ -38,12 +38,18 @@  ENV{DM_UUID}!="part*-*-*", GOTO="import_end"
 ENV{ID_FS_USAGE}!="?*", IMPORT{db}="ID_FS_USAGE"
 ENV{ID_FS_UUID_ENC}!="?*", IMPORT{db}="ID_FS_UUID_ENC"
 ENV{ID_FS_LABEL_ENC}!="?*", IMPORT{db}="ID_FS_LABEL_ENC"
+ENV{ID_PART_ENTRY_NAME}!="?*", IMPORT{db}="ID_PART_ENTRY_NAME"
+ENV{ID_PART_ENTRY_UUID}!="?*", IMPORT{db}="ID_PART_ENTRY_UUID"
+ENV{ID_PART_ENTRY_SCHEME}!="?*", IMPORT{db}="ID_PART_ENTRY_SCHEME"
 LABEL="import_end"
 
 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", ENV{ID_FS_LABEL_ENC}=="?*", \
        SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
+ENV{ID_PART_ENTRY_UUID}=="?*", SYMLINK+="disk/by-partuuid/$env{ID_PART_ENTRY_UUID}"
+ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", \
+       SYMLINK+="disk/by-partlabel/$env{ID_PART_ENTRY_NAME}"
 LABEL="symlink_end"
 
 # Create dm tables for partitions