set_keyboard_layout revision fe539fb313fcf38628fdaadef98c79a8c5beee37
1566N/A#! /usr/bin/sh
1566N/A#
1566N/A# CDDL HEADER START
1566N/A#
1566N/A# The contents of this file are subject to the terms of the
1566N/A# Common Development and Distribution License (the "License").
1566N/A# You may not use this file except in compliance with the License.
1566N/A#
1566N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1566N/A# or http://www.opensolaris.org/os/licensing.
1566N/A# See the License for the specific language governing permissions
1566N/A# and limitations under the License.
1566N/A#
1566N/A# When distributing Covered Code, include this CDDL HEADER in each
1566N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1566N/A# If applicable, add the following below this CDDL HEADER, with the
3533N/A# fields enclosed by brackets "[]" replaced with your own identifying
3533N/A# information: Portions Copyright [yyyy] [name of copyright owner]
3533N/A#
3533N/A# CDDL HEADER END
3533N/A#
4426N/A#pragma ident "%Z%%M% %I% %E% SMI"
3671N/A#
3671N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
3671N/A# Use is subject to license terms.
3671N/A#
3671N/A
3671N/A# get the valid layout name from the eeprom and set it into kernel.
3671N/A# check space and tab to make sure that the kbd -s interaction mode
1566N/A# doesn't run here.
3817N/AKBD_LAYOUT_NAME="`/usr/sbin/eeprom keyboard-layout |\
3817N/A /usr/bin/sed -n 's/keyboard-layout=//g; s/[ | ]*//p'`"
1566N/A
4194N/Aif test -n "$KBD_LAYOUT_NAME"
4194N/Athen
4194N/A KBD_LAYOUT_NAME_STRING="^$KBD_LAYOUT_NAME="
4194N/A LAYOUT_NAME_VALID="`cat /usr/share/lib/keytables/type_6/kbd_layouts | \
4194N/A grep $KBD_LAYOUT_NAME_STRING`"
4194N/Aelse
4194N/A exit 0
4194N/Afi
4194N/A
4194N/Aif test -n "$LAYOUT_NAME_VALID"
4194N/Athen
4194N/A # Set the keyboard layout
4194N/A /usr/bin/kbd -s $KBD_LAYOUT_NAME
4194N/Afi
4194N/A