summaryrefslogtreecommitdiff
path: root/debian/mdadm.config
diff options
context:
space:
mode:
authormadduck <madduck@3cfab66f-1918-0410-86b3-c06b76f9a464>2006-08-23 14:18:29 +0000
committermadduck <madduck@3cfab66f-1918-0410-86b3-c06b76f9a464>2006-08-23 14:18:29 +0000
commitfdf4826cc6fb9f9894d0761392262c297205253c (patch)
treede536b14c88e4fcd13f78fe29f5b37248000db1e /debian/mdadm.config
parentc3a6e42bad58a0f83d43eac7a93f99e88595118a (diff)
* Improved initramfs hook; now does not rely on initramfs to provide RAID
assembly: - if a checked mdadm.conf file is present, use that. - if an unchecked mdadm.conf is present, create a temporary one - if that fails, use the unchecked one iff it contains at least one ARRAY statement. Otherwise rely on auto-generation from the initramfs during the book (and hope for the best). - if no mdadm.conf is found, create one on the fly - if that fails, hope that the auto-generation will work during boot * Improved the messages printed by the initramfs script. * Do not store the debconf answer for whether arrays not listed in the configuration file should be used. * Now asks again for the devices to start (preseeded with 'all') if the user does not want to proceed with devices not listed in the configuration file.
Diffstat (limited to 'debian/mdadm.config')
-rw-r--r--debian/mdadm.config23
1 files changed, 14 insertions, 9 deletions
diff --git a/debian/mdadm.config b/debian/mdadm.config
index 70d69566..6a59ef1d 100644
--- a/debian/mdadm.config
+++ b/debian/mdadm.config
@@ -67,13 +67,22 @@ fi
db_capb escape
-msg=intro; suffix=''
+msg=intro; suffix=''; error=0
while true; do
db_metaget mdadm/initrdstart_msg_${msg} extended_description || :
db_subst mdadm/initrdstart msg "$(echo -e "${RET}${suffix}" | debconf-escape -e)"
ret=0; db_input low mdadm/initrdstart || ret=$?
db_go
+ if [ $error -ne 0 ] && [ $ret -eq 30 ]; then
+ # there was an error in a previous run of this loop, but the above question
+ # was not asked, so we better exit the endless loop...
+ echo "W: unable to determine MD arrays needed for boot." >&2
+ echo "W: falling back to starting all of them..." >&2
+ INITRDSTART=all
+ break
+ fi
+
db_get mdadm/initrdstart
INITRDSTART="$(echo $RET | tr , ' ')"
@@ -83,7 +92,6 @@ while true; do
*)
arrays=''
- error=0
for i in $INITRDSTART; do
# standardise by prefixing /dev/
@@ -117,6 +125,8 @@ while true; do
&& egrep -q "^(ARRAY)?[[:space:]]+$t([[:space:]]|$)+" $CONFIG; then
i="$t"
else
+ db_set mdadm/initrdstart_notinconf false
+ db_fset mdadm/initrdstart_notinconf seen false
db_subst mdadm/initrdstart_notinconf array "$i"
db_subst mdadm/initrdstart_notinconf config "$CONFIG"
db_input high mdadm/initrdstart_notinconf || :
@@ -124,8 +134,10 @@ while true; do
db_get mdadm/initrdstart_notinconf
if [ "$RET" = true ]; then
md5sum $CONFIG > /var/lib/mdadm/CONF-UNCHECKED
+ error=0
else
db_fset mdadm/initrdstart seen false
+ db_set mdadm/initrdstart all
error=1; msg=errconf; suffix=": $i"; break
fi
fi
@@ -141,13 +153,6 @@ while true; do
# exit the while true loop
break
fi
-
- if [ $ret -eq 30 ]; then
- echo "W: unable to determine MD arrays needed for boot." >&2
- echo "W: falling back to starting all of them..." >&2
- INITRDSTART=all
- break
- fi
;;
esac
done