OBS User unknown 2007-07-27 13:12:30 +00:00 committed by Git OBS Bridge
parent 796bd1d0cb
commit c6a82921ed
3 changed files with 43 additions and 16 deletions

44
boot.md
View File

@ -75,8 +75,6 @@ rc_reset
# considered a success.
mdadm_BIN=/sbin/mdadm
mdrun_BIN=/sbin/mdrun
raidautorun_BIN=/sbin/raidautorun
mdadm_CONFIG="/etc/mdadm.conf"
mdadm_SYSCONFIG="/etc/sysconfig/mdadm"
@ -108,7 +106,6 @@ case "$1" in
# Check for missing binaries (stale symlinks should not happen)
[ -x $mdadm_BIN ] || _rc_exit 5 "... $mdadm_BIN not installed "
[ -x $mdrun_BIN ] || _rc_exit 5 "... $mdrun_BIN not installed "
# Try to load md_mod
[ ! -f /proc/mdstat -a -x /sbin/modprobe ] && /sbin/modprobe -k md_mod 2>&1 | :
@ -119,20 +116,35 @@ case "$1" in
/sbin/udevsettle --timeout="$MDADM_DEVICE_TIMEOUT"
fi
# Fallback to raidautorun / mdrun when $mdadm_CONFIG missing
# or mdadm exits with an error
[ "$BOOT_MD_USE_MDADM_CONFIG" = "yes" -a -s "$mdadm_CONFIG" ]
[ $? = 0 ] && { $mdadm_BIN -A -s -c $mdadm_CONFIG || rc_failed 1; }
if [ $? != 0 ]; then
if test -b /dev/md0; then
$raidautorun_BIN
else
$mdrun_BIN
if test "$BOOT_MD_USE_MDADM_CONFIG" = "yes" -a -s "$mdadm_CONFIG"; then
if ! grep -q '[^[:blank:]]' $mdadm_CONFIG; then
# empty /etc/mdadm.conf, "unused"
rc_status -u
fi
if ! $mdadm_BIN -A -s -c $mdadm_CONFIG; then
rc_failed 1
rc_status -v
fi
else
# do auto-assemly only if /etc/mdadm.conf is missing
rm -f /tmp/mdadm.conf
if ! mdadm --examine --scan --config=partitions >/tmp/mdadm.conf
then
rc_failed 1
rc_status -v
fi
if test -s /tmp/mdadm.conf; then
if ! mdadm --assemble --scan --config=/tmp/mdadm.conf
then
rc_failed 1
rc_status -v
fi
else
# partitions found, "unused"
rc_status -u
fi
fi
# Remember status and be verbose
rc_status -v
fi
;;
stop)
echo -n "Shutting down MD Raid "
@ -150,3 +162,5 @@ case "$1" in
;;
esac
rc_exit
# vim:ft=sh

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Jul 27 13:01:01 CEST 2007 - mmarek@suse.cz
- changes to the init script [#288454]
* don't try to autoassemble if /etc/mdadm.conf exists (even an
empty one)
* ony autoassemble partitions found in /proc/partitions
-------------------------------------------------------------------
Fri Jul 13 15:02:21 CEST 2007 - mmarek@suse.cz

View File

@ -12,7 +12,7 @@
Name: mdadm
Version: 2.6.2
Release: 1
Release: 4
BuildRequires: opensp sgmltool
PreReq: %fillup_prereq %insserv_prereq
Obsoletes: raidtools
@ -121,6 +121,11 @@ rm -rf $RPM_BUILD_ROOT
%{_var}/adm/fillup-templates/sysconfig.mdadm
%changelog
* Fri Jul 27 2007 - mmarek@suse.cz
- changes to the init script [#288454]
* don't try to autoassemble if /etc/mdadm.conf exists (even an
empty one)
* ony autoassemble partitions found in /proc/partitions
* Fri Jul 13 2007 - mmarek@suse.cz
- updated to 2.6.2
* --fail detached and --remove faulty can be used to fail and