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

Collapse All | Expand All

(-)sys-fs/cryptsetup-luks/files/1.0.3-dm-crypt-start.sh (-7 / +12 lines)
Lines 1-8 Link Here
1
# /lib/rcscripts/addons/dm-crypt-start.sh
1
# /lib/rcscripts/addons/dm-crypt-start.sh
2
2
3
# For backwards compatability with baselayout < 1.13.0
4
dm_crypt_execute_checkfs() {
5
	dm_crypt_execute_volumes
6
}
7
3
# Setup mappings for an individual target/swap
8
# Setup mappings for an individual target/swap
4
# Note: This relies on variables localized in the main body below.
9
# Note: This relies on variables localized in the main body below.
5
dm-crypt-execute-checkfs() {
10
dm_crypt_execute_volumes() {
6
	local dev ret mode
11
	local dev ret mode
7
	# some colors
12
	# some colors
8
	local red='\x1b[31;01m' green='\x1b[32;01m' off='\x1b[0;0m'
13
	local red='\x1b[31;01m' green='\x1b[32;01m' off='\x1b[0;0m'
Lines 103-109 Link Here
103
	else
108
	else
104
		mode=none
109
		mode=none
105
	fi
110
	fi
106
	splash svc_input_begin checkfs
111
	splash svc_input_begin ${SVCNAME} >/dev/null 2>&1
107
	ebegin "dm-crypt map ${target}"
112
	ebegin "dm-crypt map ${target}"
108
	einfo "cryptsetup will be called with : ${options} ${arg1} ${arg2} ${arg3}"
113
	einfo "cryptsetup will be called with : ${options} ${arg1} ${arg2} ${arg3}"
109
	if [ "$mode" == "gpg" ]; then
114
	if [ "$mode" == "gpg" ]; then
Lines 145-151 Link Here
145
		umount -n ${mntrem} 2>/dev/null >/dev/null
150
		umount -n ${mntrem} 2>/dev/null >/dev/null
146
		rmdir ${mntrem} 2>/dev/null >/dev/null
151
		rmdir ${mntrem} 2>/dev/null >/dev/null
147
	fi
152
	fi
148
	splash svc_input_end checkfs
153
	splash svc_input_end ${SVCNAME} >/dev/null 2>&1
149
154
150
	if [[ ${ret} != 0 ]] ; then
155
	if [[ ${ret} != 0 ]] ; then
151
		cryptfs_status=1
156
		cryptfs_status=1
Lines 162-168 Link Here
162
# Run any post_mount commands for an individual mount
167
# Run any post_mount commands for an individual mount
163
#
168
#
164
# Note: This relies on variables localized in the main body below.
169
# Note: This relies on variables localized in the main body below.
165
dm-crypt-execute-localmount() {
170
dm_crypt_execute_localmount() {
166
	local mount_point
171
	local mount_point
167
172
168
	[ -z "$target" ] && [ -z "$post_mount" ] && return
173
	[ -z "$target" ] && [ -z "$post_mount" ] && return
Lines 200-206 Link Here
200
		case ${targetline} in
205
		case ${targetline} in
201
			target=*|swap=*)
206
			target=*|swap=*)
202
				# If we have a target queued up, then execute it
207
				# If we have a target queued up, then execute it
203
				dm-crypt-execute-${myservice}
208
				dm_crypt_execute_${SVCNAME}
204
209
205
				# Prepare for the next target/swap by resetting variables
210
				# Prepare for the next target/swap by resetting variables
206
				unset gpg_options key loop_file target options pre_mount post_mount source swap remdev
211
				unset gpg_options key loop_file target options pre_mount post_mount source swap remdev
Lines 218-229 Link Here
218
				;;
223
				;;
219
		esac
224
		esac
220
225
221
		# Queue this setting for the next call to dm-crypt-execute-${myservice}
226
		# Queue this setting for the next call to dm_crypt_execute_${SVCNAME}
222
		eval "${targetline}"
227
		eval "${targetline}"
223
	done < /etc/conf.d/cryptfs
228
	done < /etc/conf.d/cryptfs
224
229
225
	# If we have a target queued up, then execute it
230
	# If we have a target queued up, then execute it
226
	dm-crypt-execute-${myservice}
231
	dm_crypt_execute_${SVCNAME}
227
232
228
	ewend ${cryptfs_status} "Failed to setup dm-crypt devices"
233
	ewend ${cryptfs_status} "Failed to setup dm-crypt devices"
229
fi
234
fi

Return to bug 157590