summaryrefslogtreecommitdiff
path: root/sys-fs
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-05-20 03:54:02 +0000
committerMike Frysinger <vapier@gentoo.org>2005-05-20 03:54:02 +0000
commit1e21a458692991f40c80e382f18941b165e5c3ad (patch)
treea1a0787431e602b4e6b6ab7d20fe94265d217bfa /sys-fs
parentstabilize (diff)
downloadhistorical-1e21a458692991f40c80e382f18941b165e5c3ad.tar.gz
historical-1e21a458692991f40c80e382f18941b165e5c3ad.tar.bz2
historical-1e21a458692991f40c80e382f18941b165e5c3ad.zip
dont use here documents since it fails with r/o filesystems #93241 by chia.penguin
Package-Manager: portage-2.0.51.22-r1
Diffstat (limited to 'sys-fs')
-rw-r--r--sys-fs/device-mapper/Manifest2
-rw-r--r--sys-fs/device-mapper/files/dm-start.sh30
2 files changed, 17 insertions, 15 deletions
diff --git a/sys-fs/device-mapper/Manifest b/sys-fs/device-mapper/Manifest
index 429043f4a3e4..a643b540a5f8 100644
--- a/sys-fs/device-mapper/Manifest
+++ b/sys-fs/device-mapper/Manifest
@@ -8,5 +8,5 @@ MD5 a60628a7ac701c252155b3f5d32004c4 files/digest-device-mapper-1.00.21 70
MD5 5f73ee137a6bfb893f1ec3a691dbf614 files/digest-device-mapper-1.01.00 70
MD5 3722791187466d3005f5b7f129c3ed7a files/digest-device-mapper-1.00.17-r1 70
MD5 b5dd92354fb75caa4956a92d5aa2e0ea files/digest-device-mapper-1.00.19-r2 70
-MD5 4da8149fc2d10e2e95f680184c3a08d8 files/dm-start.sh 1941
+MD5 ab82e97df1e8ce801b65daa33c8cbfb0 files/dm-start.sh 1935
MD5 aaf96e8a4fd3711078f75fe3fac2072b files/dmtab 426
diff --git a/sys-fs/device-mapper/files/dm-start.sh b/sys-fs/device-mapper/files/dm-start.sh
index 5770ca6a9a17..505bc67fac4d 100644
--- a/sys-fs/device-mapper/files/dm-start.sh
+++ b/sys-fs/device-mapper/files/dm-start.sh
@@ -1,15 +1,15 @@
# /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.1 2005/03/01 22:45:26 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/device-mapper/files/dm-start.sh,v 1.2 2005/05/20 03:54:02 vapier Exp $
# char **get_new_dm_volumes(void)
#
-# Return dmsetup commands to setup volumes
+# Return dmsetup commands to setup volumes
get_new_dm_volumes() {
local volume params
-
+
# Filter comments and blank lines
grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \
- while read volume params; do
+ while read volume params ; do
# If it exists, skip it
dmvolume_exists "${volume%:}" && continue
# Assemble the command to run to create volume
@@ -26,14 +26,15 @@ dmvolume_exists() {
local x line volume=$1
[[ -z ${volume} ]] && return 1
-
- while read line; do
- for x in ${line}; do
+
+ /sbin/dmsetup ls 2>/dev/null | \
+ while read line ; do
+ for x in ${line} ; do
[[ ${x} == "${volume}" ]] && return 0
# We only want to check the volume name
break
done
- done <<<"$(/sbin/dmsetup ls 2>/dev/null)"
+ done
return 1
}
@@ -43,9 +44,9 @@ dmvolume_exists() {
# Return true if the volume exists in DM table, but is empty/non-valid
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
@@ -54,17 +55,18 @@ is_empty_dm_volume() {
local x volume
-if [[ -x /sbin/dmsetup && -c /dev/mapper/control && -f /etc/dmtab ]]; then
+if [[ -x /sbin/dmsetup && -c /dev/mapper/control && -f /etc/dmtab ]] ; then
[[ -n $(get_new_dm_volumes) ]] && \
einfo " Setting up device-mapper volumes:"
- while read x; do
+ get_new_dm_volumes | \
+ while read x ; do
[[ -n ${x} ]] || continue
volume="${x##* }"
ebegin " Creating volume: ${volume}"
- if ! eval ${x} &>/dev/null; then
+ if ! eval ${x} &>/dev/null ; then
eend 1 " Error creating volume: ${volume}"
# dmsetup still adds an empty volume in some cases,
# so lets remove it
@@ -73,7 +75,7 @@ if [[ -x /sbin/dmsetup && -c /dev/mapper/control && -f /etc/dmtab ]]; then
else
eend 0
fi
- done <<< "$(get_new_dm_volumes)"
+ done
fi