2008-07-24 23:06:32 +02:00
|
|
|
#!/bin/bash
|
|
|
|
#%stage: crypto
|
|
|
|
#%programs: /sbin/cryptsetup
|
|
|
|
#%udevmodules: dm-crypt $cryptmodules
|
|
|
|
#%if: "$root_luks" -o "$luks"
|
|
|
|
#
|
|
|
|
##### LUKS (comfortable disk encryption)
|
|
|
|
##
|
|
|
|
## This activates a LUKS encrypted partition.
|
|
|
|
##
|
|
|
|
## Command line parameters
|
|
|
|
## -----------------------
|
|
|
|
##
|
|
|
|
## luks a list of luks devices (e.g. xxx)
|
|
|
|
## luks_xxx the luks device (e.g. /dev/sda)
|
|
|
|
##
|
|
|
|
|
|
|
|
case $luks_lang in
|
|
|
|
en*)
|
2009-02-26 12:48:36 +01:00
|
|
|
# We only support english keyboard layout
|
2008-07-24 23:06:32 +02:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Only english keyboard layout supported."
|
|
|
|
echo "Please ensure that the password is typed correctly."
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2009-02-26 12:48:36 +01:00
|
|
|
echo
|
|
|
|
echo -n "Enter LUKS Passphrase:"
|
|
|
|
read -s pass
|
|
|
|
echo
|
|
|
|
|
2008-07-24 23:06:32 +02:00
|
|
|
for curluks in $luks; do
|
2009-02-26 12:48:36 +01:00
|
|
|
echo $pass | /sbin/cryptsetup luksOpen $(eval echo \$luks_${curluks}) $curluks || \
|
|
|
|
/sbin/cryptsetup luksOpen $(eval echo \$luks_${curluks}) $curluks
|
2008-07-24 23:06:32 +02:00
|
|
|
done
|
2009-02-26 12:48:36 +01:00
|
|
|
|
|
|
|
pass='xxxxxxxxxxxxxxxxxxxx'
|
|
|
|
unset pass
|
|
|
|
|