#!/usr/bin/ash run_hook() { modprobe -a -q dm-crypt >/dev/null 2>&1 if [ -n "${cryptdevice}" ]; then DEPRECATED_CRYPT=0 IFS=: read cryptdev cryptname </dev/null 2>&1; then [ ${DEPRECATED_CRYPT} -eq 1 ] && warn_deprecated dopassphrase=1 # Ask for a passphrase if [ ${dopassphrase} -gt 0 ]; then echo "" echo "A password is required to access the ${cryptname} volume" #loop until we get a real password while ! [ -b "/dev/mapper/${cryptname}" ]; do unl0kr | cryptsetup open "${cryptdev}" "${cryptname}" export CRYPTTAB_TRIED=1 done fi if [ -e "/dev/mapper/${cryptname}" ]; then if [ ${DEPRECATED_CRYPT} -eq 1 ]; then export root="/dev/mapper/root" fi else err "Password succeeded, but ${cryptname} creation failed, aborting..." return 1 fi else err "Failed to open encryption mapping: The device ${cryptdev} is not a LUKS volume." fi fi }