Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Mar 2006 16:41:57 -0800
From:      Maksim Yevmenkin <maksim.yevmenkin@savvis.net>
To:        Ulrich Spoerlein <q@galgenberg.net>
Cc:        current@freebsd.org
Subject:   Re: kbdmux/syscons/vidcontrol interacts badly with X/radeon
Message-ID:  <4418B455.8090709@savvis.net>
In-Reply-To: <20060315223501.GA1438@galgenberg.net>
References:  <20060315223501.GA1438@galgenberg.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------060000070800010805090009
Content-Type: text/plain; charset=KOI8-R; format=flowed
Content-Transfer-Encoding: 7bit

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


--------------060000070800010805090009
Content-Type: text/plain;
 name="syscons-devd.conf.diff.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="syscons-devd.conf.diff.txt"

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 '.'
 }
 

--------------060000070800010805090009--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4418B455.8090709>