From 0e7d8d61629bffcdacfc869c7b14709a758908179e2abbbbf4f9cde41167e244 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 27 Jul 2007 13:12:30 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=5 --- boot.md | 44 +++++++++++++++++++++++++++++--------------- mdadm.changes | 8 ++++++++ mdadm.spec | 7 ++++++- 3 files changed, 43 insertions(+), 16 deletions(-) diff --git a/boot.md b/boot.md index be9b8bb..d5df95f 100644 --- a/boot.md +++ b/boot.md @@ -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 diff --git a/mdadm.changes b/mdadm.changes index a0b2b0c..4b899b0 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -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 diff --git a/mdadm.spec b/mdadm.spec index 21a2fc9..9e50a91 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -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