|
|
rmdir ${mntrem} 2>/dev/null >/dev/null | rmdir ${mntrem} 2>/dev/null >/dev/null |
einfo "Cannot find ${key} on removable media." | einfo "Cannot find ${key} on removable media." |
echo -n -e " ${green}*${off} Abort?(${red}yes${off}/${green}no${off})" >/dev/console | echo -n -e " ${green}*${off} Abort?(${red}yes${off}/${green}no${off})" >/dev/console |
read ans </dev/console |
read ${read_timeout} ans </dev/console |
echo >/dev/console | echo >/dev/console |
[ "$ans" != "yes" ] && { i=0; c=0; } || return |
[ "$ans" = "no" ] && { i=0; c=0; } || return |
else | else |
key="${mntrem}${key}" | key="${mntrem}${key}" |
break | break |
|
|
rmdir ${mntrem} 2>/dev/null >/dev/null | rmdir ${mntrem} 2>/dev/null >/dev/null |
einfo "Removable device for ${target} not present." | einfo "Removable device for ${target} not present." |
echo -n -e " ${green}*${off} Abort?(${red}yes${off}/${green}no${off})" >/dev/console | echo -n -e " ${green}*${off} Abort?(${red}yes${off}/${green}no${off})" >/dev/console |
read ans </dev/console |
read ${read_timeout} ans </dev/console |
echo >/dev/console | echo >/dev/console |
[ "$ans" != "yes" ] && { i=0; c=0; } || return |
[ "$ans" = "no" ] && { i=0; c=0; } || return |
fi | fi |
fi | fi |
done | done |
|
|
fi | fi |
} | } |
| |
|
# Determine string lengths |
|
strlen() { |
|
if [ -z "$1" ] |
|
then |
|
echo "usage: strlen <variable_name>" |
|
die |
|
fi |
|
eval echo "\${#${1}}" |
|
} |
|
|
|
# Lookup optional bootparams |
|
parse_opt() { |
|
case "$1" in |
|
*\=*) |
|
local key_name="`echo "$1" | cut -f1 -d=`" |
|
local key_len=`strlen key_name` |
|
local value_start=$((key_len+2)) |
|
echo "$1" | cut -c ${value_start}- |
|
;; |
|
esac |
|
} |
|
|
local cryptfs_status=0 | local cryptfs_status=0 |
local gpg_options key loop_file target targetline options pre_mount post_mount source swap remdev | local gpg_options key loop_file target targetline options pre_mount post_mount source swap remdev |
| |
|
CMDLINE="`cat /proc/cmdline`" |
|
for x in ${CMDLINE} |
|
do |
|
case "${x}" in |
|
key_timeout\=*) |
|
KEY_TIMEOUT=`parse_opt "${x}"` |
|
if [ ${KEY_TIMEOUT} -gt 0 ]; then |
|
read_timeout="-t ${KEY_TIMEOUT}" |
|
fi |
|
;; |
|
esac |
|
done |
|
|
if [[ -f /etc/conf.d/cryptfs ]] && [[ -x /bin/cryptsetup ]] ; then | if [[ -f /etc/conf.d/cryptfs ]] && [[ -x /bin/cryptsetup ]] ; then |
ebegin "Setting up dm-crypt mappings" | ebegin "Setting up dm-crypt mappings" |
| |