summaryrefslogtreecommitdiff
path: root/sys-fs
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@gentoo.org>2007-05-21 14:09:47 +0000
committerDoug Goldstein <cardoe@gentoo.org>2007-05-21 14:09:47 +0000
commitd04acb993b2936871c86b14dca75026f85b5d2ad (patch)
tree9946aef3fff47b8c939ebf6b6e7fce9ad7c52e19 /sys-fs
parentRemove old (diff)
downloadhistorical-d04acb993b2936871c86b14dca75026f85b5d2ad.tar.gz
historical-d04acb993b2936871c86b14dca75026f85b5d2ad.tar.bz2
historical-d04acb993b2936871c86b14dca75026f85b5d2ad.zip
de-bash-ification by Uberlord
Package-Manager: portage-2.1.2.7
Diffstat (limited to 'sys-fs')
-rw-r--r--sys-fs/device-mapper/ChangeLog5
-rw-r--r--sys-fs/device-mapper/files/dm-start.sh26
-rw-r--r--sys-fs/lvm2/ChangeLog5
-rwxr-xr-xsys-fs/lvm2/files/lvm2-start.sh27
4 files changed, 36 insertions, 27 deletions
diff --git a/sys-fs/device-mapper/ChangeLog b/sys-fs/device-mapper/ChangeLog
index 5246493a2993..0ca9300521ce 100644
--- a/sys-fs/device-mapper/ChangeLog
+++ b/sys-fs/device-mapper/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for sys-fs/device-mapper
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/device-mapper/ChangeLog,v 1.62 2007/05/14 08:48:42 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/device-mapper/ChangeLog,v 1.63 2007/05/21 14:05:37 cardoe Exp $
+
+ 21 May 2007; Doug Goldstein <cardoe@gentoo.org> files/dm-start.sh:
+ de-bash-ification by Uberlord
*device-mapper-1.02.19 (14 May 2007)
diff --git a/sys-fs/device-mapper/files/dm-start.sh b/sys-fs/device-mapper/files/dm-start.sh
index 01b056165d84..d3d0287b2f58 100644
--- a/sys-fs/device-mapper/files/dm-start.sh
+++ b/sys-fs/device-mapper/files/dm-start.sh
@@ -1,5 +1,5 @@
# /lib/rcscripts/addons/dm-start.sh: Setup DM volumes at boot
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/device-mapper/files/dm-start.sh,v 1.3 2006/11/01 19:02:56 dsd Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/device-mapper/files/dm-start.sh,v 1.4 2007/05/21 14:05:37 cardoe Exp $
# char **get_new_dm_volumes(void)
#
@@ -25,14 +25,14 @@ get_new_dm_volumes() {
dmvolume_exists() {
local x line volume=$1
- [[ -z ${volume} ]] && return 1
+ [ -z "${volume}" ] && return 1
/sbin/dmsetup ls 2>/dev/null | \
while read line ; do
for x in ${line} ; do
# the following conditonal return only breaks out
# of the while loop, as it is running in a pipe.
- [[ ${x} == "${volume}" ]] && return 1
+ [ "${x}" = "${volume}" ] && return 1
# We only want to check the volume name
break
done
@@ -40,7 +40,7 @@ dmvolume_exists() {
# if 1 was returned from the above loop, then indicate that
# volume exists
- [[ $? == 1 ]] && return 0
+ [ $? = 1 ] && return 0
# otherwise the loop exited normally and the volume does not
# exist
@@ -53,33 +53,29 @@ dmvolume_exists() {
is_empty_dm_volume() {
local table volume=$1
- table=$(/sbin/dmsetup table 2>/dev/null | grep -e "^${volume}:")
-
- # dmsetup seems to print an space after the colon for the moment
- [[ -n ${table} && -z ${table/${volume}:*} ]] && return 0
-
- return 1
+ set -- $(/sbin/dmsetup table 2>/dev/null | grep -e "^${volume}:")
+ [ "${volume}" = "$1" -a -z "$2" ]
}
local x volume
-if [[ -x /sbin/dmsetup && -c /dev/mapper/control && -f /etc/dmtab ]] ; then
- [[ -n $(get_new_dm_volumes) ]] && \
+if [ -x /sbin/dmsetup -a -c /dev/mapper/control -a -f /etc/dmtab ] ; then
+ [ -n "$(get_new_dm_volumes)" ] && \
einfo " Setting up device-mapper volumes:"
get_new_dm_volumes | \
while read x ; do
- [[ -n ${x} ]] || continue
+ [ -n "${x}" ] || continue
volume="${x##* }"
ebegin " Creating volume: ${volume}"
- if ! eval ${x} &>/dev/null ; then
+ if ! eval "${x}" >/dev/null 2>/dev/null ; then
eend 1 " Error creating volume: ${volume}"
# dmsetup still adds an empty volume in some cases,
# so lets remove it
is_empty_dm_volume "${volume}" && \
- /sbin/dmsetup remove "${volume}" &>/dev/null
+ /sbin/dmsetup remove "${volume}" 2>/dev/null
else
eend 0
fi
diff --git a/sys-fs/lvm2/ChangeLog b/sys-fs/lvm2/ChangeLog
index bc23d4feb4b9..7a158cf7bfcc 100644
--- a/sys-fs/lvm2/ChangeLog
+++ b/sys-fs/lvm2/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for sys-fs/lvm2
# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/ChangeLog,v 1.100 2007/05/16 04:43:54 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/ChangeLog,v 1.101 2007/05/21 14:09:47 cardoe Exp $
+
+ 21 May 2007; Doug Goldstein <cardoe@gentoo.org> files/lvm2-start.sh:
+ de-bash-ification by Uberlord
16 May 2007; Jeroen Roovers <jer@gentoo.org> lvm2-2.02.10.ebuild:
Stable for HPPA (bug #158794).
diff --git a/sys-fs/lvm2/files/lvm2-start.sh b/sys-fs/lvm2/files/lvm2-start.sh
index f3f0cca03a14..7fb6c9aa9af7 100755
--- a/sys-fs/lvm2/files/lvm2-start.sh
+++ b/sys-fs/lvm2/files/lvm2-start.sh
@@ -1,25 +1,32 @@
# /lib/rcscripts/addons/lvm2-start.sh
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm2-start.sh,v 1.4 2005/06/18 06:42:42 rocket Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/lvm2-start.sh,v 1.5 2007/05/21 14:09:47 cardoe Exp $
+
+dm_in_proc() {
+ local retval=0
+ for x in devices misc ; do
+ grep -qs 'device-mapper' /proc/${x}
+ retval=$((${retval} + $?))
+ done
+ return ${retval}
+}
# LVM support for /usr, /home, /opt ....
# This should be done *before* checking local
# volumes, or they never get checked.
-
+
# NOTE: Add needed modules for LVM or RAID, etc
# to /etc/modules.autoload if needed
-if [[ -z ${CDBOOT} ]] && [[ -x /sbin/vgscan ]] ; then
- if [[ -e /proc/modules ]] && \
- ! grep -qs 'device-mapper' /proc/{devices,misc}
- then
- modprobe dm-mod &>/dev/null
+if [ -z "${CDBOOT}" -a -x /sbin/vgscan ] ; then
+ if [ -e /proc/modules ] && ! dm_in_proc ; then
+ modprobe dm-mod 2>/dev/null
fi
- if [[ -d /proc/lvm ]] || grep -qs 'device-mapper' /proc/{devices,misc} ; then
+ if [ -d /proc/lvm ] || dm_in_proc ; then
ebegin "Setting up the Logical Volume Manager"
#still echo stderr for debugging
/sbin/vgscan --mknodes --ignorelockingfailure >/dev/null
- if [[ $? == 0 ]] && [[ -x /sbin/vgchange ]] && \
- [[ -f /etc/lvmtab || -d /etc/lvm ]]
+ if [ $? = 0 -a -x /sbin/vgchange ] && \
+ [ -f /etc/lvmtab -o -d /etc/lvm ]
then
/sbin/vgchange --ignorelockingfailure -a y >/dev/null
fi