diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2007-10-08 21:07:07 +0000 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2007-10-08 21:07:07 +0000 |
commit | 8375e5f0df1798679b45db5f5986aea149d98f81 (patch) | |
tree | fba59d90276b90cba75dfe25db47a83a309cb098 /sys-fs/mdadm/files | |
parent | Fixed lyx-installation; bug #193381. Make installation $ROOT-safe. (diff) | |
download | gentoo-2-8375e5f0df1798679b45db5f5986aea149d98f81.tar.gz gentoo-2-8375e5f0df1798679b45db5f5986aea149d98f81.tar.bz2 gentoo-2-8375e5f0df1798679b45db5f5986aea149d98f81.zip |
Make sure RAID starts when /usr is a different partition that is not yet available, and ensure that RAID comes up after modules properly, fixing the circular rc script loop.
(Portage version: 2.1.3.12)
Diffstat (limited to 'sys-fs/mdadm/files')
-rw-r--r-- | sys-fs/mdadm/files/digest-mdadm-2.6.3-r4 | 3 | ||||
-rw-r--r-- | sys-fs/mdadm/files/mdraid.rc-2.6.3-r4 | 27 | ||||
-rw-r--r-- | sys-fs/mdadm/files/raid-start.sh-2.6.3-r4 | 51 |
3 files changed, 81 insertions, 0 deletions
diff --git a/sys-fs/mdadm/files/digest-mdadm-2.6.3-r4 b/sys-fs/mdadm/files/digest-mdadm-2.6.3-r4 new file mode 100644 index 000000000000..53e49f8e561a --- /dev/null +++ b/sys-fs/mdadm/files/digest-mdadm-2.6.3-r4 @@ -0,0 +1,3 @@ +MD5 2d3950028253a856f065763e5bd78b1c mdadm-2.6.3.tar.bz2 151822 +RMD160 236f38c021d92e387cf00f66a28d1a35d160740b mdadm-2.6.3.tar.bz2 151822 +SHA256 5da1da7e2e9df39071016e6914769f685574dc50d94b6b2bbfaec18e376c070c mdadm-2.6.3.tar.bz2 151822 diff --git a/sys-fs/mdadm/files/mdraid.rc-2.6.3-r4 b/sys-fs/mdadm/files/mdraid.rc-2.6.3-r4 new file mode 100644 index 000000000000..e637e7371ec4 --- /dev/null +++ b/sys-fs/mdadm/files/mdraid.rc-2.6.3-r4 @@ -0,0 +1,27 @@ +#!/sbin/runscript +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/mdadm/files/mdraid.rc-2.6.3-r4,v 1.1 2007/10/08 21:07:07 robbat2 Exp $ + +depend() { + if [ -e /lib/librc.so ]; then + # on baselayout-1 this could cause + # dependency-cycles with checkroot (before *) + before checkfs + after modules + fi +} + +start() { + if [ ! -e /lib/librc.so ]; then + eerror "The ${SVCNAME} init script is written for baselayout-2" + eerror "Please do not use it with baselayout-1" + return 1 + fi + + start_addon raid +} + +stop() { + stop_addon raid +} diff --git a/sys-fs/mdadm/files/raid-start.sh-2.6.3-r4 b/sys-fs/mdadm/files/raid-start.sh-2.6.3-r4 new file mode 100644 index 000000000000..96c29952ef3a --- /dev/null +++ b/sys-fs/mdadm/files/raid-start.sh-2.6.3-r4 @@ -0,0 +1,51 @@ +# /lib/rcscripts/addons/raid-start.sh: Setup raid volumes at boot +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/mdadm/files/raid-start.sh-2.6.3-r4,v 1.1 2007/10/08 21:07:07 robbat2 Exp $ + +[ -f /proc/mdstat ] || exit 0 + +# We could make this dynamic, but eh +#[ -z ${MAJOR} ] && export MAJOR=$(awk '$2 == "md" { print $1 }' /proc/devices) +MAJOR=9 + +# Try to make sure the devices exist before we use them +create_devs() { + local node dir minor + for node in $@ ; do + [ "${node#/dev}" != "${node}" ] && node="/dev/${node}" + [ -e "${node}" ] && continue + + dir="${node%/*}" + [ ! -d "${dir}" ] && mkdir -p "${dir}" + + minor="${node##*/}" + mknod "${node}" b ${MAJOR} "${minor##*md}" &> /dev/null + done +} + +# Start software raid with mdadm (new school) +mdadm_conf="/etc/mdadm/mdadm.conf" +[ -e /etc/mdadm.conf ] && mdadm_conf="/etc/mdadm.conf" +if [ -x /sbin/mdadm -a -f "${mdadm_conf}" ] ; then + devs="$(awk '/^[[:space:]]*ARRAY/ { print $2 }' ${mdadm_conf})" + if [ -n "${devs}" ]; then + create_devs ${devs} + ebegin "Starting up RAID devices (mdadm)" + output=$(mdadm -As 2>&1) + ret=$? + [ ${ret} -ne 0 ] && echo "${output}" + eend ${ret} + fi +fi + +partitioned_devs="$(ls /dev/md_d* 2>/dev/null)" +if [ -n "${partitioned_devs}" ]; then + ebegin "Creating RAID device partitions" + /sbin/blockdev ${partitioned_devs} + eend 0 + # wait because vgscan runs next, and we want udev to fire + sleep 1 +fi + +# vim:ts=4 |