1 #!/bin/sh /etc/rc.common
10 CONF="/var/etc/mdadm.conf"
24 if [ -n "$sep" ]; then
25 config_list_foreach "$cfg" "$opt" append_list_item str "$sep"
27 config_get str "$cfg" "$opt"
30 [ -n "$str" ] && append "$var" $(printf "%s=%s" "${name:-${opt//_/-}}" "$str")
37 if [ -x /sbin/sendmail ]; then
38 append_option email "$cfg" email "MAILADDR"
42 append_option devices "$cfg" devices DEVICE " "
44 printf "%s\n%s\n" "$email" "$devices" >> $CONF
49 local uuid device devices name array
51 config_get uuid "$cfg" uuid
52 config_get name "$cfg" name
53 config_get device "$cfg" device
55 if [ -z "$device" ] || [ -z "$uuid$name" ]; then
56 echo "Skipping array without device, uuid or name" >&2
60 [ -n "$uuid" ] && append array "uuid=$uuid"
61 [ -n "$name" ] && append array "name=$name"
63 append_option array "$cfg" super_minor
64 append_option array "$cfg" spares
65 append_option array "$cfg" spare_group
66 append_option array "$cfg" bitmap
67 append_option array "$cfg" container
68 append_option array "$cfg" member
69 append_option array "$cfg" devices devices ","
71 printf "ARRAY %s %s\n" "$device" "$array" >> $CONF
78 printf "# Autogenerated from /etc/config/mdadm, do not edit!\n" > $CONF
81 config_foreach mdadm_common mdadm
82 config_foreach mdadm_array array
84 $PROG --assemble --scan --config="$CONF"
87 procd_set_param command "$PROG" --monitor --syslog --scan --config="$CONF"