Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 104381 | Differences between
and this patch

Collapse All | Expand All

(-)dm-crypt-start.sh.orig (-3 / +31 lines)
Lines 34-51 Link Here
34
34
35
	splash svc_input_begin checkfs
35
	splash svc_input_begin checkfs
36
	ebegin "dm-crypt map ${target}"
36
	ebegin "dm-crypt map ${target}"
37
	if [[ -z ${key} ]] && [[ -z ${type} ]] ; then
37
	if [[ -z ${key} ]] && [[ -z ${master} ]] && [[ -z ${type} ]] ; then
38
		/bin/cryptsetup ${options} create ${target} ${source} >/dev/console </dev/console
38
		/bin/cryptsetup ${options} create ${target} ${source} >/dev/console </dev/console
39
		ret=$?
39
		ret=$?
40
		eend ${ret} "failure running cryptsetup"
40
		eend ${ret} "failure running cryptsetup"
41
	elif [[ -n ${type} ]] ; then
41
	elif [[ -n ${type} ]] ; then
42
		einfo "/bin/cryptsetup ${options} luksOpen ${source} ${target}" 
42
		einfo "/bin/cryptsetup ${options} luksOpen ${source} ${target}" 
43
		/bin/cryptsetup ${options} luksOpen ${source} ${target} >/dev/console </dev/console
43
		if [[ -z ${master_key} ]] ; then
44
		    /bin/cryptsetup ${options} luksOpen ${source} ${target} >/dev/console </dev/console
44
		#/bin/cryptsetup ${options} luksOpen ${source} ${target} 
45
		#/bin/cryptsetup ${options} luksOpen ${source} ${target} 
46
		else
47
		    echo ${master} | /bin/cryptsetup ${options} luksOpen ${source} ${target} >/dev/console
48
		fi
45
		ret=$?
49
		ret=$?
46
		eend ${ret} "failure running cryptsetup-luks"
50
		eend ${ret} "failure running cryptsetup-luks"
47
	elif [[ -n ${key} ]] ; then
51
	elif [[ -n ${key} ]] ; then
48
		if type -p gpg >/dev/null ; then
52
		if type -p gpg >/dev/null ; then
53
		    if [[ -z ${master} ]] ; then
49
			ret=1
54
			ret=1
50
			while [[ ${ret} -gt 0 ]] ; do
55
			while [[ ${ret} -gt 0 ]] ; do
51
				keystring=$(gpg ${gpg_options} ${key} 2>/dev/null </dev/console)
56
				keystring=$(gpg ${gpg_options} ${key} 2>/dev/null </dev/console)
Lines 57-62 Link Here
57
				fi
62
				fi
58
			done
63
			done
59
			eend ${ret}
64
			eend ${ret}
65
		    else
66
			keystring=$(echo ${master} | gpg -q -d ${gpg_options} --passphrase-fd 0 ${key} 2>/dev/null)
67
			echo ${keystring} | /bin/cryptsetup ${options} create ${target} ${source}
68
			ret=0
69
		    fi
60
		else
70
		else
61
			einfo "You have to install app-crypt/gnupg first"
71
			einfo "You have to install app-crypt/gnupg first"
62
		fi
72
		fi
Lines 132-138 Link Here
132
					continue
142
					continue
133
				fi
143
				fi
134
				;;
144
				;;
135
145
		        master_key=*)
146
			        if [[ "${myservice}" = "checkfs" ]] ; then
147
				    if type -p gpg >/dev/null ; then
148
					ret=1
149
					while [[ ${ret} -gt 0 ]] ; do
150
			        # Get the master passphrase. 
151
					    ret=0
152
					    eval "${mountline}"
153
					    master=$(gpg -d -q ${gpg_options} ${master_key}  2>/dev/null </dev/console)
154
					    if [[ -z ${master} ]] ; then
155
						ret=5
156
					    fi
157
					done
158
					eend ${ret}
159
				    else
160
					einfo "You have to install app-crypt/gpg first"
161
				    fi
162
				fi
163
				;;
136
			*)
164
			*)
137
				ewarn "Skipping invalid line in /etc/conf.d/cryptfs: ${mountline}"
165
				ewarn "Skipping invalid line in /etc/conf.d/cryptfs: ${mountline}"
138
				;;
166
				;;

Return to bug 104381