Comment 11 for bug 1553147

Revision history for this message
Thomas Dreibholz (dreibh) wrote :

A work-around to actually setting the keyboard layout (to Norwegian):

d-i preseed/late_command string \
 in-target /bin/sed -i "s/XKBMODEL=\"[a-z]*\"/XKBMODEL=\"pc105\"/g" /etc/default/keyboard ; \
 in-target /bin/sed -i "s/XKBLAYOUT=\"[a-z]*\"/XKBLAYOUT=\"no\"/g" /etc/default/keyboard ; \
 in-target /bin/sed -i "s/XKBVARIANT=\"[a-z]*\"/XKBVARIANT=\"\"/g" /etc/default/keyboard ; \
 in-target /bin/sed -i "s/XKBOPTIONS=\"[a-z]*\"/XKBOPTIONS=\"\"/g" /etc/default/keyboard ; \
 in-target /usr/sbin/dpkg-reconfigure -fnoninteractive keyboard-configuration ; \
 in-target /usr/sbin/update-locale LC_TIME=en_GB.UTF-8 LC_MESSAGES=POSIX

Note, that "/usr/sbin/dpkg-reconfigure -fnoninteractive keyboard-configuration" is necessary to get the new layout configured for X11 as well. Although the documentation says that editing /etc/default/keyboard is fine, X11 will not use the new layout unless "/usr/sbin/dpkg-reconfigure keyboard-configuration" is run.

Finally, "/usr/sbin/update-locale LC_TIME=en_GB.UTF-8" is used to get a 24-hour clock with an en_IE.UTF-8 locale (metric, €, etc., but AM/PM clock). (A European English locale "en_EU.UTF-8" would be a nice feature.)

Needless to say that this work-around is really ugly, and the installer should be fixed to automatically set the proper keyboard layout.