aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2008-11-05 11:05:55 -0500
committerBill Nottingham <notting@redhat.com>2008-11-05 11:05:55 -0500
commitdc6f9db8bdf6292ca303369d2f5bc2398fb2610f (patch)
treee1265b5e3b3c45900a8ee903561a88eaa72ccc1d
parent7f91b1d8a4c50052c1698b1fe2aea4d85cef319e (diff)
downloadinitscripts-dc6f9db8bdf6292ca303369d2f5bc2398fb2610f.tar
initscripts-dc6f9db8bdf6292ca303369d2f5bc2398fb2610f.tar.gz
initscripts-dc6f9db8bdf6292ca303369d2f5bc2398fb2610f.tar.bz2
initscripts-dc6f9db8bdf6292ca303369d2f5bc2398fb2610f.tar.xz
initscripts-dc6f9db8bdf6292ca303369d2f5bc2398fb2610f.zip
blkid has a -l option to pick a single device. Use it. (#470027)
Notably, it prioritizes RAID/DM/LVM, etc. over the underlying block devices. Given that initial RAID0 members share a UUID with the RAID device itself, we need that.
-rwxr-xr-xrc.d/rc.sysinit8
1 files changed, 4 insertions, 4 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 5d9a710d..df911805 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -154,7 +154,7 @@ init_crypto() {
skip=""
# Parse the src field for UUID= and convert to real device names
if [ "${src%%=*}" == "UUID" ]; then
- src=`/sbin/blkid -t "$src" -o device|(read oneline;echo $oneline)`
+ src=$(/sbin/blkid -t "$src" -l -o device)
elif [ "${src/^\/dev\/disk\/by-uuid\/}" != "$src" ]; then
src=$(__readlink $src)
fi
@@ -454,7 +454,7 @@ if [ "$READONLY" = "yes" -o "$TEMPORARY_STATE" = "yes" ]; then
mountopts=
# Scan partitions for local scratch storage
- rw_mount_dev=$(blkid -t LABEL="$RW_LABEL" -o device | awk '{ print ; exit }')
+ rw_mount_dev=$(blkid -t LABEL="$RW_LABEL" -l -o device)
# First try to mount scratch storage from /etc/fstab, then any
# partition with the proper label. If either succeeds, be sure
@@ -511,7 +511,7 @@ if [ "$READONLY" = "yes" -o "$TEMPORARY_STATE" = "yes" ]; then
# First try to mount persistent data from /etc/fstab, then any
# partition with the proper label, then fallback to NFS
- state_mount_dev=$(blkid -t LABEL="$STATE_LABEL" -o device | awk '{ print ; exit }')
+ state_mount_dev=$(blkid -t LABEL="$STATE_LABEL" -l -o device)
if mount $mountopts $STATE_OPTIONS "$STATE_MOUNT" > /dev/null 2>&1 ; then
/bin/true
elif [ x$state_mount_dev != x ] && mount $state_mount_dev $mountopts "$STATE_MOUNT" > /dev/null 2>&1; then
@@ -787,7 +787,7 @@ update_boot_stage RCswap
action $"Enabling /etc/fstab swaps: " swapon -a -e
if [ "$AUTOSWAP" = "yes" ]; then
curswap=$(awk '/^\/dev/ { print $1 }' /proc/swaps | while read x; do get_numeric_dev dec $x ; echo -n " "; done)
- swappartitions=`blkid -t TYPE=swap -o device`
+ swappartitions=$(blkid -t TYPE=swap -o device)
if [ x"$swappartitions" != x ]; then
for partition in $swappartitions ; do
[ ! -e $partition ] && continue