]>
Commit | Line | Data |
---|---|---|
757a5d74 N |
1 | # do not edit this file, it will be overwritten on update |
2 | ||
3 | SUBSYSTEM!="block", GOTO="md_end" | |
757a5d74 | 4 | |
7efa6bc3 N |
5 | # handle md arrays |
6 | ACTION!="add|change", GOTO="md_end" | |
757a5d74 N |
7 | KERNEL!="md*", GOTO="md_end" |
8 | ||
fa509028 N |
9 | # partitions have no md/{array_state,metadata_version}, but should not |
10 | # for that reason be ignored. | |
11 | ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" | |
12 | ||
757a5d74 N |
13 | # container devices have a metadata version of e.g. 'external:ddf' and |
14 | # never leave state 'inactive' | |
15 | ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" | |
5b7e273a | 16 | TEST!="md/array_state", ENV{SYSTEMD_READY}="0", GOTO="md_end" |
339b7746 | 17 | ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0", GOTO="md_end" |
757a5d74 N |
18 | LABEL="md_ignore_state" |
19 | ||
85945e19 | 20 | IMPORT{program}="BINDIR/mdadm --detail --export $devnode" |
67732c39 | 21 | ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace" |
757a5d74 N |
22 | ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}" |
23 | ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}" | |
67732c39 | 24 | ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace" |
757a5d74 N |
25 | ENV{DEVTYPE}=="partition", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n" |
26 | ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n" | |
27 | ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n" | |
28 | ||
3ab6bf30 | 29 | IMPORT{builtin}="blkid" |
757a5d74 | 30 | OPTIONS+="link_priority=100" |
2913d9df | 31 | OPTIONS+="watch" |
757a5d74 N |
32 | ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" |
33 | ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" | |
34 | ||
61c09471 N |
35 | ENV{MD_LEVEL}=="raid[1-9]*", ENV{SYSTEMD_WANTS}+="mdmonitor.service" |
36 | ||
8d1d32bb N |
37 | # Tell systemd to run mdmon for our container, if we need it. |
38 | ENV{MD_LEVEL}=="raid[1-9]*", ENV{MD_CONTAINER}=="?*", PROGRAM="/usr/bin/readlink $env{MD_CONTAINER}", ENV{MD_MON_THIS}="%c" | |
39 | ENV{MD_MON_THIS}=="?*", PROGRAM="/usr/bin/basename $env{MD_MON_THIS}", ENV{SYSTEMD_WANTS}+="mdmon@%c.service" | |
40 | ||
757a5d74 | 41 | LABEL="md_end" |