90mdraid/65-md-incremental-imsm.rules: first set initqueue-finished,
then initqueue-settled also introduce md_finished.sh to check for all md activity to be settledmaster
parent
54a73cbb2b
commit
5c3f5746bb
|
|
@ -18,22 +18,35 @@ TEST=="/tmp/.mdraid_container-%k", GOTO="md_inc_end"
|
|||
|
||||
KERNEL!="md*", IMPORT{program}="/sbin/mdadm --examine --export $tempnode"
|
||||
|
||||
|
||||
# UUID CHECK
|
||||
|
||||
LABEL="do_md_inc"
|
||||
|
||||
ENV{rd_MDADMCONF}=="?*", \
|
||||
RUN+="/sbin/initqueue --settled --onetime --unique /sbin/mdadm_auto", \
|
||||
RUN+="/bin/sh -c 'echo return 1 > /initqueue-finished/mdraid.sh'", \
|
||||
GOTO="md_inc_end"
|
||||
#
|
||||
# if rd_MDADMCONF do not assemble incrementally
|
||||
# defer auto assembly until the udev queue is settled
|
||||
#
|
||||
ENV{rd_MDADMCONF}!="?*", GOTO="md_auto_end"
|
||||
|
||||
ACTION=="change", \
|
||||
RUN+="/bin/sh -c '>/tmp/.mdraid_auto-%k'"
|
||||
|
||||
TEST!="/tmp/.mdraid_auto-%k", \
|
||||
RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique /sbin/mdadm_auto'"
|
||||
|
||||
GOTO="md_inc_end"
|
||||
|
||||
LABEL="md_auto_end"
|
||||
|
||||
#
|
||||
# Incrementally build the md array
|
||||
#
|
||||
RUN+="/sbin/mdadm -I --no-degraded $env{DEVNAME}"
|
||||
|
||||
ACTION=="change", \
|
||||
RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k'"
|
||||
|
||||
RUN+="/bin/sh -c 'echo return 1 > /initqueue-finished/mdraid.sh'"
|
||||
RUN+="/bin/ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh"
|
||||
|
||||
LABEL="md_inc_end"
|
||||
|
||||
|
|
@ -53,8 +66,7 @@ GOTO="end_raidstart"
|
|||
LABEL="do_raidstart"
|
||||
|
||||
TEST!="/tmp/.mdraid_start-%k", \
|
||||
RUN+="/sbin/initqueue --settled --onetime --unique /sbin/mdraid_start", \
|
||||
RUN+="/bin/sh -c 'echo return 1 > /initqueue-finished/mdraid.sh'"
|
||||
RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique /sbin/mdraid_start'"
|
||||
|
||||
ACTION=="change", \
|
||||
RUN+="/bin/sh -c '>/tmp/.mdraid_start-%k'"
|
||||
|
|
@ -77,8 +89,7 @@ GOTO="end_container"
|
|||
LABEL="do_container"
|
||||
|
||||
TEST!="/tmp/.mdcontainer_start-%k", \
|
||||
RUN+="/sbin/initqueue --settled --onetime --unique --name mdcontainer_start-%k /sbin/mdcontainer_start $env{DEVNAME}", \
|
||||
RUN+="/bin/sh -c 'echo return 1 > /initqueue-finished/mdraid.sh'"
|
||||
RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique --name mdcontainer_start-%k /sbin/mdcontainer_start $env{DEVNAME}'"
|
||||
|
||||
ACTION=="change", \
|
||||
RUN+="/bin/sh -c '>/tmp/.mdcontainer_start-%k'"
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ fi
|
|||
inst "$moddir/mdraid_start.sh" /sbin/mdraid_start
|
||||
inst "$moddir/mdcontainer_start.sh" /sbin/mdcontainer_start
|
||||
inst "$moddir/mdadm_auto.sh" /sbin/mdadm_auto
|
||||
inst "$moddir/md_finished.sh" /sbin/md_finished.sh
|
||||
inst_hook pre-trigger 30 "$moddir/parse-md.sh"
|
||||
inst_hook pre-pivot 30 "$moddir/mdraid-cleanup.sh"
|
||||
inst_hook pre-pivot 31 "$moddir/mdraid-cleanup.sh"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
for f in /initqueue-settled/mdcontainer_start* /initqueue-settled/mdraid_start* /initqueue-settled/mdadm_auto*; do
|
||||
[ -e $f ] && return 1
|
||||
done
|
||||
|
||||
$UDEV_QUEUE_EMPTY >/dev/null 2>&1 || return 1
|
||||
|
||||
return 0
|
||||
|
|
@ -5,5 +5,4 @@ md=$1
|
|||
udevadm control --stop-exec-queue
|
||||
# and activate any containers
|
||||
mdadm -IR $md 2>&1 | vinfo
|
||||
[ -f /initqueue-settled/mdraid_start ] || rm /initqueue-finished/mdraid.sh 2>/dev/null
|
||||
udevadm control --start-exec-queue
|
||||
|
|
|
|||
|
|
@ -5,5 +5,4 @@
|
|||
info "Assembling MD RAID arrays"
|
||||
udevadm control --stop-exec-queue
|
||||
mdadm -IRs 2>&1 | vinfo
|
||||
[ -f /initqueue-settled/mdcontainer_start ] || rm /initqueue-finished/mdraid.sh 2>/dev/null
|
||||
udevadm control --start-exec-queue
|
||||
|
|
|
|||
Loading…
Reference in New Issue