diff options
author | madduck <madduck@3cfab66f-1918-0410-86b3-c06b76f9a464> | 2006-10-26 21:39:20 +0000 |
---|---|---|
committer | madduck <madduck@3cfab66f-1918-0410-86b3-c06b76f9a464> | 2006-10-26 21:39:20 +0000 |
commit | 25690fff481fad6e3686ed1e6e8cdec09f748072 (patch) | |
tree | c7837b8528e274df6c9bae8b5b2f110d4196b00f /debian/mdadm-raid | |
parent | 488e6bc8a934da39e7f7f657c83499677475e98c (diff) |
* Send udev events for arrays assembled by the mdadm-raid init.d script.
This does not close #394193 but it's a good addition anyway. I am not
sending these events from the initramfs as well because it would be
non-trivial to ensure that an event doesn't get sent twice for a given
array.
Diffstat (limited to 'debian/mdadm-raid')
-rw-r--r-- | debian/mdadm-raid | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/debian/mdadm-raid b/debian/mdadm-raid index 385db66d..ca76fcdc 100644 --- a/debian/mdadm-raid +++ b/debian/mdadm-raid @@ -81,6 +81,14 @@ is_true() esac } +STATEDIR=/dev +for dir in /lib/init/rw /dev/shm; do + test -d $dir/.mdadm && STATEDIR=$dir && break + test -w $dir || continue + STATEDIR=$dir +done +mkdir $STATEDIR/.mdadm 2>/dev/null && STATEDIR=$STATEDIR/.mdadm || unset STATEDIR + case "${1:-}" in start) PREFIX="Assembling MD array" @@ -161,8 +169,11 @@ case "${1:-}" in log_action_begin_msg "Generating udev events for MD arrays" for uevent in /sys/block/md*/uevent; do + array=${uevent#/sys/block/}; array=${dev%/uevent} + test -e $STATEDIR/$array && continue test -w $uevent || continue echo add > $uevent + : > $STATEDIR/$array done log_action_end_msg 0 @@ -220,6 +231,9 @@ case "${1:-}" in *) :;; esac done || exit $? + + rm -rf $STATEDIR + else log_notice "disabled in $DEBIANCONFIG" fi |