From 66fc2646834cb7cd77837e0e4eb0ea1e2c2ebcbc Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 17 Oct 2008 16:25:47 -0400 Subject: Don't set up a device that's already a device-mapper slave. It's possible the initrd set the device up under a different LUKS name. --- rc.d/rc.sysinit | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index b57d2bc3..e1658315 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -158,8 +158,12 @@ init_crypto() { elif [ "${src/^\/dev\/disk\/by-uuid\/}" != "$src" ]; then src=$(__readlink $src) fi + # Does it exist? [ -z "$src" ] && continue + # Is it a block device? [ -b "$src" ] || continue + # Is it already a device mapper slave? (this is gross) + [[ " $(ls /sys/block/dm-*/slaves) " =~ " ${src##/dev/} " ]] && continue # Parse the options field, convert to cryptsetup parameters # and contruct the command line while [ -n "$opt" ]; do -- cgit v1.2.1