Changeset 676d923 in clfs-sysroot for BOOK/bootscripts/common/profile.xml


Ignore:
Timestamp:
Mar 15, 2009, 2:42:22 PM (16 years ago)
Author:
Joe Ciccone <jciccone@…>
Branches:
master
Children:
10658db
Parents:
1970967
Message:

Update bootscript configuration from trunk. Update bootscripts to 1.2-pre6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BOOK/bootscripts/common/profile.xml

    r1970967 r676d923  
    1818  files to help create an environment to run in. Each file has a
    1919  specific use and may affect login and interactive environments
    20   differently. The files in the <filename
    21   class="directory">/etc</filename> directory provide global settings.
    22   If an equivalent file exists in the home directory, it may override
    23   the global settings.</para>
     20  differently. The files in the <filename class="directory">/etc</filename>
     21  directory provide global settings. If an equivalent file exists in the
     22  home directory, it may override the global settings.</para>
    2423
    2524  <para>An interactive login shell is started after a successful login,
     
    3332
    3433  <para>For more information, see <command>info bash</command> under the
    35   <emphasis>Bash Startup Files and Interactive Shells</emphasis> section.</para>
     34  <emphasis>Bash Startup Files and Interactive Shells</emphasis> section,
     35  and <ulink url="&cblfs-root;index.php/Bash_Startup_Files">Bash Startup
     36  Files</ulink> in CBLFS.</para>
    3637
    3738  <para>The files <filename>/etc/profile</filename> and
    3839  <filename>~/.bash_profile</filename> are read when the shell is
    39   invoked as an interactive login shell.</para>
    40 
    41   <para>The base <filename>/etc/profile</filename> below sets some
    42   environment variables necessary for native language support. Setting
    43   them properly results in:</para>
    44 
    45   <itemizedlist>
    46     <listitem>
    47       <para>The output of programs translated into the native language</para>
    48     </listitem>
    49     <listitem>
    50       <para>Correct classification of characters into letters, digits and
    51       other classes. This is necessary for <command>bash</command> to
    52       properly accept non-ASCII characters in command lines in non-English
    53       locales</para>
    54     </listitem>
    55     <listitem>
    56       <para>The correct alphabetical sorting order for the country</para>
    57     </listitem>
    58     <listitem>
    59       <para>Appropriate default paper size</para>
    60     </listitem>
    61     <listitem>
    62       <para>Correct formatting of monetary, time, and date values</para>
    63     </listitem>
    64   </itemizedlist>
    65 
    66   <para>This script also sets the <envar>INPUTRC</envar> environment variable
    67   that makes Bash and Readline use the <filename>/etc/inputrc</filename> file
    68   created earlier.</para>
    69 
    70   <para>Replace <replaceable>[ll]</replaceable> below with the
    71   two-letter code for the desired language (e.g., <quote>en</quote>) and
    72   <replaceable>[CC]</replaceable> with the two-letter code for the
    73   appropriate country (e.g., <quote>GB</quote>).
    74   <replaceable>[charmap]</replaceable> should be replaced with the
    75   canonical charmap for your chosen locale.</para>
    76 
    77   <para>The list of all locales supported by Glibc can be obtained by running
    78   the following command:</para>
    79 
    80 <screen role="nodump"><userinput>locale -a</userinput></screen>
    81 
    82   <para>Locales can have a number of synonyms, e.g. <quote>ISO-8859-1</quote>
    83   is also referred to as <quote>iso8859-1</quote> and <quote>iso88591</quote>.
    84   Some applications cannot handle the various synonyms correctly, so it is
    85   safest to choose the canonical name for a particular locale. To determine
    86   the canonical name, run the following command, where <replaceable>[locale
    87   name]</replaceable> is the output given by <command>locale -a</command> for
    88   your preferred locale (<quote>en_GB.iso88591</quote> in our example).</para>
    89 
    90 <screen role="nodump"><userinput>LC_ALL=<replaceable>[locale name]</replaceable> locale charmap</userinput></screen>
    91 
    92   <para>For the <quote>en_GB.iso88591</quote> locale, the above command
    93   will print:</para>
    94 
    95 <screen><computeroutput>ISO-8859-1</computeroutput></screen>
    96 
    97   <para>This results in a final locale setting of <quote>en_GB.ISO-8859-1</quote>.
    98   It is important that the locale found using the heuristic above is tested prior
    99   to it being added to the Bash startup files:</para>
    100 
    101 <screen role="nodump"><userinput>LC_ALL=[locale name] locale country
    102 LC_ALL=[locale name] locale language
    103 LC_ALL=[locale name] locale charmap
    104 LC_ALL=[locale name] locale int_curr_symbol
    105 LC_ALL=[locale name] locale int_prefix</userinput></screen>
    106 
    107   <para>The above commands should print the country and language names, the
    108   character encoding used by the locale, the local currency and the prefix
    109   to dial before the telephone number in order to get into the country. If
    110   any of the commands above fail with a message similar to the one shown
    111   below, this means that your locale was either not installed in Chapter 6
    112   or is not supported by the default installation of Glibc.</para>
    113 
    114 <screen><computeroutput>locale: Cannot set LC_* to default locale: No such file or directory</computeroutput></screen>
    115 
    116   <para>If this happens, you should either install the desired locale using
    117   the <command>localedef</command> command, or consider choosing a different
    118   locale. Further instructions assume that there are no such error messages
    119   from Glibc.</para>
    120 
    121   <para>Some packages beyond CLFS may also lack support for your chosen locale.
    122   One example is the X library (part of the X Window System), which outputs
    123   the following error message:</para>
    124 
    125 <screen><computeroutput>Warning: locale not supported by Xlib, locale set to C</computeroutput></screen>
    126 
    127   <para>Sometimes it is possible to fix this by removing the charmap part of
    128   the locale specification, as long as that does not change the character map
    129   that Glibc associates with the locale (this can be checked by running the
    130   <command>locale charmap</command> command in both locales). For example,
    131   one would have to change &quot;de_DE.ISO-8859-15@euro&quot; to
    132   &quot;de_DE@euro&quot; in order to get this locale recognized by Xlib.</para>
    133 
    134   <para>Other packages can also function incorrectly (but may not necessarily
    135   display any error messages) if the locale name does not meet their expectations.
    136   In those cases, investigating how other Linux distributions support your locale
    137   might provide some useful information.</para>
    138 
    139   <para>Once the proper locale settings have been determined, create the
    140   <filename>/etc/profile</filename> file:</para>
    141 
    142 <screen><userinput>cat &gt; ${CLFS}/etc/profile &lt;&lt; "EOF"
    143 <literal># Begin /etc/profile
    144 
    145 export LANG=<replaceable>[ll]</replaceable>_<replaceable>[CC]</replaceable>.<replaceable>[charmap]</replaceable>
    146 export INPUTRC=/etc/inputrc
    147 
    148 # End /etc/profile</literal>
    149 EOF</userinput></screen>
    150 
    151   <note>
    152     <para>The <quote>C</quote> (default) and <quote>en_US</quote>
    153     (the recommended one for United States English users) locales are
    154     different.</para>
    155   </note>
    156 
    157   <para>Setting the keyboard layout, screen font, and locale-related
    158   environment variables are the only internationalization steps needed to
    159   support locales that use ordinary single-byte encodings and left-to-right
    160   writing direction. More complex cases (including UTF-8 based locales)
    161   require additional steps and additional patches because many applications
    162   tend to not work properly under such conditions. These steps and patches
    163   are not included in the CLFS book and such locales are not yet supported
    164   by CLFS.</para>
     40  invoked as an interactive login shell. In the next section, a base
     41  <filename>/etc/profile</filename> will be created to set up locale
     42  information.</para>
    16543
    16644</sect1>
Note: See TracChangeset for help on using the changeset viewer.