summaryrefslogtreecommitdiffstats
path: root/abs/core/cryptsetup/encrypt_hook
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2014-02-16 23:43:39 (GMT)
committerJames Meyer <james.meyer@operamail.com>2014-02-19 19:03:02 (GMT)
commit798be4135a1867350244b32359bf7fbd9ae1f091 (patch)
tree12f4e30c3ea5f08c8f4a6f3e2990b322458a12b6 /abs/core/cryptsetup/encrypt_hook
parent0c22271a585e48d1e9cea35f3b0a962dd15b72b0 (diff)
downloadlinhes_pkgbuild-798be4135a1867350244b32359bf7fbd9ae1f091.zip
linhes_pkgbuild-798be4135a1867350244b32359bf7fbd9ae1f091.tar.gz
linhes_pkgbuild-798be4135a1867350244b32359bf7fbd9ae1f091.tar.bz2
cryptsetup: 1.6.3
update binary path to /usr/bin refs #961
Diffstat (limited to 'abs/core/cryptsetup/encrypt_hook')
-rw-r--r--abs/core/cryptsetup/encrypt_hook11
1 files changed, 6 insertions, 5 deletions
diff --git a/abs/core/cryptsetup/encrypt_hook b/abs/core/cryptsetup/encrypt_hook
index 372b7ba..819c4cf 100644
--- a/abs/core/cryptsetup/encrypt_hook
+++ b/abs/core/cryptsetup/encrypt_hook
@@ -11,7 +11,9 @@ run_hook() {
$cryptkey
EOF
- if resolved=$(resolve_device "${ckdev}" ${rootdelay}); then
+ if [ "$ckdev" = "rootfs" ]; then
+ ckeyfile=$ckarg1
+ elif resolved=$(resolve_device "${ckdev}" ${rootdelay}); then
case ${ckarg1} in
*[!0-9]*)
# Use a file on the device
@@ -50,7 +52,6 @@ EOF
for cryptopt in ${cryptoptions//,/ }; do
case ${cryptopt} in
allow-discards)
- echo "Enabling TRIM/discard support."
cryptargs="${cryptargs} --allow-discards"
;;
*)
@@ -65,7 +66,7 @@ EOF
dopassphrase=1
# If keyfile exists, try to use that
if [ -f ${ckeyfile} ]; then
- if eval cryptsetup --key-file ${ckeyfile} luksOpen ${resolved} ${cryptname} ${cryptargs} ${CSQUIET}; then
+ if eval cryptsetup --key-file ${ckeyfile} open --type luks ${resolved} ${cryptname} ${cryptargs} ${CSQUIET}; then
dopassphrase=0
else
echo "Invalid keyfile. Reverting to passphrase."
@@ -77,7 +78,7 @@ EOF
echo "A password is required to access the ${cryptname} volume:"
#loop until we get a real password
- while ! eval cryptsetup luksOpen ${resolved} ${cryptname} ${cryptargs} ${CSQUIET}; do
+ while ! eval cryptsetup open --type luks ${resolved} ${cryptname} ${cryptargs} ${CSQUIET}; do
sleep 2;
done
fi
@@ -97,7 +98,7 @@ EOF
err "Non-LUKS decryption not attempted..."
return 1
fi
- exe="cryptsetup create $cryptname $resolved $cryptargs"
+ exe="cryptsetup open --type plain $resolved $cryptname $cryptargs"
IFS=: read c_hash c_cipher c_keysize c_offset c_skip <<EOF
$crypto
EOF