[7152faa] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[1118b17] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
[afcfd74] | 8 | <sect1 id="ch-config-console" revision="systemd">
|
---|
[1118b17] | 9 | <?dbhtml filename="console.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Configuring the Linux Console</title>
|
---|
| 12 |
|
---|
[afcfd74] | 13 | <indexterm zone="ch-config-console">
|
---|
[1118b17] | 14 | <primary sortas="d-console">console</primary>
|
---|
| 15 | <secondary>configuring</secondary>
|
---|
| 16 | </indexterm>
|
---|
| 17 |
|
---|
| 18 | <para>This section discusses how to configure the
|
---|
| 19 | <command>systemd-vconsole-setup</command> system service, which configures
|
---|
| 20 | the virtual console font and console keymap.</para>
|
---|
| 21 |
|
---|
| 22 | <para>The <command>systemd-vconsole-setup</command> service reads the
|
---|
| 23 | <filename>/etc/vconsole.conf</filename> file for configuration
|
---|
| 24 | information. Decide which keymap and screen font will be used. Various
|
---|
| 25 | language-specific HOWTOs can also help with this, see <ulink
|
---|
[fb66c4c] | 26 | url="https://tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>.
|
---|
[9e7475a] | 27 | Examine the output of <command>localectl list-keymaps</command> for a list of
|
---|
[c34b4fb] | 28 | valid console keymaps. Look in the
|
---|
[1118b17] | 29 | <filename class="directory">/usr/share/consolefonts</filename>
|
---|
| 30 | directory for valid screen fonts.</para>
|
---|
| 31 |
|
---|
| 32 | <para>The <filename>/etc/vconsole.conf</filename> file should contain lines
|
---|
[360fdfca] | 33 | of the form: <envar>VARIABLE=value</envar>. The following variables are recognized:</para>
|
---|
[1118b17] | 34 |
|
---|
| 35 | <variablelist>
|
---|
| 36 |
|
---|
| 37 | <varlistentry>
|
---|
| 38 | <term>KEYMAP</term>
|
---|
| 39 | <listitem>
|
---|
| 40 | <para>This variable specifies the key mapping table for the keyboard. If
|
---|
| 41 | unset, it defaults to <literal>us</literal>.</para>
|
---|
| 42 | </listitem>
|
---|
| 43 | </varlistentry>
|
---|
| 44 |
|
---|
| 45 | <varlistentry>
|
---|
| 46 | <term>KEYMAP_TOGGLE</term>
|
---|
| 47 | <listitem>
|
---|
| 48 | <para>This variable can be used to configure a second toggle keymap and
|
---|
| 49 | is unset by default.</para>
|
---|
| 50 | </listitem>
|
---|
| 51 | </varlistentry>
|
---|
| 52 |
|
---|
| 53 | <varlistentry>
|
---|
| 54 | <term>FONT</term>
|
---|
| 55 | <listitem>
|
---|
| 56 | <para>This variable specifies the font used by the virtual
|
---|
| 57 | console.</para>
|
---|
| 58 | </listitem>
|
---|
| 59 | </varlistentry>
|
---|
| 60 |
|
---|
| 61 | <varlistentry>
|
---|
| 62 | <term>FONT_MAP</term>
|
---|
| 63 | <listitem>
|
---|
| 64 | <para>This variable specifies the console map to be used.</para>
|
---|
| 65 | </listitem>
|
---|
| 66 | </varlistentry>
|
---|
| 67 |
|
---|
| 68 | <varlistentry>
|
---|
| 69 | <term>FONT_UNIMAP</term>
|
---|
| 70 | <listitem>
|
---|
| 71 | <para>This variable specifies the Unicode font map.</para>
|
---|
| 72 | </listitem>
|
---|
| 73 | </varlistentry>
|
---|
| 74 |
|
---|
| 75 | </variablelist>
|
---|
| 76 |
|
---|
[4ecfc55] | 77 | <para>We'll use <literal>C.UTF-8</literal> as the locale for interactive
|
---|
| 78 | sessions in the Linux console in <xref role='.'
|
---|
[39b5bb6] | 79 | linkend='ch-config-locale'/> The console fonts shipped by
|
---|
[4ecfc55] | 80 | the <application>Kbd</application> package containing the glyphs for
|
---|
| 81 | all characters from the program messages in the <literal>C.UTF-8</literal>
|
---|
[39b5bb6] | 82 | locale are <filename>LatArCyrHeb*.psfu.gz</filename>,
|
---|
| 83 | <filename>LatGrkCyr*.psfu.gz</filename>,
|
---|
| 84 | <filename>Lat2-Terminus16.psfu.gz</filename>, and
|
---|
| 85 | <filename>pancyrillic.f16.psfu.gz</filename> in
|
---|
| 86 | <filename class='directory'>/usr/share/consolefonts</filename> (the other
|
---|
| 87 | shipped console fonts lack glyphs of some characters like the Unicode
|
---|
| 88 | left/right quotation marks and the Unicode English dash). So set one of
|
---|
| 89 | them, for example <filename>Lat2-Terminus16.psfu.gz</filename> as the
|
---|
| 90 | default console font:</para>
|
---|
[4ecfc55] | 91 |
|
---|
| 92 | <!-- We are using "nodump" for general settings, but not examples. This
|
---|
| 93 | is ironic, but needed for the compatibility with jhalfs! -->
|
---|
| 94 | <screen role='nodump'><userinput>echo <literal>FONT=Lat2-Terminus16</literal> > /etc/vconsole.conf</userinput></screen>
|
---|
| 95 |
|
---|
[1118b17] | 96 | <para>An example for a German keyboard and console is given below:</para>
|
---|
[8154126] | 97 | <!-- This is what is used by jhalfs for creating the vconsole.conf file.
|
---|
| 98 | Whenever you want to change the following, please inform the jhalfs
|
---|
[93058448] | 99 | maintainer(s). -->
|
---|
[8154126] | 100 | <screen><userinput>cat > /etc/vconsole.conf << "EOF"
|
---|
[1118b17] | 101 | <literal>KEYMAP=de-latin1
|
---|
| 102 | FONT=Lat2-Terminus16</literal>
|
---|
| 103 | EOF</userinput></screen>
|
---|
| 104 |
|
---|
| 105 | <para>You can change KEYMAP value at runtime by using the
|
---|
| 106 | <command>localectl</command> utility:</para>
|
---|
| 107 |
|
---|
| 108 | <screen role="nodump"><userinput>localectl set-keymap MAP</userinput></screen>
|
---|
| 109 |
|
---|
[4f560248] | 110 | <note><para>Please note that the <command>localectl</command> command
|
---|
| 111 | doesn't work in the chroot environment. It can only
|
---|
| 112 | be used after the LFS system is booted with systemd.</para></note>
|
---|
[1118b17] | 113 |
|
---|
| 114 | <para>You can also use <command>localectl</command> utility with the
|
---|
| 115 | corresponding parameters to change X11 keyboard layout, model, variant
|
---|
| 116 | and options:</para>
|
---|
| 117 |
|
---|
| 118 | <screen role="nodump"><userinput>localectl set-x11-keymap LAYOUT [MODEL] [VARIANT] [OPTIONS]</userinput></screen>
|
---|
| 119 |
|
---|
| 120 | <para>To list possible values for <command>localectl set-x11-keymap</command>
|
---|
| 121 | parameters, run <command>localectl</command> with parameters listed below:
|
---|
| 122 | </para>
|
---|
| 123 |
|
---|
| 124 | <variablelist>
|
---|
| 125 |
|
---|
| 126 | <varlistentry>
|
---|
| 127 | <term>list-x11-keymap-models</term>
|
---|
| 128 | <listitem>
|
---|
[9e7475a] | 129 | <para>Shows known X11 keyboard mapping models.</para>
|
---|
[1118b17] | 130 | </listitem>
|
---|
| 131 | </varlistentry>
|
---|
| 132 |
|
---|
| 133 | <varlistentry>
|
---|
| 134 | <term>list-x11-keymap-layouts</term>
|
---|
| 135 | <listitem>
|
---|
[9e7475a] | 136 | <para>Shows known X11 keyboard mapping layouts.</para>
|
---|
[1118b17] | 137 | </listitem>
|
---|
| 138 | </varlistentry>
|
---|
| 139 |
|
---|
| 140 | <varlistentry>
|
---|
| 141 | <term>list-x11-keymap-variants</term>
|
---|
| 142 | <listitem>
|
---|
[9e7475a] | 143 | <para>Shows known X11 keyboard mapping variants.</para>
|
---|
[1118b17] | 144 | </listitem>
|
---|
| 145 | </varlistentry>
|
---|
| 146 |
|
---|
| 147 | <varlistentry>
|
---|
| 148 | <term>list-x11-keymap-options</term>
|
---|
| 149 | <listitem>
|
---|
[9e7475a] | 150 | <para>Shows known X11 keyboard mapping options.</para>
|
---|
[1118b17] | 151 | </listitem>
|
---|
| 152 | </varlistentry>
|
---|
| 153 |
|
---|
| 154 | </variablelist>
|
---|
| 155 |
|
---|
[0d84af1] | 156 | <note><para>Using any of the parameters listed above requires the
|
---|
[9e7475a] | 157 | XKeyboard-Config package from BLFS.</para></note>
|
---|
[1118b17] | 158 |
|
---|
| 159 | </sect1>
|
---|