1 |
vapier 08/02/26 07:18:43 |
2 |
|
3 |
Added: raid-start.sh-2.6.4 |
4 |
Log: |
5 |
Fix extra /dev prefixes being added #211167. |
6 |
(Portage version: 2.2_pre2, RepoMan options: --force) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 sys-fs/mdadm/files/raid-start.sh-2.6.4 |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/mdadm/files/raid-start.sh-2.6.4?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/mdadm/files/raid-start.sh-2.6.4?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: raid-start.sh-2.6.4 |
15 |
=================================================================== |
16 |
# /lib/rcscripts/addons/raid-start.sh: Setup raid volumes at boot |
17 |
# Copyright 1999-2008 Gentoo Foundation |
18 |
# Distributed under the terms of the GNU General Public License v2 |
19 |
# $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 $ |
20 |
|
21 |
[ -f /proc/mdstat ] || exit 0 |
22 |
|
23 |
# We could make this dynamic, but eh |
24 |
#[ -z ${MAJOR} ] && export MAJOR=$(awk '$2 == "md" { print $1 }' /proc/devices) |
25 |
MAJOR=9 |
26 |
|
27 |
# Try to make sure the devices exist before we use them |
28 |
create_devs() { |
29 |
local node dir minor |
30 |
for node in "$@" ; do |
31 |
[ "${node#/dev}" = "${node}" ] && node="/dev/${node}" |
32 |
[ -e "${node}" ] && continue |
33 |
|
34 |
dir=${node%/*} |
35 |
[ ! -d "${dir}" ] && mkdir -p "${dir}" |
36 |
|
37 |
minor=${node##*/} |
38 |
mknod "${node}" b ${MAJOR} "${minor##*md}" |
39 |
done |
40 |
} |
41 |
|
42 |
# Start software raid with mdadm (new school) |
43 |
mdadm_conf="/etc/mdadm/mdadm.conf" |
44 |
[ -e /etc/mdadm.conf ] && mdadm_conf="/etc/mdadm.conf" |
45 |
if [ -x /sbin/mdadm -a -f "${mdadm_conf}" ] ; then |
46 |
devs=$(awk '/^[[:space:]]*ARRAY/ { print $2 }' "${mdadm_conf}") |
47 |
if [ -n "${devs}" ]; then |
48 |
ebegin "Starting up RAID devices" |
49 |
create_devs ${devs} |
50 |
output=$(mdadm -As 2>&1) |
51 |
ret=$? |
52 |
[ ${ret} -ne 0 ] && echo "${output}" |
53 |
eend ${ret} |
54 |
fi |
55 |
fi |
56 |
|
57 |
partitioned_devs=$(ls /dev/md_d* 2>/dev/null) |
58 |
if [ -n "${partitioned_devs}" ]; then |
59 |
ebegin "Creating RAID device partitions" |
60 |
/sbin/blockdev ${partitioned_devs} |
61 |
eend 0 |
62 |
# wait because vgscan runs next, and we want udev to fire |
63 |
sleep 1 |
64 |
fi |
65 |
|
66 |
# vim:ts=4 |
67 |
|
68 |
|
69 |
|
70 |
-- |
71 |
gentoo-commits@l.g.o mailing list |