]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Cryptroot-ask.sh: Remove duplicate code
authorTill Maas <opensource@till.name>
Sun, 9 Feb 2014 15:17:03 +0000 (16:17 +0100)
committerHarald Hoyer <harald@redhat.com>
Mon, 10 Feb 2014 10:02:32 +0000 (11:02 +0100)
Remove duplicate code introduced with commit
9b5e2e8574577cd4ec1e3645255060f749490537.

modules.d/90crypt/cryptroot-ask.sh

index 1c3e792b042c9e0ddf1087c4d4af315ad72909c9..2c8bba0662a820a376e38e24dd6538d13ae08891 100755 (executable)
@@ -10,24 +10,6 @@ NEWROOT=${NEWROOT:-"/sysroot"}
 
 . /lib/dracut-lib.sh
 
-# default luksname - luks-UUID
-luksname=$2
-
-# check if destination already exists
-[ -b /dev/mapper/luksname ] && exit 0
-
-# we already asked for this device
-asked_file=/tmp/cryptroot-asked-$luksname
-[ -f $asked_file ] && exit 0
-
-# load dm_crypt if it is not already loaded
-[ -d /sys/module/dm_crypt ] || modprobe dm_crypt
-
-. /lib/dracut-crypt-lib.sh
-
-# fallback to passphrase
-ask_passphrase=1
-
 # if device name is /dev/dm-X, convert to /dev/mapper/name
 if [ "${1##/dev/dm-}" != "$1" ]; then
     device="/dev/mapper/$(dmsetup info -c --noheadings -o name "$1")"
@@ -73,7 +55,8 @@ fi
 [ -b /dev/mapper/$luksname ] && exit 0
 
 # we already asked for this device
-[ -f /tmp/cryptroot-asked-$luksname ] && exit 0
+asked_file=/tmp/cryptroot-asked-$luksname
+[ -f $asked_file ] && exit 0
 
 # load dm_crypt if it is not already loaded
 [ -d /sys/module/dm_crypt ] || modprobe dm_crypt