- remove boot.md. It no longer does anything useful.

OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=102
This commit is contained in:
Neil Brown 2014-01-22 23:46:10 +00:00 committed by Git OBS Bridge
parent a713ca507f
commit 639327d1db
3 changed files with 6 additions and 159 deletions

153
boot.md
View File

@ -1,153 +0,0 @@
#!/bin/sh
#
# SUSE system startup script for MD RAID autostart
# Copyright (C) 1995--2005 Kurt Garloff, SUSE / Novell Inc.
# Copyright (C) 2006 Marian Jancar, SUSE / Novell Inc.
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or (at
# your option) any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
#
### BEGIN INIT INFO
# Provides: boot.md
# Required-Start: boot.udev boot.rootfsck
# Required-Stop: $null
# Should-Start: boot.scsidev boot.multipath systemd-udev-trigger
# Should-Stop: boot.scsidev boot.multipath
# Default-Start: B
# Default-Stop:
# Short-Description: Multiple Device RAID
# Description: Start MD RAID
# RAID devices are virtual devices created from two or more real block devices.
# This allows multiple devices (typically disk drives or partitions there-of)
# to be combined into a single device to hold (for example) a single filesystem.
# Some RAID levels include redundancy and so can survive some degree of device failure.
### END INIT INFO
# Source LSB init functions
# providing start_daemon, killproc, pidofproc,
# log_success_msg, log_failure_msg and log_warning_msg.
# This is currently not used by UnitedLinux based distributions and
# not needed for init scripts for UnitedLinux only. If it is used,
# the functions from rc.status should not be sourced or used.
#. /lib/lsb/init-functions
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v be verbose in local rc status and clear it afterwards
# rc_status -v -r ditto and clear both the local and overall rc status
# rc_status -s display "skipped" and exit with status 3
# rc_status -u display "unused" and exit with status 3
# rc_failed set local and overall rc status to failed
# rc_failed <num> set local and overall rc status to <num>
# rc_reset clear both the local and overall rc status
# rc_exit exit appropriate to overall rc status
# rc_active checks whether a service is activated by symlinks
. /etc/rc.status
# Reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - user had insufficient privileges
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
# 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signaling is not supported) are
# considered a success.
mdadm_BIN=/sbin/mdadm
mdadm_CONFIG="/etc/mdadm.conf"
mdadm_SYSCONFIG="/etc/sysconfig/mdadm"
# udev integration
if [ -x /sbin/udevadm ] ; then
[ -z "$MDADM_DEVICE_TIMEOUT" ] && MDADM_DEVICE_TIMEOUT=60
else
MDADM_DEVICE_TIMEOUT=0
fi
function _rc_exit {
[ "x$2" != x"" ] && echo -n $2
rc_failed $1
rc_status -v
rc_exit
}
case "$1" in
start)
echo -n "Starting MD RAID "
/sbin/mdmon --all --takeover --offroot
# Check for existence of needed config file and read it
[ -r $mdadm_SYSCONFIG ] || _rc_exit 6 "... $mdadm_SYSCONFIG not existing "
# Read config
. $mdadm_SYSCONFIG
[ "x$MDADM_CONFIG" != x"" ] && mdadm_CONFIG="$MDADM_CONFIG"
# Check for missing binaries (stale symlinks should not happen)
[ -x $mdadm_BIN ] || _rc_exit 5 "... $mdadm_BIN not installed "
# Try to load md_mod
[ ! -f /proc/mdstat -a -x /sbin/modprobe ] && /sbin/modprobe md_mod
[ -f /proc/mdstat ] || _rc_exit 5 "... no MD support in kernel "
# leave all array assembly to udev.
rc_status -v
;;
stop)
echo -n "Not shutting down MD RAID - reboot/halt scripts do this."
rc_failed 3
# Remember status and be verbose
rc_status -v
;;
status)
echo -n "MD RAID arrays:"
count=`grep -c ' active ' /proc/mdstat 2> /dev/null`
case $count in
0 ) echo -n " No arrays active"; rc_failed 3;;
1 ) echo -n " 1 array active";;
* ) echo -n " $count arrays active";;
esac
rc_status -v
;;
reload)
# There isn't much that is useful to do.
# We cannot reload the kernel module, or reassemble the
# arrays. Restarting mdmon is pointless and might be bad
# as mdmon might be running in the initrd.
# We could start and newly-degraded arrays.
/sbin/mdadm -IRs
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|reload}"
exit 1
;;
esac
rc_exit
# vim:ft=sh

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Jan 22 23:45:34 UTC 2014 - nfbrown@suse.com
- remove boot.md. It no longer does anything useful.
-------------------------------------------------------------------
Wed Jan 22 04:54:22 UTC 2014 - nfbrown@suse.com

View File

@ -37,7 +37,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: https://www.kernel.org/pub/linux/utils/raid/mdadm/%{name}-%{version}.tar.bz2
Source1: Software-RAID.HOWTO.tar.bz2
Source2: sysconfig.mdadm
Source4: boot.md
Source5: mkinitrd-setup.sh
Source6: mkinitrd-boot.sh
Source7: mdadm.cron
@ -150,8 +149,7 @@ sgml2txt Software-RAID.HOWTO.sgml
make install install-systemd install-udev DESTDIR=%{buildroot} SYSTEMD_DIR=%{_unitdir} UDEVDIR=%{_udevdir} SUSE=yes
rm -rf %{buildroot}/lib/udev
install -d %{buildroot}%{_var}/adm/fillup-templates
install -d %{buildroot}{%{_sbindir},%{_sysconfdir}/init.d}
install -m 755 %{S:4} %{buildroot}%{_sysconfdir}/init.d/
install -d %{buildroot}{%{_sbindir}
install -d %{buildroot}/lib/mkinitrd/scripts
install -m 755 %{S:5} %{buildroot}/lib/mkinitrd/scripts/setup-md.sh
install -m 755 %{S:6} %{buildroot}/lib/mkinitrd/scripts/boot-md.sh
@ -172,8 +170,6 @@ elif [ -x /sbin/mkinitrd ]; then
/sbin/mkinitrd
fi
%{fillup_and_insserv -y boot.md}
%postun
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
if [ -e /var/lib/no_initrd_recreation_by_suspend ]; then
@ -192,7 +188,6 @@ rm -rf %{buildroot}
%files
%defattr(-,root,root)
%attr(0755,root,root) %config %{_sysconfdir}/init.d/*
%doc COPYING ChangeLog README.initramfs TODO mdadm.conf-example mkinitramfs
%doc Software-RAID.HOWTO/Software-RAID.HOWTO*{.txt,.html}
%doc %{_mandir}/man?/*