OBS User unknown
2009-02-17 22:07:01 +00:00
committed by Git OBS Bridge
parent 8d7d26446e
commit 1422e7c520
4 changed files with 24 additions and 49 deletions

45
boot.md
View File

@@ -118,45 +118,14 @@ case "$1" in
/sbin/udevadm settle --timeout="$MDADM_DEVICE_TIMEOUT"
fi
if test "$BOOT_MD_USE_MDADM_CONFIG" = "yes" -a -e "$mdadm_CONFIG"; then
if ! grep -q '^[^#]*[^[:blank:]#]' $mdadm_CONFIG; then
# empty /etc/mdadm.conf, "unused"
rc_status -u
else
$mdadm_BIN -A -s -c $mdadm_CONFIG
# a status of 2 is not an error
test $? -eq 0 -o $? -eq 2
rc_status -v
fi
if ! grep -qs '^[^#]*[^[:blank:]#]' $mdadm_CONFIG; then
# empty or missing /etc/mdadm.conf, "unused"
rc_status -u
else
# do auto-assemly only if /etc/mdadm.conf is missing
# run at boot-time, so a fixed tmp name is safe
rm -rf /tmp/mdadm.conf
if test "$BOOT_MD_USE_MDADM_CONFIG" = "part"; then
echo CREATE auto=part > /tmp/mdadm.conf
fi
if ! mdadm --examine --scan --config=partitions >>/tmp/mdadm.conf
then
echo "mdadm --examine --scan failed:"
cat /tmp/mdadm.conf
rm -f /tmp/mdadm.conf
rc_failed 1
rc_status -v
rc_exit
fi
chmod 0600 /tmp/mdadm.conf
if test -s /tmp/mdadm.conf; then
mdadm --assemble --scan --config=/tmp/mdadm.conf
# a status of 2 is not an error
test $? -eq 0 -o $? -eq 2
rc_status -v
else
# no partitions found, "unused"
rc_status -u
fi
rm -f /tmp/mdadm.conf
$mdadm_BIN -A -s -c $mdadm_CONFIG
# a status of 2 is not an error
test $? -eq 0 -o $? -eq 2
rc_status -v
fi
;;
stop)