martin f. krafft: perform check for running devices earlier

Martin F. Krafft madduck at alioth.debian.org
Fri Jan 29 06:19:57 UTC 2010


Module: mdadm
Branch: incremental
Commit: fcb7754300e2f4aa217f050cfa91080949d2e674
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=fcb7754300e2f4aa217f050cfa91080949d2e674

Author: martin f. krafft <madduck at debian.org>
Date:   Fri Jan 29 18:52:36 2010 +1300

perform check for running devices earlier

Signed-off-by: martin f. krafft <madduck at debian.org>

Conflicts:

	debian/initramfs/hook

---

 debian/changelog      |    2 ++
 debian/initramfs/hook |   24 ++++++++++++------------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 3672f63..a01038d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ mdadm (3.1.1-2) UNRELEASED; urgency=low
     name.
   * Incremental mode does not make mdadm.conf obsolete, so do not skip the
     sanity checks in the initramfs hook.
+  * It makes sense to check that all active devices are in the configuration
+    even for incremental mode, so move it to an earlier location.
 
  -- martin f. krafft <madduck at debian.org>  Wed, 27 Jan 2010 14:42:16 +1300
 
diff --git a/debian/initramfs/hook b/debian/initramfs/hook
index 0686e63..306c041 100644
--- a/debian/initramfs/hook
+++ b/debian/initramfs/hook
@@ -250,6 +250,18 @@ else
     done < $DESTMDADMCONF)" || exit $?
 fi
 
+# make sure the configuration file knows about all running devices
+$MDADM --detail --scan | while read array device params; do
+  uuid=${params#*UUID=}; uuid=${uuid%% *}
+  if ! grep -q "UUID=$uuid" $DESTMDADMCONF; then
+    warn "the array $device with UUID $uuid"
+    warn "is currently active, but it is not listed in mdadm.conf. if"
+    warn "it is needed for boot, then YOUR SYSTEM IS NOW UNBOOTABLE!"
+    warn "please inspect the output of /usr/share/mdadm/mkconf, compare"
+    warn "it to $CONFIG, and make the necessary changes."
+  fi
+done
+
 if is_true "$INCREMENTAL"; then
   info 'MD arrays are being incrementally assembled, thus not trying to'
   info 'figure out which arrays should be started at boot.'
@@ -278,18 +290,6 @@ if [ "$INITRDSTART" != none ] && [ -n "$devpairs" ]; then
     esac
   done
 
-  # make sure the configuration file knows about all running devices
-  $MDADM --detail --scan | while read array device params; do
-    uuid=${params#*UUID=}; uuid=${uuid%% *}
-    if ! grep -q "UUID=$uuid" $DESTMDADMCONF; then
-      warn "the array $device with UUID $uuid"
-      warn "is currently active, but it is not listed in mdadm.conf. if"
-      warn "it is needed for boot, then YOUR SYSTEM IS NOW UNBOOTABLE!"
-      warn "please inspect the output of /usr/share/mdadm/mkconf, compare"
-      warn "it to $CONFIG, and make the necessary changes."
-    fi
-  done
-
   for i in $INITRDSTART; do
     case "$INITRDSTART" in all|none|'') break;; *) :;; esac
     case "$devs" in




More information about the pkg-mdadm-commits mailing list