martin f. krafft: we need to load md_mod to set params

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


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

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

we need to load md_mod to set params

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

---

 debian/initramfs/script.local-top |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/debian/initramfs/script.local-top b/debian/initramfs/script.local-top
index 4d11eb9..b9b4899 100644
--- a/debian/initramfs/script.local-top
+++ b/debian/initramfs/script.local-top
@@ -36,6 +36,23 @@ case ${1:-} in
   prereqs) echo "multipath"; exit 0;;
 esac
 
+if [ -e /proc/modules ]; then
+  verbose && log_begin_msg Loading MD module
+  if modprobe -q md_mod; then
+    verbose && log_success_msg "loaded MD module."
+  else
+    log_failure_msg "failed to load MD module (md_mod)."
+  fi
+fi
+
+if [ ! -f /proc/mdstat ]; then
+  verbose && panic "MD subsystem is not initialised (/proc/mdstat missing)"
+  exit 1
+fi
+
+# prevent writes/syncs so that resuming works (#415441).
+echo 1 > /sys/module/md_mod/parameters/start_ro
+
 DEBIANCONFIG=/etc/default/mdadm
 [ -s $DEBIANCONFIG ] && . $DEBIANCONFIG
 [ -s /conf/conf.d/md ] && . /conf/conf.d/md
@@ -66,9 +83,6 @@ if [ ! -e $CONFIG ]; then
   MD_DEVS=all
 fi
 
-# prevent writes/syncs so that resuming works (#415441).
-echo 1 > /sys/module/md_mod/parameters/start_ro
-
 if [ "$MD_DEVS" = all ]; then
 
   verbose && log_begin_msg "Assembling all MD arrays"




More information about the pkg-mdadm-commits mailing list