aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d
diff options
context:
space:
mode:
Diffstat (limited to 'rc.d')
-rwxr-xr-xrc.d/rc.sysinit23
1 files changed, 8 insertions, 15 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 3f97da5e..61eb18d8 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -141,6 +141,8 @@ init_crypto() {
elif [ "${src/^\/dev\/disk\/by-uuid\/}" != "$src" ]; then
src=$(__readlink $src)
fi
+ [ -z "$src" ] && continue
+ [ -b "$src" ] || continue
# Parse the options field, convert to cryptsetup parameters
# and contruct the command line
while [ -n "$opt" ]; do
@@ -196,9 +198,9 @@ init_crypto() {
echo "$dst: options are invalid for LUKS partitions," \
"ignoring them"
fi
- /sbin/cryptsetup ${key:+-d $key} luksOpen "$src" "$dst" <&1
+ /sbin/cryptsetup ${key:+-d $key} luksOpen "$src" "$dst" <&1 && success || failure
else
- /sbin/cryptsetup $params ${key:+-d $key} create "$dst" "$src" <&1 2>/dev/null
+ /sbin/cryptsetup $params ${key:+-d $key} create "$dst" "$src" <&1 2>/dev/null && success || failure
fi
rc=$?
if [ $rc -ne 0 ]; then
@@ -314,10 +316,7 @@ mknod /dev/mapper/control c \
[ -n "$SELINUX_STATE" ] && restorecon /dev/mapper /dev/mapper/control >/dev/null 2>&1
if [ -f /etc/crypttab ]; then
- s=$"Starting disk encryption:"
- echo "$s"
- init_crypto 0 && success "$s" || failure "$s"
- echo
+ init_crypto 0
fi
if [ -c /dev/mapper/control ]; then
@@ -326,7 +325,7 @@ if [ -c /dev/mapper/control ]; then
modprobe dm-multipath > /dev/null 2>&1
/sbin/multipath.static -v 0
if [ -x /sbin/kpartx ]; then
- /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a -p p"
+ /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a -p p" >/dev/null
fi
fi
@@ -348,10 +347,7 @@ if [ -c /dev/mapper/control ]; then
fi
if [ -f /etc/crypttab ]; then
- s=$"Starting disk encryption:"
- echo "$s"
- init_crypto 0 && success "$s" || failure "$s"
- echo
+ init_crypto 0
fi
if [ -f /fastboot ] || strstr "$cmdline" fastboot ; then
@@ -669,10 +665,7 @@ fi
#[ -x /sbin/rngd -a -c /dev/hw_random ] && rngd
if [ -f /etc/crypttab ]; then
- s=$"Starting disk encryption using the RNG:"
- echo "$s"
- init_crypto 1 && success "$s" || failure "$s"
- echo
+ init_crypto 1
fi
# Configure machine if necessary.