console.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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"
  38. KEYMAP="<replaceable>[arguments for loadkeys]</replaceable>"
  39. FONT="<replaceable>[arguments for setfont]</replaceable>"
  40. 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"
  45. KEYMAP="es euro"
  46. FONT="lat9-16 -u iso01"
  47. 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' <replaceable>[/path/to/your/keymap]</replaceable></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"
  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. 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"
  76. KEYMAP_CORRECTION="/etc/kbd/bs-sends-del"
  77. EOF</userinput></screen>
  78. <para>If you want to compile your keymap directly into the kernel instead of
  79. setting it every time from the <command>console</command> bootscript, then
  80. instructions are given in <xref linkend="ch-bootable-kernel"/>. Doing this
  81. ensures that your keyboard will always work as expected, even when you boot into
  82. maintenance mode (by passing <parameter>init=/bin/sh</parameter> to the kernel),
  83. as in that situation, the <command>console</command> bootscript won't be run.
  84. Additionally, the kernel will not set the screen font automatically. Again,
  85. this shouldn't pose too many problems as ASCII characters will still be handled
  86. correctly, and it is unlikely that you would need to rely on non-ASCII
  87. characters whilst in maintenance mode.</para>
  88. <para>Since the kernel will set up the keymap, you can omit the KEYMAP variable
  89. from the <filename>/etc/sysconfig/console</filename> configuration file. If you
  90. wish, you can still have it, this isn't going to hurt you. Keeping it could even
  91. be beneficial, in case you run a lot of different kernels and can't be sure that
  92. the keymap is compiled into every one of them.</para>
  93. </sect1>