summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-06-10 02:09:51 +0000
committerMike Frysinger <vapier@gentoo.org>2005-06-10 02:09:51 +0000
commite5ff5c7b3dcbbb157723502cfac48ec11f5e381a (patch)
treef7721d95863b170e06487c843da2db9d283eae05 /sys-fs/mdadm
parentMask media-video/dirac (diff)
downloadgentoo-2-e5ff5c7b3dcbbb157723502cfac48ec11f5e381a.tar.gz
gentoo-2-e5ff5c7b3dcbbb157723502cfac48ec11f5e381a.tar.bz2
gentoo-2-e5ff5c7b3dcbbb157723502cfac48ec11f5e381a.zip
Tweak device node creation to handle subpaths #95593 by Milan Holz�pfel.
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'sys-fs/mdadm')
-rw-r--r--sys-fs/mdadm/ChangeLog5
-rwxr-xr-xsys-fs/mdadm/files/raid-start.sh17
2 files changed, 15 insertions, 7 deletions
diff --git a/sys-fs/mdadm/ChangeLog b/sys-fs/mdadm/ChangeLog
index dd27f5cd2fd1..ab8e09575bb8 100644
--- a/sys-fs/mdadm/ChangeLog
+++ b/sys-fs/mdadm/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for sys-fs/mdadm
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/mdadm/ChangeLog,v 1.6 2005/06/10 01:35:55 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/mdadm/ChangeLog,v 1.7 2005/06/10 02:09:28 vapier Exp $
+
+ 10 Jun 2005; Mike Frysinger <vapier@gentoo.org> files/raid-start.sh:
+ Tweak device node creation to handle subpaths #95593 by Milan Holz�pfel.
10 Jun 2005; Mike Frysinger <vapier@gentoo.org> +files/raid-stop.sh,
mdadm-1.9.0-r1.ebuild, mdadm-1.11.0.ebuild:
diff --git a/sys-fs/mdadm/files/raid-start.sh b/sys-fs/mdadm/files/raid-start.sh
index d2e35eaafa21..47dfeffb2425 100755
--- a/sys-fs/mdadm/files/raid-start.sh
+++ b/sys-fs/mdadm/files/raid-start.sh
@@ -1,7 +1,7 @@
# /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,v 1.3 2005/05/19 22:15:51 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/mdadm/files/raid-start.sh,v 1.4 2005/06/10 02:09:28 vapier Exp $
[[ -f /proc/mdstat ]] || exit 0
@@ -11,11 +11,16 @@ MAJOR=9
# Try to make sure the devices exist before we use them
create_devs() {
- local d
- for d in $@ ; do
- d=${d/\/dev\/}
- [[ -e /dev/${d} ]] && continue
- mknod /dev/${d} b ${MAJOR} ${d##*md} >& /dev/null
+ local node dir minor
+ for node in $@ ; do
+ [[ ${node} != /dev/* ]] && node=/dev/${node}
+ [[ -e ${node} ]] && continue
+
+ dir=${node%/*}
+ [[ ! -d ${dir} ]] && mkdir -p "${dir}"
+
+ minor=${node##*/}
+ mknod "${node}" b ${MAJOR} ${minor##*md} &> /dev/null
done
}