This section discusses how to configure the console bootscript that sets up the keyboard map and the console font. If non-ASCII characters (e.g., the copyright sign, the British pound sign and Euro symbol) will not be used and the keyboard is a U.S. one, skip this section. Without the configuration file, the console bootscript will do nothing.
The console script reads the /etc/sysconfig/console file for configuration information. Decide which keymap and screen font will be used. Various language-specific HOWTOs can also help with this, see http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html. If still in doubt, look in the /usr/share/kbd directory for valid keymaps and screen fonts. Read loadkeys(1) and setfont(8) manual pages to determine the correct arguments for these programs.
The /etc/sysconfig/console file should contain lines of the form: VARIABLE="value". The following variables are recognized:
This variable specifies the arguments for the loadkeys program, typically, the name of keymap to load, e.g., “es”. If this variable is not set, the bootscript will not run the loadkeys program, and the default kernel keymap will be used.
This (rarely used) variable specifies the arguments for the second call to the loadkeys program. This is useful if the stock keymap is not completely satisfactory and a small adjustment has to be made. E.g., to include the Euro sign into a keymap that normally doesn't have it, set this variable to “euro2”.
This variable specifies the arguments for the setfont program. Typically, this includes the font name, “-m”, and the name of the application character map to load. E.g., in order to load the “lat1-16” font together with the “8859-1” application character map (as it is appropriate in the USA), set this variable to “lat1-16 -m 8859-1”. If this variable is not set, the bootscript will not run the setfont program, and the default VGA font will be used together with the default application character map.
Set this variable to “1”, “yes” or “true” in order to put the console into UTF-8 mode. This is useful in UTF-8 based locales and harmful otherwise.
For many keyboard layouts, there is no stock Unicode keymap in the Kbd package. The console bootscript will convert an available keymap to UTF-8 on the fly if this variable is set to the encoding of the available non-UTF-8 keymap. Note, however, that dead keys (i.e., keys that don't produce a character by themselves, but put an accent onto a character procuced by the next key; there are no dead keys on the standard US keyboard) and composing (i.e., pressing Ctrl+. A E in order to produce the Æ character) will not work in UTF-8 mode without the special kernel patch. This variable is useful only in UTF-8 mode.
Set this to “0” if you are going to apply the kernel patch in Chapter 8. Note that you also have to add the character set expected by composition rules in your keymap to the FONT variable after the “-m” switch. This variable is useful only in UTF-8 mode.
Support for compiling the keymap directly into the kernel has been removed because there were reports that it leads to incorrect results.
Some examples:
For a non-Unicode setup, only the KEYMAP and FONT variables are generally needed. E.g., for a Polish setup, one would use:
cat > /etc/sysconfig/console << "EOF" # Begin /etc/sysconfig/console KEYMAP="pl2" FONT="lat2a-16 -m 8859-2" # End /etc/sysconfig/console EOF
As mentioned above, it is sometimes necessary to adjust a stock keymap slightly. The following example adds the Euro symbol to the German keymap:
cat > /etc/sysconfig/console << "EOF" # Begin /etc/sysconfig/console KEYMAP="de-latin1" KEYMAP_CORRECTIONS="euro2" FONT="lat0-16 -m 8859-15" # End /etc/sysconfig/console EOF
The following is a Unicode-enabled example for Bulgarian, where a stock UTF-8 keymap exists and defines no dead keys or composition rules:
cat > /etc/sysconfig/console << "EOF" # Begin /etc/sysconfig/console UNICODE="1" KEYMAP="bg_bds-utf8" FONT="LatArCyrHeb-16" # End /etc/sysconfig/console EOF
Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous example, bright colors are no longer available on the Linux console unless a framebuffer is used. If one wants to have bright colors without framebuffer and can live without characters not belonging to his language, it is still possible to use a language-specific 256-glyph font, as illustrated below.
cat > /etc/sysconfig/console << "EOF" # Begin /etc/sysconfig/console UNICODE="1" KEYMAP="bg_bds-utf8" FONT="cyr-sun16" # End /etc/sysconfig/console EOF
The following example illustrates keymap autoconversion from ISO-8859-15 to UTF-8 and enabling dead keys in Unicode mode:
cat > /etc/sysconfig/console << "EOF" # Begin /etc/sysconfig/console UNICODE="1" KEYMAP="de-latin1" KEYMAP_CORRECTIONS="euro2" LEGACY_CHARSET="iso-8859-15" BROKEN_COMPOSE="0" FONT="LatArCyrHeb-16 -m 8859-15" # End /etc/sysconfig/console EOF
For Chinese, Japanese, Korean and some other languages, the Linux console cannot be configured to display the needed characters. Users who need such languages should install the X Window System, fonts that cover the necessary character ranges, and the proper input method (e.g., SCIM, it supports a wide variety of languages).
The /etc/sysconfig/console file only controls the Linux text console localization. It has nothing to do with setting the proper keyboard layout and terminal fonts in the X Window System, with ssh sessions or with a serial console.