console.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  3. <!ENTITY % general-entities SYSTEM "../general.ent">
  4. %general-entities;
  5. ]>
  6. <sect1 id="ch-scripts-console">
  7. <title>Configuring the Linux console</title>
  8. <?dbhtml filename="console.html"?>
  9. <indexterm zone="ch-scripts-console">
  10. <primary sortas="d-console">console</primary>
  11. <secondary>configuring</secondary></indexterm>
  12. <para>In this section we will configure the <command>console</command>
  13. initscript that sets up the keyboard
  14. map and the console font. If you
  15. don't need to use any non-ASCII characters
  16. (British pound and Euro character are not ASCII),
  17. and your keyboard is a US one, you can skip this section.
  18. Without the configuration file,
  19. the <command>console</command> initscript will do nothing.</para>
  20. <para>The <command>console</command> script uses the
  21. <filename>/etc/sysconfig/console</filename>
  22. as a configuration file. You need to decide which keymap and screen font you
  23. will use. The language-specific HOWTO can help you.
  24. A pre-made
  25. <filename>/etc/sysconfig/console</filename> file with known
  26. good settings for several countries was installed with the LFS-Bootscripts
  27. package, and you just have to uncomment
  28. the relevant section if your country is supported (but read the rest
  29. of this section anyway).
  30. If still in doubt,
  31. look into <filename class="directory">/usr/share/kbd</filename>
  32. for valid keymaps and screen fonts. Then read the <command>loadkeys</command>
  33. and <command>setfont</command> manual pages and figure out the correct
  34. arguments for these programs.
  35. Once you decided, create the
  36. configuration file with the following command:</para>
  37. <screen><userinput>cat &gt;/etc/sysconfig/console &lt;&lt;"EOF"</userinput>
  38. KEYMAP="<emphasis>arguments for loadkeys</emphasis>"
  39. FONT="<emphasis>arguments for setfont</emphasis>"
  40. <userinput>EOF</userinput></screen>
  41. <para>E.g., for Spanish users who also want to use the Euro character
  42. (accessible by pressing Alt+E),
  43. the following settings are correct:</para>
  44. <screen><userinput>cat &gt;/etc/sysconfig/console &lt;&lt;"EOF"</userinput>
  45. KEYMAP="es euro"
  46. FONT="lat9-16 -u iso01"
  47. <userinput>EOF</userinput></screen>
  48. <note><para>The FONT line above is correct only for the ISO-8859-15
  49. character set. If you prefer ISO-8859-1 and therefore use a pound sign
  50. instead of Euro, the correct FONT line is:</para>
  51. <screen><userinput>FONT="lat1-16"</userinput></screen></note>
  52. <para>If the KEYMAP or FONT variable is not set, the
  53. <command>console</command> initscript will not run the corresponding
  54. program.</para>
  55. <para>In some keymaps, the Backspace and Delete keys send characters
  56. different form ones in the default keymap built into the kernel.
  57. This confuses some applications, e.g. <application>Emacs</application>
  58. displays its help (instead of erasing the character before the cursor)
  59. when you press Backspace. To check if your keymap is affected (this works
  60. only for i386 keymaps):</para>
  61. <screen><userinput>zgrep '\W14\W' /path/to/your/keymap</userinput></screen>
  62. <para>If you see that keycode 14 is Backspace and not Delete,
  63. create the following keymap snippet to fix this issue:</para>
  64. <screen><userinput>mkdir -p /etc/kbd &amp; &amp; cat &gt;/etc/kbd/bs-sends-del &lt;&lt;"EOF"</userinput>
  65. keycode 14 = Delete Delete Delete Delete
  66. alt keycode 14 = Meta_Delete
  67. altgr alt keycode 14 = Meta_Delete
  68. keycode 111 = Remove
  69. altgr control keycode 111 = Boot
  70. control alt keycode 111 = Boot
  71. altgr control alt keycode 111 = Boot
  72. <userinput>EOF</userinput></screen>
  73. <para>Then tell the <command>console</command> script to load this snippet
  74. after the main keymap:</para>
  75. <screen><userinput>cat &gt;&gt;/etc/sysconfig/console &lt;&lt;"EOF"</userinput>
  76. KEYMAP_CORRECTION="/etc/kbd/bs-sends-del"
  77. <userinput>EOF</userinput></screen>
  78. <para>If you decided to
  79. compile your keymap directly into the kernel later on in <xref
  80. linkend="chapter-bootable"/> instead of setting it every time from the
  81. <command>console</command> bootscript, then you don't need to run the
  82. <command>loadkeys</command> program. Since the kernel will set up the keymap,
  83. you can omit the KEYMAP variable from the
  84. <filename>/etc/sysconfig/console</filename>
  85. configuration file. If you wish,
  86. you can still have it, this isn't going to hurt you. Keeping it could even
  87. be beneficial, in case you run a lot of different kernels and can't be sure
  88. that the keymap is compiled into every one of them.</para>
  89. </sect1>