.TP
.B rd_LUKS_UUID=<luks uuid>
only activate the LUKS partitions with the given UUID
+.B rd_NO_CRYPTTAB
+do not check if LUKS partition is in /etc/crypttab
.SH MD
.TP
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
. /lib/dracut-lib.sh
+
+luksname=$2
+
+if [ -f /etc/crypttab ] && ! getargs rd_NO_CRYPTTAB; then
+ found=0
+ while read name dev rest; do
+ cdev=$(readlink -f $dev)
+ mdev=$(readlink -f $1)
+ if [ "$cdev" = "$mdev" ]; then
+ luksname="$name"
+ break
+ fi
+ done < /etc/crypttab
+fi
+
LUKS=$(getargs rd_LUKS_UUID=)
ask=1
luuid=${2##luks-}
for luks in $LUKS; do
luks=${luks##luks-}
- if [ "${luuid##$luks}" != "$luuid" ]; then
+ if [ "${luuid##$luks}" != "$luuid" ] || [ "$luksname" == "$luks" ]; then
ask=1
+ break
fi
done
fi
{ flock -s 9;
/bin/plymouth ask-for-password \
--prompt "$1 is password protected" \
- --command="/sbin/cryptsetup luksOpen -T1 $1 $2"
+ --command="/sbin/cryptsetup luksOpen -T1 $1 $luksname"
} 9>/.console.lock
fi
inst_hook pre-trigger 10 "$moddir"/plymouth-pretrigger.sh
inst_hook emergency 50 "$moddir"/plymouth-emergency.sh
inst "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
+inst readlink
\ No newline at end of file
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
. /lib/dracut-lib.sh
+
+luksname=$2
+if [ -f /etc/crypttab ] && ! getargs rd_NO_CRYPTTAB; then
+ found=0
+ while read name dev rest; do
+ cdev=$(readlink -f $dev)
+ mdev=$(readlink -f $1)
+ if [ "$cdev" = "$mdev" ]; then
+ luksname="$name"
+ break
+ fi
+ done < /etc/crypttab
+fi
+
LUKS=$(getargs rd_LUKS_UUID=)
ask=1
luuid=${2##luks-}
for luks in $LUKS; do
luks=${luks##luks-}
- if [ "${luuid##$luks}" != "$luuid" ]; then
+ if [ "${luuid##$luks}" != "$luuid" ] || [ "$luksname" == "$luks" ]; then
ask=1
+ break
fi
done
fi
# flock against other interactive activities
{ flock -s 9;
echo -n "$1 is password protected "
- /sbin/cryptsetup luksOpen -T1 $1 $2
+ /sbin/cryptsetup luksOpen -T1 $1 $luksname
} 9>/.console.lock
fi
inst_hook pre-pivot 30 "$moddir/crypt-cleanup.sh"
inst_hook pre-pivot 31 "$moddir/crypt-cleanup.sh"
inst_rules 10-dm.rules 95-dm-notify.rules
+inst /etc/crypttab