diff options
author | 2007-10-03 11:58:45 +0000 | |
---|---|---|
committer | 2007-10-03 11:58:45 +0000 | |
commit | 61f0a40fab91eb67b6cc42ad20c35c931bf3e53a (patch) | |
tree | 925a5d0fdc988cb826c483eb55d7bb71d638c645 /sys-fs/mdadm/files | |
parent | Version bump (diff) | |
download | gentoo-2-61f0a40fab91eb67b6cc42ad20c35c931bf3e53a.tar.gz gentoo-2-61f0a40fab91eb67b6cc42ad20c35c931bf3e53a.tar.bz2 gentoo-2-61f0a40fab91eb67b6cc42ad20c35c931bf3e53a.zip |
Add udev rules per bug #182960. Add support for partitioned md devices per #123380. Rip out the old raidtools support since raidtools is long gone.
(Portage version: 2.1.3.11)
Diffstat (limited to 'sys-fs/mdadm/files')
-rw-r--r-- | sys-fs/mdadm/files/64-md-raid.rules-2.6.3-r2 | 18 | ||||
-rw-r--r-- | sys-fs/mdadm/files/digest-mdadm-2.6.3-r2 | 3 | ||||
-rw-r--r-- | sys-fs/mdadm/files/raid-start.sh-2.6.3-r2 | 51 | ||||
-rw-r--r-- | sys-fs/mdadm/files/raid-stop.sh-2.6.3-r2 | 19 |
4 files changed, 91 insertions, 0 deletions
diff --git a/sys-fs/mdadm/files/64-md-raid.rules-2.6.3-r2 b/sys-fs/mdadm/files/64-md-raid.rules-2.6.3-r2 new file mode 100644 index 000000000000..6bbfd126dffd --- /dev/null +++ b/sys-fs/mdadm/files/64-md-raid.rules-2.6.3-r2 @@ -0,0 +1,18 @@ +# md links hook into "change" events, when the array becomes available + +SUBSYSTEM!="block", GOTO="md_end" +KERNEL!="md[0-9]*", GOTO="md_end" +ACTION!="add|change", GOTO="md_end" + +ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" + +IMPORT{program}="/sbin/mdadm --detail --export $tempnode" +ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}" +ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}" + +IMPORT{program}="vol_id --export $tempnode" +OPTIONS="link_priority=100" +ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" +ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" + +LABEL="md_end" diff --git a/sys-fs/mdadm/files/digest-mdadm-2.6.3-r2 b/sys-fs/mdadm/files/digest-mdadm-2.6.3-r2 new file mode 100644 index 000000000000..53e49f8e561a --- /dev/null +++ b/sys-fs/mdadm/files/digest-mdadm-2.6.3-r2 @@ -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/raid-start.sh-2.6.3-r2 b/sys-fs/mdadm/files/raid-start.sh-2.6.3-r2 new file mode 100644 index 000000000000..0f8060df93b8 --- /dev/null +++ b/sys-fs/mdadm/files/raid-start.sh-2.6.3-r2 @@ -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-r2,v 1.1 2007/10/03 11:58:45 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="$(find /dev -maxdepth 1 -name 'md_d*')" +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 diff --git a/sys-fs/mdadm/files/raid-stop.sh-2.6.3-r2 b/sys-fs/mdadm/files/raid-stop.sh-2.6.3-r2 new file mode 100644 index 000000000000..b76e56ac4e29 --- /dev/null +++ b/sys-fs/mdadm/files/raid-stop.sh-2.6.3-r2 @@ -0,0 +1,19 @@ +# /lib/rcscripts/addons/raid-stop.sh: Stop raid volumes at shutdown +# 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-stop.sh-2.6.3-r2,v 1.1 2007/10/03 11:58:45 robbat2 Exp $ + +[ -f /proc/mdstat ] || exit 0 + +# Stop 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 + ebegin "Shutting down RAID devices (mdadm)" + output=$(mdadm -Ss 2>&1) + ret=$? + [ ${ret} -ne 0 ] && echo "${output}" + eend ${ret} +fi + +# vim:ts=4 |