+# {{{ SW-RAID
+config_swraid(){
+ if [ -z "$INSTALLED" ] ; then
+ if checkbootparam "noraid" -o checkbootparam "forensic" ; then
+ ewarn "Skipping search for SW-RAID as requested on boot commandline." ; eend 0
+ else
+ if ! [ -x /sbin/mdadm ] ; then
+ eerror "mdadm not available, can not execute it." ; eend 1
+ else
+
+ einfo "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
+
+ 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
+
+ fi # is /sbin/mdadm executable?
+ fi # check for bootoptions
+ fi # run only in live-cd mode
+}
+# }}}
+