summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-02-26 07:18:42 +0000
committerMike Frysinger <vapier@gentoo.org>2008-02-26 07:18:42 +0000
commitd461d4b744b04c173ad32349b9ec1be4874d00d3 (patch)
tree6a11524ac4b3b3cdbe045c693629cacc7e101c4b /sys-fs/mdadm/files
parentRemoved vulnerable version (sec issue #209133) (diff)
downloadgentoo-2-d461d4b744b04c173ad32349b9ec1be4874d00d3.tar.gz
gentoo-2-d461d4b744b04c173ad32349b9ec1be4874d00d3.tar.bz2
gentoo-2-d461d4b744b04c173ad32349b9ec1be4874d00d3.zip
Fix extra /dev prefixes being added #211167.
(Portage version: 2.2_pre2, RepoMan options: --force)
Diffstat (limited to 'sys-fs/mdadm/files')
-rw-r--r--sys-fs/mdadm/files/raid-start.sh-2.6.451
1 files changed, 51 insertions, 0 deletions
diff --git a/sys-fs/mdadm/files/raid-start.sh-2.6.4 b/sys-fs/mdadm/files/raid-start.sh-2.6.4
new file mode 100644
index 000000000000..e931f9947c8e
--- /dev/null
+++ b/sys-fs/mdadm/files/raid-start.sh-2.6.4
@@ -0,0 +1,51 @@
+# /lib/rcscripts/addons/raid-start.sh: Setup raid volumes at boot
+# Copyright 1999-2008 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.4,v 1.1 2008/02/26 07:18:42 vapier 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}"
+ 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
+ ebegin "Starting up RAID devices"
+ create_devs ${devs}
+ 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