Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 138535 Details for
Bug 202364
cryptsetup init.d start timeouts suck
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
dm-crypt-start-timeout.patch
dm-crypt-start-timeout.patch (text/plain), 2.52 KB, created by
SpanKY
on 2007-12-15 09:05:12 UTC
(
hide
)
Description:
dm-crypt-start-timeout.patch
Filename:
MIME Type:
Creator:
SpanKY
Created:
2007-12-15 09:05:12 UTC
Size:
2.52 KB
patch
obsolete
>--- /usr/portage/sys-fs/cryptsetup/files/1.0.5-dm-crypt-start.sh 2007-10-02 12:07:39.000000000 -0400 >+++ /lib/rcscripts/addons/dm-crypt-start.sh 2007-12-15 03:57:09.000000000 -0500 >@@ -59,8 +59,26 @@ > return > fi > splash svc_input_begin ${SVCNAME} >/dev/null 2>&1 >+ > # Handle keys > if [ -n "$key" ]; then >+ read_abort() { >+ local ans >+ local prompt=" ${green}*${off} $1? (${red}yes${off}/${green}No${off}) " >+ shift >+ echo -n -e "${prompt}" >/dev/console >+ if ! read -n 1 $* ans </dev/console ; then >+ local back=${prompt//?/\\b} >+ echo -n -e "${back}" >/dev/console >+ else >+ echo >/dev/console >+ fi >+ case $ans in >+ [yY]|[yY][eE][sS]) return 0;; >+ *) return 1;; >+ esac >+ } >+ > # Notes: sed not used to avoid case where /usr partition is encrypted. > mode=${key/*:/} && ( [ "$mode" == "$key" ] || [ -z "$mode" ] ) && mode=reg > key=${key/:*/} >@@ -70,21 +88,20 @@ > if [ -n "$remdev" ]; then > # temp directory to mount removable device > local mntrem=/mnt/remdev >- local c=0 ans >+ local c=0 > for (( i = 0 ; i < 10 ; i++ )) > do > [ ! -d "$mntrem" ] && mkdir -p ${mntrem} 2>/dev/null >/dev/null > if mount -n -o ro ${remdev} ${mntrem} 2>/dev/null >/dev/null ; then >- sleep 2 >+ read_abort "Stop waiting after $i attempts" -t 1 && return > # keyfile exists? > if [ ! -e "${mntrem}${key}" ]; then > umount -n ${mntrem} 2>/dev/null >/dev/null > rmdir ${mntrem} 2>/dev/null >/dev/null > einfo "Cannot find ${key} on removable media." >- echo -n -e " ${green}*${off} Abort?(${red}yes${off}/${green}no${off})" >/dev/console >- read ${read_timeout} ans </dev/console >- echo >/dev/console >- [ "$ans" = "no" ] && { i=0; c=0; } || return >+ read_abort "Abort" ${read_timeout} && return >+ i=0 >+ c=0 > else > key="${mntrem}${key}" > break >@@ -92,15 +109,14 @@ > else > [ "$c" -eq 0 ] && einfo "Please insert removable device for ${target}" > c=1 >- sleep 2 >+ read_abort "Stop waiting after $i attempts" -t 1 && return > # let user abort > if [ "$i" -eq 9 ]; then > rmdir ${mntrem} 2>/dev/null >/dev/null > einfo "Removable device for ${target} not present." >- echo -n -e " ${green}*${off} Abort?(${red}yes${off}/${green}no${off})" >/dev/console >- read ${read_timeout} ans </dev/console >- echo >/dev/console >- [ "$ans" = "no" ] && { i=0; c=0; } || return >+ read_abort "Abort" ${read_timeout} && return >+ i=0 >+ c=0 > fi > fi > done
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 202364
: 138535