changeset 3927:8ebc3a580da2

6531321 A CAS is needed to merge new entries into the /etc/default/kbd 6535016 On old Type-6 mini-din keyboards, hitting right shift key turns on a kind of Caps Lock
author qz150045
date Thu, 29 Mar 2007 19:46:53 -0700
parents 1dfa4fd577c0
children ca43a692451e
files usr/src/pkgdefs/SUNWcsr/Makefile usr/src/pkgdefs/SUNWcsr/pkginfo.tmpl usr/src/pkgdefs/SUNWcsr/prototype_com usr/src/pkgdefs/common_files/i.defkbd usr/src/uts/common/io/kbd.c
diffstat 5 files changed, 70 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/pkgdefs/SUNWcsr/Makefile	Thu Mar 29 18:47:52 2007 -0700
+++ b/usr/src/pkgdefs/SUNWcsr/Makefile	Thu Mar 29 19:46:53 2007 -0700
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -30,6 +30,7 @@
 DATAFILES += \
 	i.cronroot	\
 	i.definit	\
+	i.defkbd	\
 	i.deflogin	\
 	i.defpasswd	\
 	i.defsu		\
--- a/usr/src/pkgdefs/SUNWcsr/pkginfo.tmpl	Thu Mar 29 18:47:52 2007 -0700
+++ b/usr/src/pkgdefs/SUNWcsr/pkginfo.tmpl	Thu Mar 29 19:46:53 2007 -0700
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -44,7 +44,7 @@
 VENDOR="Sun Microsystems, Inc."
 HOTLINE="Please contact your local service provider"
 EMAIL=""
-CLASSES="none ttydefs initd renamenew preserve cronroot passwd tiservices inetdconf definit etcremote nsswitch netconfig deflogin defsu syslogconf ttysrch group inittab etcrpc etcprofile mailxrc shadow locallogin localprofile logadmconf logindevperm nscd fstypes pamconf services rbac renameold dhcpinittab policyconf pkcs11confbase defpasswd vfstab manifest hosts"
+CLASSES="none ttydefs initd renamenew preserve cronroot passwd tiservices inetdconf definit etcremote nsswitch netconfig deflogin defsu syslogconf ttysrch group inittab etcrpc etcprofile mailxrc shadow locallogin localprofile logadmconf logindevperm nscd fstypes pamconf services rbac renameold dhcpinittab policyconf pkcs11confbase defpasswd defkbd vfstab manifest hosts"
 BASEDIR=/
 SUNW_PKGVERS="1.0"
 SUNW_PKG_ALLZONES="true"
--- a/usr/src/pkgdefs/SUNWcsr/prototype_com	Thu Mar 29 18:47:52 2007 -0700
+++ b/usr/src/pkgdefs/SUNWcsr/prototype_com	Thu Mar 29 19:46:53 2007 -0700
@@ -55,6 +55,7 @@
 i i.nsswitch
 i i.nscd
 i i.netconfig
+i i.defkbd
 i i.deflogin
 i i.defsu
 i i.syslogconf
@@ -122,7 +123,7 @@
 e preserve etc/default/devfsadm 644 root sys
 e preserve etc/default/fs 644 root sys
 e definit etc/default/init 644 root sys
-e preserve etc/default/kbd 644 root sys
+e defkbd etc/default/kbd 644 root sys
 e preserve etc/default/keyserv 644 root sys
 e deflogin etc/default/login 644 root sys
 e preserve etc/default/nss 644 root sys
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/pkgdefs/common_files/i.defkbd	Thu Mar 29 19:46:53 2007 -0700
@@ -0,0 +1,60 @@
+#!/bin/sh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+PATH="/usr/bin:/usr/sbin:${PATH}"
+export PATH
+
+while read src dest
+do
+	if [ ! -f $dest ] ; then
+		cp $src $dest
+	else
+		merge=/tmp/sftmp.$$
+		cat /dev/null > $merge
+
+		for word in KEYBOARD_ABORT KEYCLICK REPEAT_DELAY REPEAT_RATE \
+		    LAYOUT KBD_BEEPER_FREQ CONSOLE_BEEPER_FREQ; do
+
+			dstline=`grep "^$word=" $dest | tail -1 2> /dev/null`
+
+			if [ -n "$dstline" ]; then
+				echo "s|^[# 	]*$word=.*|$dstline|" >> $merge
+			fi
+
+		done
+
+		sed -f $merge $src > $dest
+		rm -f $merge
+
+		# restore permissions if they changed
+		/usr/bin/chmod 0644 $dest
+		/usr/bin/chown root:sys $dest
+	fi
+
+done
+
+exit 0
--- a/usr/src/uts/common/io/kbd.c	Thu Mar 29 18:47:52 2007 -0700
+++ b/usr/src/uts/common/io/kbd.c	Thu Mar 29 19:46:53 2007 -0700
@@ -150,6 +150,7 @@
 	ushort_t compose_key;		/* first compose key */
 	ushort_t fltaccent_entry;	/* floating accent keymap entry */
 	char	led_state;		/* current state of LEDs */
+	unsigned char shiftkey;		/* used for the new abort keys */
 };
 
 #define	KBD_OPEN	0x00000001 /* keyboard is open for business */
@@ -1510,7 +1511,7 @@
 			if ((key == k->k_curkeyboard->k_newabort1) ||
 			    (key == k->k_curkeyboard->k_newabort1a)) {
 				k->k_state = NEWABORT1;
-				break;
+				kbdd->shiftkey = key;
 			}
 		}
 #endif
@@ -1548,10 +1549,11 @@
 				DELAY(100000);
 				abort_sequence_enter((char *)NULL);
 				k->k_state = NORMAL;
+				kbdd->shiftkey |= RELEASED;
+				kbduse(kbdd, kbdd->shiftkey);
 				kbduse(kbdd, IDLEKEY);	/* fake */
 				return;
 			} else {
-				kbduse(kbdd, k->k_curkeyboard->k_newabort1);
 				goto normalstate;
 			}
 		}