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

Collapse All | Expand All

(-)/sbin/rc (-13 / +12 lines)
Lines 184-191 Link Here
184
	fi
184
	fi
185
	
185
	
186
	# Fix weird bug where there is a /dev/.devfsd in a unmounted /dev
186
	# Fix weird bug where there is a /dev/.devfsd in a unmounted /dev
187
	mymounts="$(awk '($3 == "devfs") { print "yes"; exit 0 }' /proc/mounts)"
187
	mymounts=$(< /proc/mounts)
188
	if [ -e "/dev/.devfsd" -a "${mymounts}" != "yes" ]
188
	if [ "${mymounts/devfs}" = "${mymounts}" ] && [ -e "/dev/.devfsd" ]
189
	then
189
	then
190
		rm -f /dev/.devfsd
190
		rm -f /dev/.devfsd
191
	fi
191
	fi
Lines 218-226 Link Here
218
	# With the new way, /dev can be mounted by the kernel ...
218
	# With the new way, /dev can be mounted by the kernel ...
219
	elif [ "${devfs}" = "yes" -a ! -e "/dev/.devfsd" ]
219
	elif [ "${devfs}" = "yes" -a ! -e "/dev/.devfsd" ]
220
	then
220
	then
221
		mymounts="$(awk '($2 == "devfs") { print "yes"; exit 0 }' /proc/filesystems)"
221
		mymounts=$(< /proc/filesystems)
222
		# Is devfs support compiled in?
222
		# Is devfs support compiled in?
223
		if [ "${mymounts}" = "yes" ]
223
		if [ "${mymounts/devfs}" != "${mymounts}" ]
224
		then
224
		then
225
			ebegin "Mounting devfs at /dev"
225
			ebegin "Mounting devfs at /dev"
226
			try mount -n -t devfs none /dev
226
			try mount -n -t devfs none /dev
Lines 245-258 Link Here
245
	# From linux-2.5.68 we need to mount /dev/pts again ...
245
	# From linux-2.5.68 we need to mount /dev/pts again ...
246
	if [ "$(get_KV)" -ge "$(KV_to_int '2.5.68')" ]
246
	if [ "$(get_KV)" -ge "$(KV_to_int '2.5.68')" ]
247
	then
247
	then
248
		have_devpts="$(awk '($2 == "devpts") { print "yes"; exit 0 }' /proc/filesystems)"
248
		have_devpts=$(< /proc/filesystems)
249
		mymounts="$(awk '($3 == "devfs") { print "yes"; exit 0 }' /proc/mounts)"
249
		mymounts=$(< /proc/filesystems)
250
250
251
		if [ "${have_devpts}" = "yes" ]
251
		if [ "${have_devpts/devpts}" != "${have_devpts}" ]
252
		then
252
		then
253
			# Only try to create /dev/pts if we have /dev mounted as devfs,
253
			# Only try to create /dev/pts if we have /dev mounted as devfs,
254
			# else it might fail as / might be still mounted readonly.
254
			# else it might fail as / might be still mounted readonly.
255
			if [ ! -d /dev/pts -a -e "/dev/.devfsd" -a "${mymounts}" = "yes" ]
255
			if [ ! -d "/dev/pts" ] && [ -e "/dev/.devfsd" ] && [ "${mymounts/devfs}" != "${mymounts}" ]
256
			then
256
			then
257
				# Make sure we have /dev/pts
257
				# Make sure we have /dev/pts
258
				mkdir -p /dev/pts &>/dev/null || \
258
				mkdir -p /dev/pts &>/dev/null || \
Lines 270-278 Link Here
270
	fi
270
	fi
271
271
272
	# Need devfsd running now so that /dev/ram0 exists if we need it
272
	# Need devfsd running now so that /dev/ram0 exists if we need it
273
	mymounts="$(awk '($3 == "devfs") { print "yes"; exit 0 }' /proc/mounts)"
273
	mymounts=$(< /proc/mounts)
274
	if [ "${devfs}" = "yes" -a -e "/dev/.devfsd" -a \
274
	if [ "${devfs}" = "yes" ] && [ -e "/dev/.devfsd" ] && [ "${mymounts/devfs}" != "${mymounts}" ]
275
	     "${mymounts}" = "yes" ]
276
	then
275
	then
277
		if [ "${RC_DEVFSD_STARTUP}" != "no" ]
276
		if [ "${RC_DEVFSD_STARTUP}" != "no" ]
278
		then
277
		then
Lines 761-768 Link Here
761
760
762
# We want devfsd running after a change of runlevel (this is mostly if we return
761
# We want devfsd running after a change of runlevel (this is mostly if we return
763
# from runlevel 'single')
762
# from runlevel 'single')
764
if [ -z "`ps --no-heading -C 'devfsd'`" -a \
763
mymounts=$(< /proc/mounts)
765
     -n "`gawk '/\/dev devfs/ { print }' /proc/mounts 2> /dev/null`" ]
764
if [ -z "`ps --no-heading -C 'devfsd'`" ] && [ "${mymounts/\/dev devfs}" != "${mymounts}" ]
766
then
765
then
767
	if [ "${RC_DEVFSD_STARTUP}" != "no" ]
766
	if [ "${RC_DEVFSD_STARTUP}" != "no" ]
768
	then
767
	then

Return to bug 81793