3 [ -d /sys/module/dm_crypt ] || modprobe dm_crypt
5 [ -f /tmp/reencrypted ] && exit 0
9 # if device name is /dev/dm-X, convert to /dev/mapper/name
10 if [ "${1##/dev/dm-}" != "$1" ]; then
11 device="/dev/mapper/$(dmsetup info -c --noheadings -o name "$1")"
16 PARAMS="$device -T 1 --use-fsync -B 32"
18 PARAMS="$PARAMS --device-size $2"
21 info "REENCRYPT $device requested"
22 # flock against other interactive activities
26 /bin/plymouth ask-for-password --prompt "LUKS password for REENCRYPTING $device" \
27 --command="/sbin/cryptsetup-reencrypt $PARAMS"