Bug #310

svc:/system/keymap ignores eeprom layout

Added by Albert Lee over 10 years ago. Updated about 10 years ago.

Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:



# Systems with no hardware keyboard ID may provide an eeprom value,
# or the value can be supplied in svc:/system/keymap:default. A value
# supplied in svc:/system/keymap:default will override the value
# supplied in eeprom.
[ -x /usr/lib/set_keyboard_layout ] && /usr/lib/set_keyboard_layout

# Initialize the keyboard defaults

[ -h /dev/kbd -a -x /usr/bin/kbd ] && /usr/bin/kbd -i >/dev/null 2>&1

However, usr/src/cmd/kbd/keymap.xml has:

<propval name='layout' type='astring' value='US-English' />

Hence /usr/bin/kbd -i will always override the settings from /usr/lib/set_keyboard_layout.

Related issues

Related to OpenIndiana Distribution - Bug #203: Keyboard configuration is not preserved across upgradesResolvedAlbert Lee2010-09-15

Related to illumos gate - Bug #1563: Keyboard configuration is not preserved across upgradesIn ProgressAlbert Lee2010-09-15

Has duplicate illumos gate - Bug #121: Any keypboard but US-Enlish does not workClosed2010-08-30

Has duplicate illumos gate - Bug #338: keyboard layout setting not workingClosedAlbert Lee2010-10-12


Updated by Albert Lee over 10 years ago

  • % Done changed from 0 to 50

I think this is the correct solution:

--- a/usr/src/cmd/kbd/keymap.xml
+++ b/usr/src/cmd/kbd/keymap.xml
@@ -77,7 +77,7 @@
                        <propval name='keyclick' type='boolean' value='false' />
                        <propval name='repeat_delay' type='integer' value='500' />
                        <propval name='repeat_rate' type='integer' value='40' />
-                       <propval name='layout' type='astring' value='US-English' />
+                       <propval name='layout' type='astring' value='' />
                        <propval name='kbd_beeper_freq' type='integer' value='2000' />
                        <propval name='console_beeper_freq' type='integer' value='900' />

The caselog for PSARC/2010/183 ( ) shows that SMF contains values for the properties rather than leaving them uninitialised is to make the defaults visible to the user, but the real default for the layout should be the eeprom value and not "US-English".

Related is #203 Keyboard configuration is not preserved across upgrades


Updated by Albert Lee about 10 years ago

set_keyboard_layout needs to set the layout to "US-English" if it's currently "Unknown", else loadkeys (run at the end of the keymap method script) will fail.


Updated by Garrett D'Amore about 10 years ago

Joerg has a fix for this as well:

This is different from his first attempted fix, and seems to be the "correct" fix. To bad he didn't submit this to us more directly.


Updated by Albert Lee about 10 years ago

Joerg's kbd change covers #203 which I think my fix would be preferred for, as his involves introducing an additional value to the layout property to support /etc/default/kbd.

On the OpenIndiana live media it was discovered that the interactive layout selection runs before the keymap method but does apparently does not set the SMF or eeprom property, so an updated set_keyboard_layout invoked from the keymap method would override its selection with "US-English" since the layout appeared to be empty. Either the layout selection should be updated to store its configuration or the keymap method should not attempt to change the layout when both eeprom and SMF have an empty string (or eeprom has "Unknown"?).

Also available in: Atom PDF