r207 - mdadm/trunk/debian/initramfs

madduck at users.alioth.debian.org madduck at users.alioth.debian.org
Fri Oct 6 12:45:57 UTC 2006


Author: madduck
Date: 2006-10-06 12:45:57 +0000 (Fri, 06 Oct 2006)
New Revision: 207

Modified:
   mdadm/trunk/debian/initramfs/hook
Log:
check for ARRAY definitions in configuration file, or fall back to emergency procedure

Modified: mdadm/trunk/debian/initramfs/hook
===================================================================
--- mdadm/trunk/debian/initramfs/hook	2006-10-06 12:34:35 UTC (rev 206)
+++ mdadm/trunk/debian/initramfs/hook	2006-10-06 12:45:57 UTC (rev 207)
@@ -90,9 +90,7 @@
     install_config $CONFIG $DESTMDADMCONF
     echo "I: mdadm: auto-generated the mdadm.conf configuration file." >&2
   else
-    # we failed to auto-generate, so remove the file and let the emergency
-    # procedure take over
-    rm -f $CONFIG
+    # we failed to auto-generate, so let the emergency procedure take over
     echo "W: mdadm: failed to auto-generate the mdadm.conf file." >&2
     echo "W: mdadm: please read /usr/share/doc/mdadm/README.upgrading-2.5.3.gz ." >&2
   fi
@@ -119,8 +117,6 @@
       if grep -q '^ARRAY' $CONFIG; then
         echo "W: mdadm: using the unchecked file and hoping for the best..." >&2
         install_config $CONFIG $DESTMDADMCONF
-      else
-        echo "W: mdadm: no ARRAYs defined in unchecked mdadm.conf, cannot use..." >&2
       fi
     fi
     rm -f $tmpfile
@@ -133,11 +129,16 @@
 
 fi
 
-# if at this point, $DESTMDADMCONF does not exist, we must let the initramfs
-# handle stuff.
+# if at this point, $DESTMDADMCONF does not exist or it does not contain any
+# ARRAY statements, we must let the initramfs handle stuff.
 if [ ! -f $DESTMDADMCONF ]; then
+  echo "W: mdadm: no configuration file available." >&2
   echo "W: mdadm: falling back to emergency procedure in initramfs." >&2
   exit 0
+elif ! grep -q '^ARRAY' $DESTMDADMCONF; then
+  echo "W: mdadm: no arrays defined in configuration file." >&2
+  echo "W: mdadm: falling back to emergency procedure in initramfs." >&2
+  exit 0
 else
   # obtain dev:level pairs from config file, honouring multiline entries
   devpairs="$(




More information about the pkg-mdadm-commits mailing list