]>
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 | 5 | # handle potential components of arrays |
950bc344 | 6 | ENV{ID_FS_TYPE}=="linux_raid_member", ACTION=="remove", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}" |
7efa6bc3 | 7 | ENV{ID_FS_TYPE}=="linux_raid_member", ACTION=="add", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" |
475a01b8 PC |
8 | ENV{ID_FS_TYPE}=="isw_raid_member", ACTION=="remove", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}" |
9 | ENV{ID_FS_TYPE}=="isw_raid_member", ACTION=="add", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" | |
7efa6bc3 N |
10 | |
11 | # handle md arrays | |
12 | ACTION!="add|change", GOTO="md_end" | |
757a5d74 N |
13 | KERNEL!="md*", GOTO="md_end" |
14 | ||
fa509028 N |
15 | # partitions have no md/{array_state,metadata_version}, but should not |
16 | # for that reason be ignored. | |
17 | ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" | |
18 | ||
757a5d74 N |
19 | # container devices have a metadata version of e.g. 'external:ddf' and |
20 | # never leave state 'inactive' | |
21 | ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" | |
fabf4941 | 22 | TEST!="md/array_state", GOTO="md_end" |
757a5d74 N |
23 | ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" |
24 | LABEL="md_ignore_state" | |
25 | ||
26 | IMPORT{program}="/sbin/mdadm --detail --export $tempnode" | |
67732c39 | 27 | ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace" |
757a5d74 N |
28 | ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}" |
29 | ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}" | |
67732c39 | 30 | ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace" |
757a5d74 N |
31 | ENV{DEVTYPE}=="partition", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n" |
32 | ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n" | |
33 | ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n" | |
34 | ||
5bac0443 | 35 | IMPORT{program}="/sbin/blkid -o udev -p $tempnode" |
757a5d74 | 36 | OPTIONS+="link_priority=100" |
2913d9df | 37 | OPTIONS+="watch" |
757a5d74 N |
38 | ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" |
39 | ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" | |
40 | ||
41 | LABEL="md_end" |