Changeset 342b176 for chapter06


Ignore:
Timestamp:
02/09/2004 10:45:54 PM (20 years ago)
Author:
Alex Gronenwoud <alex@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.0, 6.1, 6.1.1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, v5_1, v5_1_1, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
418e6cc
Parents:
c76accc
Message:

Merging configaration subsections into their corresponding sections.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3245 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

Location:
chapter06
Files:
6 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • chapter06/chapter06.xml

    rc76accc r342b176  
    6161</sect1>
    6262
    63 &c6-mountproc;
     63
     64<sect1 id="ch-system-proc">
     65<title>Mounting the proc and devpts file systems</title>
     66<?dbhtml filename="proc.html" dir="chapter06"?>
     67
     68<para>In order for certain programs to function properly, the
     69<emphasis>proc</emphasis> and <emphasis>devpts</emphasis> file systems must be
     70available within the chroot environment. The proc file system is the process
     71information pseudo file system through which the kernel provides information
     72about the status of the system. And the devpts file system is nowadays the most
     73common way pseudo terminals (PTYs) are implemented. Since kernel version 2.4, a
     74file system can be mounted as many times and in as many places as you like,
     75thus it's not a problem that these file systems are already mounted on your
     76host system, especially so because they are virtual file systems.</para>
     77
     78<para>First become <emphasis>root</emphasis>, as only <emphasis>root</emphasis>
     79can mount file systems in unusual places. Then check again that the LFS
     80environment variable is set correctly by running <userinput>echo
     81$LFS</userinput> and making sure it shows the path to your LFS partition's
     82mount point, which is <filename class="directory">/mnt/lfs</filename> if you
     83followed our example.</para>
     84
     85<para>Now make the mount points for these filesystems:</para>
     86
     87<screen><userinput>mkdir -p $LFS/{proc,dev/pts}</userinput></screen>
     88
     89<para>Mount the <emphasis>proc</emphasis> file system with:</para>
     90
     91<screen><userinput>mount proc $LFS/proc -t proc</userinput></screen>
     92
     93<para>And mount the <emphasis>devpts</emphasis> file system with:</para>
     94
     95<screen><userinput>mount devpts $LFS/dev/pts -t devpts</userinput></screen>
     96
     97<para>This last command might fail with an error like:</para>
     98
     99<blockquote><screen>filesystem devpts not supported by kernel</screen></blockquote>
     100
     101<para>The most likely cause for this is that your host system's kernel was
     102compiled without support for the devpts file system. You can check which file
     103systems your kernel supports by peeking into its internals with
     104<command>cat /proc/filesystems</command>. If a file system type named
     105<emphasis>devfs</emphasis> is listed there, then we'll be able to work around
     106the problem by mounting the host's devfs file system on top of the new
     107<filename>/dev</filename> structure which we'll create later on in the section
     108on <xref linkend="ch-system-MAKEDEV"/>. If devfs was not listed, do not worry
     109because there is yet a third way to get PTYs working inside the chroot
     110environment. We'll cover this shortly in the aforementioned
     111<xref linkend="ch-system-MAKEDEV"/> section.</para>
     112
     113<para>Remember that if for any reason you stop working on your LFS, and start
     114again later, it's important to check that these file systems are mounted again
     115before entering the chroot environment, otherwise problems could occur.</para>
     116
     117</sect1>
     118
    64119
    65120<sect1 id="ch-system-chroot">
  • chapter06/glibc.xml

    rc76accc r342b176  
    122122</sect2>
    123123
    124 &c6-cf-glibc;
     124<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
     125
     126<sect2><title>Configuring Glibc</title>
     127
     128<para>We need to create the <filename>/etc/nsswitch.conf</filename> file,
     129because, although Glibc provides defaults when this file is missing or corrupt,
     130the Glibc defaults don't work well with networking. Also, our time zone needs
     131to be set up.</para>
     132
     133<para>Create a new file <filename>/etc/nsswitch.conf</filename> by running the
     134following:</para>
     135
     136<screen><userinput>cat &gt; /etc/nsswitch.conf &lt;&lt; "EOF"</userinput>
     137# Begin /etc/nsswitch.conf
     138
     139passwd: files
     140group: files
     141shadow: files
     142
     143publickey: files
     144
     145hosts: files dns
     146networks: files
     147
     148protocols: db files
     149services: db files
     150ethers: db files
     151rpc: db files
     152
     153netgroup: db files
     154
     155# End /etc/nsswitch.conf
     156<userinput>EOF</userinput></screen>
     157
     158<para>To find out what time zone you're in, run the following script:</para>
     159
     160<screen><userinput>tzselect</userinput></screen>
     161
     162<para>When you've answered a few questions about your location, the script will
     163output the name of your time zone, something like <emphasis>EST5EDT</emphasis>
     164or <emphasis>Canada/Eastern</emphasis>. Then create the
     165<filename>/etc/localtime</filename> file by running:</para>
     166
     167<screen><userinput>cp --remove-destination /usr/share/zoneinfo/Canada/Eastern /etc/localtime</userinput></screen>
     168
     169<para>The meaning of the option:</para>
     170
     171<itemizedlist>
     172<listitem><para><userinput>--remove-destination</userinput>: This is needed to
     173force removal of the already existing symbolic link. The reason why we copy
     174instead of symlink is to cover the situation where <filename>/usr</filename> is
     175on a separate partition. This could matter, for example, when booted into single
     176user mode.</para></listitem>
     177</itemizedlist>
     178
     179<para>Of course, instead of <emphasis>Canada/Eastern</emphasis>, fill in
     180the name of the time zone that the <command>tzselect</command> script
     181gave you.</para>
     182
     183</sect2>
     184
     185<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
     186
     187<sect2>
     188<title>Configuring Dynamic Loader</title>
     189
     190<para>By default, the dynamic loader
     191(<filename>/lib/ld-linux.so.2</filename>) searches through <filename
     192class="directory">/lib</filename> and <filename
     193class="directory">/usr/lib</filename> for dynamic libraries that are needed
     194by programs when you run them. However, if there are libraries in
     195directories other than <filename class="directory">/lib</filename> and
     196<filename class="directory">/usr/lib</filename>, you need to add them to
     197the <filename>/etc/ld.so.conf</filename> file for the dynamic
     198loader to find them. Two directories that are commonly known to contain
     199additional libraries are <filename
     200class="directory">/usr/local/lib</filename> and <filename
     201class="directory">/opt/lib</filename>, so we add those directories to the
     202dynamic loader's search path.</para>
     203
     204<para>Create a new file <filename>/etc/ld.so.conf</filename> by running the
     205following:</para>
     206
     207<screen><userinput>cat &gt; /etc/ld.so.conf &lt;&lt; "EOF"</userinput>
     208# Begin /etc/ld.so.conf
     209
     210/usr/local/lib
     211/opt/lib
     212
     213# End /etc/ld.so.conf
     214<userinput>EOF</userinput></screen>
     215
     216</sect2>
    125217
    126218&aa-glibc-shortdesc;
  • chapter06/kbd.xml

    rc76accc r342b176  
    3636</sect2>
    3737
    38 &c6-cf-keyboard;
     38<sect2><title>Configuring your keyboard</title>
     39
     40<para>Few things are more annoying than using Linux while a wrong keymap
     41for your keyboard is loaded. If you have a standard US keyboard, however, you
     42can skip this section, as the US keymap is the default as long as you don't
     43change it.</para>
     44
     45<para>To change the default keymap, create the
     46<filename class="symlink">/usr/share/kbd/keymaps/defkeymap.map.gz</filename>
     47symlink by running the following command:</para>
     48
     49<screen><userinput>ln -s path/to/keymap /usr/share/kbd/keymaps/defkeymap.map.gz</userinput></screen>
     50
     51<para>Of course, replace <filename>path/to/keymap</filename> with the path and
     52name of your keyboard's map file. For example, if you have a Dutch keyboard,
     53you would use <filename>i386/qwerty/nl.map.gz</filename>.</para>
     54
     55<para>Another way to set your keyboard's layout is to compile the keymap
     56into the kernel. This ensures that your keyboard will always work as expected,
     57even when you boot into maintenance mode (by passing `init=/bin/sh' to the
     58kernel), as then the bootscript that normally sets up your keymap isn't run.</para>
     59
     60<para>When in <xref linkend="chapter-mixture"/> you're ready to compile the
     61kernel, run the following command to patch the current default keymap into the
     62source (you will have to repeat this command whenever you unpack a new
     63kernel):</para>
     64
     65<screen><userinput>loadkeys -m /usr/share/kbd/keymaps/defkeymap.map.gz &gt; \
     66&nbsp;&nbsp;&nbsp;&nbsp;/usr/src/linux-&kernel-version;/drivers/char/defkeymap.c</userinput></screen>
     67
     68</sect2>
    3969
    4070&aa-kbd-shortdesc;
  • chapter06/sysklogd.xml

    rc76accc r342b176  
    2727</sect2>
    2828
    29 &c6-cf-sysklogd;
     29<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
     30
     31<sect2><title>Configuring Sysklogd</title>
     32
     33<para>Create a new <filename>/etc/syslog.conf</filename> file by running the
     34following:</para>
     35
     36<screen><userinput>cat &gt; /etc/syslog.conf &lt;&lt; "EOF"</userinput>
     37# Begin /etc/syslog.conf
     38
     39auth,authpriv.* -/var/log/auth.log
     40*.*;auth,authpriv.none -/var/log/sys.log
     41daemon.* -/var/log/daemon.log
     42kern.* -/var/log/kern.log
     43mail.* -/var/log/mail.log
     44user.* -/var/log/user.log
     45*.emerg *
     46
     47# End /etc/syslog.conf
     48<userinput>EOF</userinput></screen>
     49
     50</sect2>
    3051
    3152&aa-sysklogd-shortdesc;
  • chapter06/sysvinit.xml

    rc76accc r342b176  
    1717<title>Installation of Sysvinit</title>
    1818
    19 <para>When run levels are changed (for example, when halting the system),
    20 init sends the TERM and KILL signals to the processes which it started.
    21 Init prints "Sending processes the TERM signal" to the screen. This seems
    22 to imply that init is sending these signals to all the currently running
    23 processes. To avoid this confusion, the init.c file can be modified, so
    24 that the sentence reads "Sending processes started by init the TERM
    25 signal".</para>
    26 
    27 <para>Edit the halt message:</para>
     19<para>When runlevels are changed (for example, when halting the system),
     20<command>init</command> sends termination signals to those processes that it
     21itself started and that shouldn't be running in the new runlevel. While doing
     22this, <command>init</command> outputs messages like "Sending processes the TERM
     23signal" which seem to imply that it is sending these signals to all currently
     24running processes. To avoid this misinterpretation, you can modify the source
     25so that these messages read like "Sending processes started by init the TERM
     26signal" instead:</para>
    2827
    2928<screen><userinput>cp src/init.c{,.backup}
     
    4140</sect2>
    4241
    43 &c6-cf-sysvinit;
     42<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
     43
     44<sect2><title>Configuring Sysvinit</title>
     45
     46<para>Create a new <filename>/etc/inittab</filename> file by running the
     47following:</para>
     48
     49<screen><userinput>cat &gt; /etc/inittab &lt;&lt; "EOF"</userinput>
     50# Begin /etc/inittab
     51
     52id:3:initdefault:
     53
     54si::sysinit:/etc/rc.d/init.d/rc sysinit
     55
     56l0:0:wait:/etc/rc.d/init.d/rc 0
     57l1:S1:wait:/etc/rc.d/init.d/rc 1
     58l2:2:wait:/etc/rc.d/init.d/rc 2
     59l3:3:wait:/etc/rc.d/init.d/rc 3
     60l4:4:wait:/etc/rc.d/init.d/rc 4
     61l5:5:wait:/etc/rc.d/init.d/rc 5
     62l6:6:wait:/etc/rc.d/init.d/rc 6
     63
     64ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
     65
     66su:S016:once:/sbin/sulogin
     67
     681:2345:respawn:/sbin/agetty tty1 9600
     692:2345:respawn:/sbin/agetty tty2 9600
     703:2345:respawn:/sbin/agetty tty3 9600
     714:2345:respawn:/sbin/agetty tty4 9600
     725:2345:respawn:/sbin/agetty tty5 9600
     736:2345:respawn:/sbin/agetty tty6 9600
     74
     75# End /etc/inittab
     76<userinput>EOF</userinput></screen>
     77
     78</sect2>
    4479
    4580&aa-sysvinit-shortdesc;
  • chapter06/vim.xml

    rc76accc r342b176  
    6262</sect2>
    6363
    64 &c6-cf-vim;
     64<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
     65
     66<sect2><title>Configuring Vim</title>
     67
     68<para>By default, <command>vim</command> runs in vi-compatible mode. Some
     69people might like this, but we prefer to run <command>vim</command> in its
     70own mode (else we wouldn't have included it in this book, but the original
     71<command>vi</command>). Create a default vim configuration file by running
     72the following:</para>
     73
     74<screen><userinput>cat &gt; /etc/vimrc &lt;&lt; "EOF"</userinput>
     75" Begin /etc/vimrc
     76
     77set nocompatible
     78set backspace=2
     79syntax on
     80
     81" End /etc/vimrc
     82<userinput>EOF</userinput></screen>
     83
     84<para>The <emphasis>set nocompatible</emphasis> will make
     85<command>vim</command> behave in a more useful way than the default
     86vi-compatible manner. The <emphasis>set backspace=2</emphasis> allows
     87backspacing over line breaks, autoindent and the start of insert. And the
     88<emphasis>syntax on</emphasis> switches on <command>vim</command>'s
     89semantic colouring.</para>
     90
     91</sect2>
    6592
    6693&aa-vim-shortdesc;
Note: See TracChangeset for help on using the changeset viewer.