From: Michael Prokop Date: Sat, 2 Dec 2006 15:45:40 +0000 (+0100) Subject: * Do *not* autoassemble sw-raid arrays any more, instead: X-Git-Tag: 0.6-5~2 X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=commitdiff_plain;h=796bdc7d4b440661244a3202a957e7fbb95ffafe * Do *not* autoassemble sw-raid arrays any more, instead: - create /etc/mdadm/mdadm.conf by default, boot using noswraid to disable it - assemble md arrays only if bootoption swraid is used, otherwise display usage information how to enable it --- diff --git a/autoconfig.functions b/autoconfig.functions index 8305199..ab9d833 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -1897,8 +1897,9 @@ fi config_swraid(){ if [ -z "$INSTALLED" ] ; then # notice: checkbootparam "forensic" is just for users who don't know how to really use the bootoption - if checkbootparam "noraid" -o checkbootparam "forensic" -o checkbootparam "raid=noautodetect" ; then - ewarn "Skipping search for SW-RAID as requested on boot commandline." ; eend 0 + if checkbootparam 'noraid' -o checkbootparam 'noswraid' -o \ + checkbootparam 'forensic' -o checkbootparam 'raid=noautodetect' ; then + ewarn "Skipping SW-RAID code as requested on boot commandline." ; eend 0 else if ! [ -x /sbin/mdadm ] ; then eerror "mdadm not available, can not execute it." ; eend 1 @@ -1907,47 +1908,53 @@ config_swraid(){ # if ! egrep -qv '^(MAILADDR.*|#.*|)$' /etc/mdadm/mdadm.conf 2>>$DEBUG ; then # find out whether we have a valid configuration file already if ! grep -q ARRAY /etc/mdadm/mdadm.conf 2>>$DEBUG ; then - einfo "Creating /etc/mdadm/mdadm.conf" - [ -r /etc/mdadm/mdadm.conf ] && mv /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf.old - MDADM_MAILADDR__='root' /usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf ; eend $? - else - ewarn "/etc/mdadm/mdadm.conf looks like a configured mdadm setup, will not touch it." ; eend 0 + einfo "Creating /etc/mdadm/mdadm.conf for use with mdadm." + [ -r /etc/mdadm/mdadm.conf ] && mv /etc/mdadm/mdadm.conf /etc/mdadm/mdadm.conf.old + MDADM_MAILADDR__='root' /usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf ; eend $? + else + ewarn "/etc/mdadm/mdadm.conf looks like a configured mdadm setup, will not touch it." ; eend 0 fi - einfo "Searching for software RAID arrays (disable via bootoption noraid):" - eindent - IFSOLD=${IFS:-} - IFS=' + if ! checkbootparam 'swraid' ; then + eindent + einfo "Just run 'Start mdadm-raid' to assemble md arrays or boot using swraid bootoption for autostart." + eoutdent + else + einfo "Bootoption swraid found. Searching for software RAID arrays:" + eindent + IFSOLD=${IFS:-} + IFS=' ' - for line in $(mdadm --assemble --scan --auto=yes --symlink=no 2>&1) ; do - case $line in - *'No arrays found'*) - ewarn "$line" ; eend 0 - ;; - *) - einfo "$line" ; eend 0 - ;; - esac - done - IFS=$IFSOLD - eoutdent + for line in $(mdadm --assemble --scan --auto=yes --symlink=no 2>&1) ; do + case $line in + *'No arrays found'*) + ewarn "$line" ; eend 0 + ;; + *) + einfo "$line" ; eend 0 + ;; + esac + done + IFS=$IFSOLD + eoutdent - if [ -r /proc/mdstat ] ; then - eindent - MDSTAT=$(grep '^md[0-9]' /proc/mdstat) - if [ -z "$MDSTAT" ] ; then - ewarn "No active arrays found" ; eend 0 - else - IFSOLD=${IFS:-} - IFS=' + if [ -r /proc/mdstat ] ; then + eindent + MDSTAT=$(grep '^md[0-9]' /proc/mdstat) + if [ -z "$MDSTAT" ] ; then + ewarn "No active arrays found" ; eend 0 + else + IFSOLD=${IFS:-} + IFS=' ' - for line in $(grep '^md[0-9]' /proc/mdstat) ; do - einfo "active arrays: $line" ; eend 0 - done - IFS=$IFSOLD - fi - eoutdent - fi + for line in $(grep '^md[0-9]' /proc/mdstat) ; do + einfo "active arrays: $line" ; eend 0 + done + IFS=$IFSOLD + fi + eoutdent + fi # /proc/mdstat + fi # bootoption swraid fi # is /sbin/mdadm executable? fi # check for bootoptions diff --git a/debian/changelog b/debian/changelog index 34e6a1c..93fd9a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +grml-autoconfig (0.6-4) unstable; urgency=low + + * Do *not* autoassemble sw-raid arrays any more, instead: + - create /etc/mdadm/mdadm.conf by default, boot using + noswraid to disable it + - assemble md arrays only if bootoption swraid is used, + otherwise display usage information how to enable it + + -- Michael Prokop Sat, 2 Dec 2006 16:41:18 +0100 + grml-autoconfig (0.6-3) unstable; urgency=low * Extend 'Ignoring swap partition'-message for new default