kbdmux/syscons/vidcontrol interacts badly with X/radeon

Maksim Yevmenkin maksim.yevmenkin at savvis.net
Thu Mar 16 00:42:04 UTC 2006


Ulrich Spoerlein wrote:
> Hi all,
> 
> this pertains to 6.1-PRERELEASE and is caused by devd calling 'syscons
> restart' on keyboard attach. More specifically it is due to 
> allscreens_flags="-c blink 80x60" in /etc/rc.conf. This will then call
> vidcontrol and this totally screws up my X11 display (radeon driver).
> Killing X11 will _usually_ result in a normal console, but this is not
> always the case. Clearing allscreens_flags is also a possibile
> workaround.
> 
> Also, on normal boot, vidcontrol will be called twice, once in normal
> startup, then via kbdmux/devd/syscons restart.
> 
> Possible solution: Don't do a full restart, but refactor the keyboard
> code in syscons into a separate function and only call this function.
> 
> I hope this can be implemented quickly and MFC'ed before 6.1. Thanks!

could you please try the attached patch?

thanks,
max

-------------- next part --------------
Index: devd.conf
===================================================================
RCS file: /home/ncvs/src/etc/devd.conf,v
retrieving revision 1.31
diff -u -r1.31 devd.conf
--- devd.conf	6 Mar 2006 06:38:34 -0000	1.31
+++ devd.conf	16 Mar 2006 00:38:50 -0000
@@ -99,7 +99,7 @@
 # When a USB keyboard arrives, attach it as the console keyboard.
 attach 100 {
 	device-name "ukbd0";
-	action "/etc/rc.d/syscons setkeyboard /dev/ukbd0 && /etc/rc.d/syscons restart";
+	action "/etc/rc.d/syscons setkeyboard /dev/ukbd0";
 };
 detach 100 {
 	device-name "ukbd0";
Index: rc.d/syscons
===================================================================
RCS file: /home/ncvs/src/etc/rc.d/syscons,v
retrieving revision 1.15
diff -u -r1.15 syscons
--- rc.d/syscons	6 Mar 2006 06:38:34 -0000	1.15
+++ rc.d/syscons	16 Mar 2006 00:38:50 -0000
@@ -44,44 +44,9 @@
 kbddev=/dev/ttyv0
 viddev=/dev/ttyv0
 
-syscons_setkeyboard()
+# helper
+syscons_configure_keyboard()
 {
-	kbd=$1
-                
-	if [ -z "${kbd}" ]; then
-		return 1
-	fi
-
-	# Check if the kbdmux(4) is the current active keyboard
-	kbdcontrol -i < ${kbddev} | grep kbdmux > /dev/null 2>&1
-	if [ $? != 0 ]; then
-		kbdcontrol -k ${kbd} < ${kbddev} > /dev/null 2>&1
-	fi
-}
-
-syscons_precmd()
-{
-	if [ ! -c $kbddev ]
-	then
-		return 1
-	fi
-	if [ -x /usr/sbin/ispcvt ] && /usr/sbin/ispcvt
-	then
-		return 1
-	fi
-	return 0
-}
-
-syscons_start()
-{
-	echo -n 'Configuring syscons:'
-
-	# keyboard
-	#
-	if [ -n "${keyboard}" ]; then
-		echo -n ' keyboard';	syscons_setkeyboard ${keyboard}
-	fi
-
 	# keymap
 	#
 	case ${keymap} in
@@ -127,6 +92,60 @@
 		;;
 	esac
 
+	# set this keyboard mode for all virtual terminals
+	#
+	if [ -n "${allscreens_kbdflags}" ]; then
+		echo -n ' allscreens_kbd'
+		for ttyv in /dev/ttyv*; do
+			kbdcontrol ${allscreens_kbdflags} < ${ttyv} > ${ttyv} 2>&1
+		done
+	fi
+}
+
+syscons_setkeyboard()
+{
+	kbd=$1
+                
+	if [ -z "${kbd}" ]; then
+		return 1
+	fi
+
+	# Check if the kbdmux(4) is the current active keyboard
+	kbdcontrol -i < ${kbddev} | grep kbdmux > /dev/null 2>&1
+	if [ $? != 0 ]; then
+		kbdcontrol -k ${kbd} < ${kbddev} > /dev/null 2>&1
+	fi
+
+	echo -n 'Configuring keyboard:'
+	syscons_configure_keyboard
+	echo '.'
+}
+
+syscons_precmd()
+{
+	if [ ! -c $kbddev ]
+	then
+		return 1
+	fi
+	if [ -x /usr/sbin/ispcvt ] && /usr/sbin/ispcvt
+	then
+		return 1
+	fi
+	return 0
+}
+
+syscons_start()
+{
+	echo -n 'Configuring syscons:'
+
+	# keyboard
+	#
+	if [ -n "${keyboard}" ]; then
+		echo -n ' keyboard';	syscons_setkeyboard ${keyboard}
+	fi
+
+	syscons_configure_keyboard
+
 	# cursor type
 	#
 	case ${cursor} in
@@ -210,15 +229,6 @@
 		done
 	fi
 
-	# set this keyboard mode for all virtual terminals
-	#
-	if [ -n "${allscreens_kbdflags}" ]; then
-		echo -n ' allscreens_kbd'
-		for ttyv in /dev/ttyv*; do
-			kbdcontrol ${allscreens_kbdflags} < ${ttyv} > ${ttyv} 2>&1
-		done
-	fi
-
 	echo '.'
 }
 


More information about the freebsd-current mailing list