diff options
author | NeilBrown <neilb@suse.de> | 2013-12-03 14:01:24 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-12-03 14:01:24 +1100 |
commit | b11fe74db0d764c3a245d95bc3651be9bbd59463 (patch) | |
tree | 8da452583d18057e67f65462a2e5dec2f4f3dee8 /udev-md-raid-assembly.rules | |
parent | 169ffac7ad7748c8586fd1d68b7a417d71133140 (diff) | |
download | mdadm-b11fe74db0d764c3a245d95bc3651be9bbd59463.tar.gz |
Incremental: improve support for "DEVICE" based restriction in mdadm.conf
--incremental currently fails if the device name passed does not
textually match the names permitted by the DEVICE line in mdadm.conf.
This is problematic when "mdadm -I" is run by udev as the name given
can be a temp name.
This patch makes two improvements:
1/ We generate a list of all existing devices that match the names
in mdadm.conf, and allow rdev based matching
2/ We allows extra aliases to be provided on the command line, and
perform textual matching on those. This is particularly suitable
for udev usages as ${DEVLINKS} can be provided even though the links
make not yet be created.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'udev-md-raid-assembly.rules')
-rw-r--r-- | udev-md-raid-assembly.rules | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/udev-md-raid-assembly.rules b/udev-md-raid-assembly.rules index 72bbed4..a668e16 100644 --- a/udev-md-raid-assembly.rules +++ b/udev-md-raid-assembly.rules @@ -12,7 +12,7 @@ LABEL="md_inc" # remember you can limit what gets auto/incrementally assembled by # mdadm.conf(5)'s 'AUTO' and selectively whitelist using 'ARRAY' -ACTION=="add", IMPORT{program}="/sbin/mdadm --incremental --export $devnode --offroot" +ACTION=="add", IMPORT{program}="/sbin/mdadm --incremental --export $devnode --offroot ${DEVLINKS}" ACTION=="add", ENV{MD_STARTED}=="*unsafe*", ENV{MD_FOREIGN}=="no", ENV{SYSTEMD_WANTS}+="mdadm-last-resort@$env{MD_DEVICE}.timer" ACTION=="remove", ENV{ID_PATH}=="?*", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}" ACTION=="remove", ENV{ID_PATH}!="?*", RUN+="/sbin/mdadm -If $name" |