mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-06-19 03:39:20 +01:00
Merging configaration subsections into their corresponding sections.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3245 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
c76accc624
commit
342b176cf9
@ -60,7 +60,62 @@ with a series of short descriptions of these.</para>
|
|||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
&c6-mountproc;
|
|
||||||
|
<sect1 id="ch-system-proc">
|
||||||
|
<title>Mounting the proc and devpts file systems</title>
|
||||||
|
<?dbhtml filename="proc.html" dir="chapter06"?>
|
||||||
|
|
||||||
|
<para>In order for certain programs to function properly, the
|
||||||
|
<emphasis>proc</emphasis> and <emphasis>devpts</emphasis> file systems must be
|
||||||
|
available within the chroot environment. The proc file system is the process
|
||||||
|
information pseudo file system through which the kernel provides information
|
||||||
|
about the status of the system. And the devpts file system is nowadays the most
|
||||||
|
common way pseudo terminals (PTYs) are implemented. Since kernel version 2.4, a
|
||||||
|
file system can be mounted as many times and in as many places as you like,
|
||||||
|
thus it's not a problem that these file systems are already mounted on your
|
||||||
|
host system, especially so because they are virtual file systems.</para>
|
||||||
|
|
||||||
|
<para>First become <emphasis>root</emphasis>, as only <emphasis>root</emphasis>
|
||||||
|
can mount file systems in unusual places. Then check again that the LFS
|
||||||
|
environment variable is set correctly by running <userinput>echo
|
||||||
|
$LFS</userinput> and making sure it shows the path to your LFS partition's
|
||||||
|
mount point, which is <filename class="directory">/mnt/lfs</filename> if you
|
||||||
|
followed our example.</para>
|
||||||
|
|
||||||
|
<para>Now make the mount points for these filesystems:</para>
|
||||||
|
|
||||||
|
<screen><userinput>mkdir -p $LFS/{proc,dev/pts}</userinput></screen>
|
||||||
|
|
||||||
|
<para>Mount the <emphasis>proc</emphasis> file system with:</para>
|
||||||
|
|
||||||
|
<screen><userinput>mount proc $LFS/proc -t proc</userinput></screen>
|
||||||
|
|
||||||
|
<para>And mount the <emphasis>devpts</emphasis> file system with:</para>
|
||||||
|
|
||||||
|
<screen><userinput>mount devpts $LFS/dev/pts -t devpts</userinput></screen>
|
||||||
|
|
||||||
|
<para>This last command might fail with an error like:</para>
|
||||||
|
|
||||||
|
<blockquote><screen>filesystem devpts not supported by kernel</screen></blockquote>
|
||||||
|
|
||||||
|
<para>The most likely cause for this is that your host system's kernel was
|
||||||
|
compiled without support for the devpts file system. You can check which file
|
||||||
|
systems your kernel supports by peeking into its internals with
|
||||||
|
<command>cat /proc/filesystems</command>. If a file system type named
|
||||||
|
<emphasis>devfs</emphasis> is listed there, then we'll be able to work around
|
||||||
|
the problem by mounting the host's devfs file system on top of the new
|
||||||
|
<filename>/dev</filename> structure which we'll create later on in the section
|
||||||
|
on <xref linkend="ch-system-MAKEDEV"/>. If devfs was not listed, do not worry
|
||||||
|
because there is yet a third way to get PTYs working inside the chroot
|
||||||
|
environment. We'll cover this shortly in the aforementioned
|
||||||
|
<xref linkend="ch-system-MAKEDEV"/> section.</para>
|
||||||
|
|
||||||
|
<para>Remember that if for any reason you stop working on your LFS, and start
|
||||||
|
again later, it's important to check that these file systems are mounted again
|
||||||
|
before entering the chroot environment, otherwise problems could occur.</para>
|
||||||
|
|
||||||
|
</sect1>
|
||||||
|
|
||||||
|
|
||||||
<sect1 id="ch-system-chroot">
|
<sect1 id="ch-system-chroot">
|
||||||
<title>Entering the chroot environment</title>
|
<title>Entering the chroot environment</title>
|
||||||
|
@ -1,94 +0,0 @@
|
|||||||
<sect2><title> </title><para> </para></sect2>
|
|
||||||
|
|
||||||
<sect2><title>Configuring Glibc</title>
|
|
||||||
|
|
||||||
<para>We need to create the <filename>/etc/nsswitch.conf</filename> file,
|
|
||||||
because, although Glibc provides defaults when this file is missing or corrupt,
|
|
||||||
the Glibc defaults don't work well with networking. Also, our time zone needs
|
|
||||||
to be set up.</para>
|
|
||||||
|
|
||||||
<para>Create a new file <filename>/etc/nsswitch.conf</filename> by running the
|
|
||||||
following:</para>
|
|
||||||
|
|
||||||
<screen><userinput>cat > /etc/nsswitch.conf << "EOF"</userinput>
|
|
||||||
# Begin /etc/nsswitch.conf
|
|
||||||
|
|
||||||
passwd: files
|
|
||||||
group: files
|
|
||||||
shadow: files
|
|
||||||
|
|
||||||
publickey: files
|
|
||||||
|
|
||||||
hosts: files dns
|
|
||||||
networks: files
|
|
||||||
|
|
||||||
protocols: db files
|
|
||||||
services: db files
|
|
||||||
ethers: db files
|
|
||||||
rpc: db files
|
|
||||||
|
|
||||||
netgroup: db files
|
|
||||||
|
|
||||||
# End /etc/nsswitch.conf
|
|
||||||
<userinput>EOF</userinput></screen>
|
|
||||||
|
|
||||||
<para>To find out what time zone you're in, run the following script:</para>
|
|
||||||
|
|
||||||
<screen><userinput>tzselect</userinput></screen>
|
|
||||||
|
|
||||||
<para>When you've answered a few questions about your location, the script will
|
|
||||||
output the name of your time zone, something like <emphasis>EST5EDT</emphasis>
|
|
||||||
or <emphasis>Canada/Eastern</emphasis>. Then create the
|
|
||||||
<filename>/etc/localtime</filename> file by running:</para>
|
|
||||||
|
|
||||||
<screen><userinput>cp --remove-destination /usr/share/zoneinfo/Canada/Eastern /etc/localtime</userinput></screen>
|
|
||||||
|
|
||||||
<para>The meaning of the option:</para>
|
|
||||||
|
|
||||||
<itemizedlist>
|
|
||||||
<listitem><para><userinput>--remove-destination</userinput>: This is needed to
|
|
||||||
force removal of the already existing symbolic link. The reason why we copy
|
|
||||||
instead of symlink is to cover the situation where <filename>/usr</filename> is
|
|
||||||
on a separate partition. This could matter, for example, when booted into single
|
|
||||||
user mode.</para></listitem>
|
|
||||||
</itemizedlist>
|
|
||||||
|
|
||||||
<para>Of course, instead of <emphasis>Canada/Eastern</emphasis>, fill in
|
|
||||||
the name of the time zone that the <command>tzselect</command> script
|
|
||||||
gave you.</para>
|
|
||||||
|
|
||||||
</sect2>
|
|
||||||
|
|
||||||
<sect2><title> </title><para> </para></sect2>
|
|
||||||
|
|
||||||
<sect2>
|
|
||||||
<title>Configuring Dynamic Loader</title>
|
|
||||||
|
|
||||||
<para>By default, the dynamic loader
|
|
||||||
(<filename>/lib/ld-linux.so.2</filename>) searches through <filename
|
|
||||||
class="directory">/lib</filename> and <filename
|
|
||||||
class="directory">/usr/lib</filename> for dynamic libraries that are needed
|
|
||||||
by programs when you run them. However, if there are libraries in
|
|
||||||
directories other than <filename class="directory">/lib</filename> and
|
|
||||||
<filename class="directory">/usr/lib</filename>, you need to add them to
|
|
||||||
the <filename>/etc/ld.so.conf</filename> file for the dynamic
|
|
||||||
loader to find them. Two directories that are commonly known to contain
|
|
||||||
additional libraries are <filename
|
|
||||||
class="directory">/usr/local/lib</filename> and <filename
|
|
||||||
class="directory">/opt/lib</filename>, so we add those directories to the
|
|
||||||
dynamic loader's search path.</para>
|
|
||||||
|
|
||||||
<para>Create a new file <filename>/etc/ld.so.conf</filename> by running the
|
|
||||||
following:</para>
|
|
||||||
|
|
||||||
<screen><userinput>cat > /etc/ld.so.conf << "EOF"</userinput>
|
|
||||||
# Begin /etc/ld.so.conf
|
|
||||||
|
|
||||||
/usr/local/lib
|
|
||||||
/opt/lib
|
|
||||||
|
|
||||||
# End /etc/ld.so.conf
|
|
||||||
<userinput>EOF</userinput></screen>
|
|
||||||
|
|
||||||
</sect2>
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
|||||||
<sect2><title>Configuring your keyboard</title>
|
|
||||||
|
|
||||||
<para>Few things are more annoying than using Linux while a wrong keymap
|
|
||||||
for your keyboard is loaded. If you have a standard US keyboard, however, you
|
|
||||||
can skip this section, as the US keymap is the default as long as you don't
|
|
||||||
change it.</para>
|
|
||||||
|
|
||||||
<para>To change the default keymap, create the
|
|
||||||
<filename class="symlink">/usr/share/kbd/keymaps/defkeymap.map.gz</filename>
|
|
||||||
symlink by running the following command:</para>
|
|
||||||
|
|
||||||
<screen><userinput>ln -s path/to/keymap /usr/share/kbd/keymaps/defkeymap.map.gz</userinput></screen>
|
|
||||||
|
|
||||||
<para>Of course, replace <filename>path/to/keymap</filename> with the path and
|
|
||||||
name of your keyboard's map file. For example, if you have a Dutch keyboard,
|
|
||||||
you would use <filename>i386/qwerty/nl.map.gz</filename>.</para>
|
|
||||||
|
|
||||||
<para>Another way to set your keyboard's layout is to compile the keymap
|
|
||||||
into the kernel. This ensures that your keyboard will always work as expected,
|
|
||||||
even when you boot into maintenance mode (by passing `init=/bin/sh' to the
|
|
||||||
kernel), as then the bootscript that normally sets up your keymap isn't run.</para>
|
|
||||||
|
|
||||||
<para>Run the following command to patch the current default keymap into the
|
|
||||||
kernel source. You will have to repeat this command whenever you unpack a
|
|
||||||
new kernel:</para>
|
|
||||||
|
|
||||||
<screen><userinput>loadkeys -m /usr/share/kbd/keymaps/defkeymap.map.gz > \
|
|
||||||
/usr/src/linux-&kernel-version;/drivers/char/defkeymap.c</userinput></screen>
|
|
||||||
|
|
||||||
</sect2>
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
<sect2><title> </title><para> </para></sect2>
|
|
||||||
|
|
||||||
<sect2><title>Configuring Sysklogd</title>
|
|
||||||
|
|
||||||
<para>Create a new file <filename>/etc/syslog.conf</filename> by running the
|
|
||||||
following:</para>
|
|
||||||
|
|
||||||
<screen><userinput>cat > /etc/syslog.conf << "EOF"</userinput>
|
|
||||||
# Begin /etc/syslog.conf
|
|
||||||
|
|
||||||
auth,authpriv.* -/var/log/auth.log
|
|
||||||
*.*;auth,authpriv.none -/var/log/sys.log
|
|
||||||
daemon.* -/var/log/daemon.log
|
|
||||||
kern.* -/var/log/kern.log
|
|
||||||
mail.* -/var/log/mail.log
|
|
||||||
user.* -/var/log/user.log
|
|
||||||
*.emerg *
|
|
||||||
|
|
||||||
# End /etc/syslog.conf
|
|
||||||
<userinput>EOF</userinput></screen>
|
|
||||||
|
|
||||||
</sect2>
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
|||||||
<sect2><title> </title><para> </para></sect2>
|
|
||||||
|
|
||||||
<sect2><title>Configuring Sysvinit</title>
|
|
||||||
|
|
||||||
<para>Create a new file <filename>/etc/inittab</filename> by running the
|
|
||||||
following:</para>
|
|
||||||
|
|
||||||
<screen><userinput>cat > /etc/inittab << "EOF"</userinput>
|
|
||||||
# Begin /etc/inittab
|
|
||||||
|
|
||||||
id:3:initdefault:
|
|
||||||
|
|
||||||
si::sysinit:/etc/rc.d/init.d/rc sysinit
|
|
||||||
|
|
||||||
l0:0:wait:/etc/rc.d/init.d/rc 0
|
|
||||||
l1:S1:wait:/etc/rc.d/init.d/rc 1
|
|
||||||
l2:2:wait:/etc/rc.d/init.d/rc 2
|
|
||||||
l3:3:wait:/etc/rc.d/init.d/rc 3
|
|
||||||
l4:4:wait:/etc/rc.d/init.d/rc 4
|
|
||||||
l5:5:wait:/etc/rc.d/init.d/rc 5
|
|
||||||
l6:6:wait:/etc/rc.d/init.d/rc 6
|
|
||||||
|
|
||||||
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
|
|
||||||
|
|
||||||
su:S016:once:/sbin/sulogin
|
|
||||||
|
|
||||||
1:2345:respawn:/sbin/agetty tty1 9600
|
|
||||||
2:2345:respawn:/sbin/agetty tty2 9600
|
|
||||||
3:2345:respawn:/sbin/agetty tty3 9600
|
|
||||||
4:2345:respawn:/sbin/agetty tty4 9600
|
|
||||||
5:2345:respawn:/sbin/agetty tty5 9600
|
|
||||||
6:2345:respawn:/sbin/agetty tty6 9600
|
|
||||||
|
|
||||||
# End /etc/inittab
|
|
||||||
<userinput>EOF</userinput></screen>
|
|
||||||
|
|
||||||
</sect2>
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
<sect2><title> </title><para> </para></sect2>
|
|
||||||
|
|
||||||
<sect2><title>Configuring Vim</title>
|
|
||||||
|
|
||||||
<para>By default, <command>vim</command> runs in vi-compatible mode. Some
|
|
||||||
people might like this, but we prefer to run <command>vim</command> in its
|
|
||||||
own mode (else we wouldn't have included it in this book, but the original
|
|
||||||
<command>vi</command>). Create a default vim configuration file by running
|
|
||||||
the following:</para>
|
|
||||||
|
|
||||||
<screen><userinput>cat > /etc/vimrc << "EOF"</userinput>
|
|
||||||
" Begin /etc/vimrc
|
|
||||||
|
|
||||||
set nocompatible
|
|
||||||
set backspace=2
|
|
||||||
syntax on
|
|
||||||
|
|
||||||
" End /etc/vimrc
|
|
||||||
<userinput>EOF</userinput></screen>
|
|
||||||
|
|
||||||
<para>The <emphasis>set nocompatible</emphasis> will make
|
|
||||||
<command>vim</command> behave in a more useful way than the default
|
|
||||||
vi-compatible manner. The <emphasis>set backspace=2</emphasis> allows
|
|
||||||
backspacing over line breaks, autoindent and the start of insert. And the
|
|
||||||
<emphasis>syntax on</emphasis> switches on <command>vim</command>'s
|
|
||||||
semantic colouring.</para>
|
|
||||||
|
|
||||||
</sect2>
|
|
||||||
|
|
@ -121,7 +121,99 @@ localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen>
|
|||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
&c6-cf-glibc;
|
<sect2><title> </title><para> </para></sect2>
|
||||||
|
|
||||||
|
<sect2><title>Configuring Glibc</title>
|
||||||
|
|
||||||
|
<para>We need to create the <filename>/etc/nsswitch.conf</filename> file,
|
||||||
|
because, although Glibc provides defaults when this file is missing or corrupt,
|
||||||
|
the Glibc defaults don't work well with networking. Also, our time zone needs
|
||||||
|
to be set up.</para>
|
||||||
|
|
||||||
|
<para>Create a new file <filename>/etc/nsswitch.conf</filename> by running the
|
||||||
|
following:</para>
|
||||||
|
|
||||||
|
<screen><userinput>cat > /etc/nsswitch.conf << "EOF"</userinput>
|
||||||
|
# Begin /etc/nsswitch.conf
|
||||||
|
|
||||||
|
passwd: files
|
||||||
|
group: files
|
||||||
|
shadow: files
|
||||||
|
|
||||||
|
publickey: files
|
||||||
|
|
||||||
|
hosts: files dns
|
||||||
|
networks: files
|
||||||
|
|
||||||
|
protocols: db files
|
||||||
|
services: db files
|
||||||
|
ethers: db files
|
||||||
|
rpc: db files
|
||||||
|
|
||||||
|
netgroup: db files
|
||||||
|
|
||||||
|
# End /etc/nsswitch.conf
|
||||||
|
<userinput>EOF</userinput></screen>
|
||||||
|
|
||||||
|
<para>To find out what time zone you're in, run the following script:</para>
|
||||||
|
|
||||||
|
<screen><userinput>tzselect</userinput></screen>
|
||||||
|
|
||||||
|
<para>When you've answered a few questions about your location, the script will
|
||||||
|
output the name of your time zone, something like <emphasis>EST5EDT</emphasis>
|
||||||
|
or <emphasis>Canada/Eastern</emphasis>. Then create the
|
||||||
|
<filename>/etc/localtime</filename> file by running:</para>
|
||||||
|
|
||||||
|
<screen><userinput>cp --remove-destination /usr/share/zoneinfo/Canada/Eastern /etc/localtime</userinput></screen>
|
||||||
|
|
||||||
|
<para>The meaning of the option:</para>
|
||||||
|
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem><para><userinput>--remove-destination</userinput>: This is needed to
|
||||||
|
force removal of the already existing symbolic link. The reason why we copy
|
||||||
|
instead of symlink is to cover the situation where <filename>/usr</filename> is
|
||||||
|
on a separate partition. This could matter, for example, when booted into single
|
||||||
|
user mode.</para></listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
|
||||||
|
<para>Of course, instead of <emphasis>Canada/Eastern</emphasis>, fill in
|
||||||
|
the name of the time zone that the <command>tzselect</command> script
|
||||||
|
gave you.</para>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
|
||||||
|
<sect2><title> </title><para> </para></sect2>
|
||||||
|
|
||||||
|
<sect2>
|
||||||
|
<title>Configuring Dynamic Loader</title>
|
||||||
|
|
||||||
|
<para>By default, the dynamic loader
|
||||||
|
(<filename>/lib/ld-linux.so.2</filename>) searches through <filename
|
||||||
|
class="directory">/lib</filename> and <filename
|
||||||
|
class="directory">/usr/lib</filename> for dynamic libraries that are needed
|
||||||
|
by programs when you run them. However, if there are libraries in
|
||||||
|
directories other than <filename class="directory">/lib</filename> and
|
||||||
|
<filename class="directory">/usr/lib</filename>, you need to add them to
|
||||||
|
the <filename>/etc/ld.so.conf</filename> file for the dynamic
|
||||||
|
loader to find them. Two directories that are commonly known to contain
|
||||||
|
additional libraries are <filename
|
||||||
|
class="directory">/usr/local/lib</filename> and <filename
|
||||||
|
class="directory">/opt/lib</filename>, so we add those directories to the
|
||||||
|
dynamic loader's search path.</para>
|
||||||
|
|
||||||
|
<para>Create a new file <filename>/etc/ld.so.conf</filename> by running the
|
||||||
|
following:</para>
|
||||||
|
|
||||||
|
<screen><userinput>cat > /etc/ld.so.conf << "EOF"</userinput>
|
||||||
|
# Begin /etc/ld.so.conf
|
||||||
|
|
||||||
|
/usr/local/lib
|
||||||
|
/opt/lib
|
||||||
|
|
||||||
|
# End /etc/ld.so.conf
|
||||||
|
<userinput>EOF</userinput></screen>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
|
||||||
&aa-glibc-shortdesc;
|
&aa-glibc-shortdesc;
|
||||||
&aa-glibc-desc;
|
&aa-glibc-desc;
|
||||||
|
@ -35,7 +35,37 @@ not installed. First enable the compilation of these utilities:</para>
|
|||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
&c6-cf-keyboard;
|
<sect2><title>Configuring your keyboard</title>
|
||||||
|
|
||||||
|
<para>Few things are more annoying than using Linux while a wrong keymap
|
||||||
|
for your keyboard is loaded. If you have a standard US keyboard, however, you
|
||||||
|
can skip this section, as the US keymap is the default as long as you don't
|
||||||
|
change it.</para>
|
||||||
|
|
||||||
|
<para>To change the default keymap, create the
|
||||||
|
<filename class="symlink">/usr/share/kbd/keymaps/defkeymap.map.gz</filename>
|
||||||
|
symlink by running the following command:</para>
|
||||||
|
|
||||||
|
<screen><userinput>ln -s path/to/keymap /usr/share/kbd/keymaps/defkeymap.map.gz</userinput></screen>
|
||||||
|
|
||||||
|
<para>Of course, replace <filename>path/to/keymap</filename> with the path and
|
||||||
|
name of your keyboard's map file. For example, if you have a Dutch keyboard,
|
||||||
|
you would use <filename>i386/qwerty/nl.map.gz</filename>.</para>
|
||||||
|
|
||||||
|
<para>Another way to set your keyboard's layout is to compile the keymap
|
||||||
|
into the kernel. This ensures that your keyboard will always work as expected,
|
||||||
|
even when you boot into maintenance mode (by passing `init=/bin/sh' to the
|
||||||
|
kernel), as then the bootscript that normally sets up your keymap isn't run.</para>
|
||||||
|
|
||||||
|
<para>When in <xref linkend="chapter-mixture"/> you're ready to compile the
|
||||||
|
kernel, run the following command to patch the current default keymap into the
|
||||||
|
source (you will have to repeat this command whenever you unpack a new
|
||||||
|
kernel):</para>
|
||||||
|
|
||||||
|
<screen><userinput>loadkeys -m /usr/share/kbd/keymaps/defkeymap.map.gz > \
|
||||||
|
/usr/src/linux-&kernel-version;/drivers/char/defkeymap.c</userinput></screen>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
|
||||||
&aa-kbd-shortdesc;
|
&aa-kbd-shortdesc;
|
||||||
&aa-kbd-desc;
|
&aa-kbd-desc;
|
||||||
|
@ -1,55 +0,0 @@
|
|||||||
<sect1 id="ch-system-proc">
|
|
||||||
<title>Mounting the proc and devpts file systems</title>
|
|
||||||
<?dbhtml filename="proc.html" dir="chapter06"?>
|
|
||||||
|
|
||||||
<para>In order for certain programs to function properly, the
|
|
||||||
<emphasis>proc</emphasis> and <emphasis>devpts</emphasis> file systems must be
|
|
||||||
available within the chroot environment. The proc file system is the process
|
|
||||||
information pseudo file system through which the kernel provides information
|
|
||||||
about the status of the system. And the devpts file system is nowadays the most
|
|
||||||
common way pseudo terminals (PTYs) are implemented. Since kernel version 2.4, a
|
|
||||||
file system can be mounted as many times and in as many places as you like,
|
|
||||||
thus it's not a problem that these file systems are already mounted on your
|
|
||||||
host system, especially so because they are virtual file systems.</para>
|
|
||||||
|
|
||||||
<para>First become <emphasis>root</emphasis>, as only <emphasis>root</emphasis>
|
|
||||||
can mount file systems in unusual places. Then check again that the LFS
|
|
||||||
environment variable is set correctly by running <userinput>echo
|
|
||||||
$LFS</userinput> and making sure it shows the path to your LFS partition's
|
|
||||||
mount point, which is <filename class="directory">/mnt/lfs</filename> if you
|
|
||||||
followed our example.</para>
|
|
||||||
|
|
||||||
<para>Now make the mount points for these filesystems:</para>
|
|
||||||
|
|
||||||
<screen><userinput>mkdir -p $LFS/{proc,dev/pts}</userinput></screen>
|
|
||||||
|
|
||||||
<para>Mount the <emphasis>proc</emphasis> file system with:</para>
|
|
||||||
|
|
||||||
<screen><userinput>mount proc $LFS/proc -t proc</userinput></screen>
|
|
||||||
|
|
||||||
<para>And mount the <emphasis>devpts</emphasis> file system with:</para>
|
|
||||||
|
|
||||||
<screen><userinput>mount devpts $LFS/dev/pts -t devpts</userinput></screen>
|
|
||||||
|
|
||||||
<para>This last command might fail with an error like:</para>
|
|
||||||
|
|
||||||
<blockquote><screen>filesystem devpts not supported by kernel</screen></blockquote>
|
|
||||||
|
|
||||||
<para>The most likely cause for this is that your host system's kernel was
|
|
||||||
compiled without support for the devpts file system. You can check which file
|
|
||||||
systems your kernel supports by peeking into its internals with
|
|
||||||
<command>cat /proc/filesystems</command>. If a file system type named
|
|
||||||
<emphasis>devfs</emphasis> is listed there, then we'll be able to work around
|
|
||||||
the problem by mounting the host's devfs file system on top of the new
|
|
||||||
<filename>/dev</filename> structure which we'll create later on in the section
|
|
||||||
on <xref linkend="ch-system-MAKEDEV"/>. If devfs was not listed, do not worry
|
|
||||||
because there is yet a third way to get PTYs working inside the chroot
|
|
||||||
environment. We'll cover this shortly in the aforementioned
|
|
||||||
<xref linkend="ch-system-MAKEDEV"/> section.</para>
|
|
||||||
|
|
||||||
<para>Remember that if for any reason you stop working on your LFS, and start
|
|
||||||
again later, it's important to check that these file systems are mounted again
|
|
||||||
before entering the chroot environment, otherwise problems could occur.</para>
|
|
||||||
|
|
||||||
</sect1>
|
|
||||||
|
|
@ -26,7 +26,28 @@ as those given by the kernel when unusual things happen.</para>
|
|||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
&c6-cf-sysklogd;
|
<sect2><title> </title><para> </para></sect2>
|
||||||
|
|
||||||
|
<sect2><title>Configuring Sysklogd</title>
|
||||||
|
|
||||||
|
<para>Create a new <filename>/etc/syslog.conf</filename> file by running the
|
||||||
|
following:</para>
|
||||||
|
|
||||||
|
<screen><userinput>cat > /etc/syslog.conf << "EOF"</userinput>
|
||||||
|
# Begin /etc/syslog.conf
|
||||||
|
|
||||||
|
auth,authpriv.* -/var/log/auth.log
|
||||||
|
*.*;auth,authpriv.none -/var/log/sys.log
|
||||||
|
daemon.* -/var/log/daemon.log
|
||||||
|
kern.* -/var/log/kern.log
|
||||||
|
mail.* -/var/log/mail.log
|
||||||
|
user.* -/var/log/user.log
|
||||||
|
*.emerg *
|
||||||
|
|
||||||
|
# End /etc/syslog.conf
|
||||||
|
<userinput>EOF</userinput></screen>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
|
||||||
&aa-sysklogd-shortdesc;
|
&aa-sysklogd-shortdesc;
|
||||||
&aa-sysklogd-desc;
|
&aa-sysklogd-desc;
|
||||||
|
@ -17,14 +17,13 @@ running, and shutdown of your system.</para>
|
|||||||
<title>Installation of Sysvinit</title>
|
<title>Installation of Sysvinit</title>
|
||||||
|
|
||||||
<para>When runlevels are changed (for example, when halting the system),
|
<para>When runlevels are changed (for example, when halting the system),
|
||||||
init sends the TERM and KILL signals to the processes which it started.
|
<command>init</command> sends termination signals to those processes that it
|
||||||
Init prints "Sending processes the TERM signal" to the screen. This seems
|
itself started and that shouldn't be running in the new runlevel. While doing
|
||||||
to imply that init is sending these signals to all the currently running
|
this, <command>init</command> outputs messages like "Sending processes the TERM
|
||||||
processes. To avoid this confusion, the init.c file can be modified, so
|
signal" which seem to imply that it is sending these signals to all currently
|
||||||
that the sentence reads "Sending processes started by init the TERM
|
running processes. To avoid this misinterpretation, you can modify the source
|
||||||
signal".</para>
|
so that these messages read like "Sending processes started by init the TERM
|
||||||
|
signal" instead:</para>
|
||||||
<para>Edit the halt message:</para>
|
|
||||||
|
|
||||||
<screen><userinput>cp src/init.c{,.backup}
|
<screen><userinput>cp src/init.c{,.backup}
|
||||||
sed 's/Sending processes/& started by init/g' \
|
sed 's/Sending processes/& started by init/g' \
|
||||||
@ -40,7 +39,43 @@ sed 's/Sending processes/& started by init/g' \
|
|||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
&c6-cf-sysvinit;
|
<sect2><title> </title><para> </para></sect2>
|
||||||
|
|
||||||
|
<sect2><title>Configuring Sysvinit</title>
|
||||||
|
|
||||||
|
<para>Create a new <filename>/etc/inittab</filename> file by running the
|
||||||
|
following:</para>
|
||||||
|
|
||||||
|
<screen><userinput>cat > /etc/inittab << "EOF"</userinput>
|
||||||
|
# Begin /etc/inittab
|
||||||
|
|
||||||
|
id:3:initdefault:
|
||||||
|
|
||||||
|
si::sysinit:/etc/rc.d/init.d/rc sysinit
|
||||||
|
|
||||||
|
l0:0:wait:/etc/rc.d/init.d/rc 0
|
||||||
|
l1:S1:wait:/etc/rc.d/init.d/rc 1
|
||||||
|
l2:2:wait:/etc/rc.d/init.d/rc 2
|
||||||
|
l3:3:wait:/etc/rc.d/init.d/rc 3
|
||||||
|
l4:4:wait:/etc/rc.d/init.d/rc 4
|
||||||
|
l5:5:wait:/etc/rc.d/init.d/rc 5
|
||||||
|
l6:6:wait:/etc/rc.d/init.d/rc 6
|
||||||
|
|
||||||
|
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
|
||||||
|
|
||||||
|
su:S016:once:/sbin/sulogin
|
||||||
|
|
||||||
|
1:2345:respawn:/sbin/agetty tty1 9600
|
||||||
|
2:2345:respawn:/sbin/agetty tty2 9600
|
||||||
|
3:2345:respawn:/sbin/agetty tty3 9600
|
||||||
|
4:2345:respawn:/sbin/agetty tty4 9600
|
||||||
|
5:2345:respawn:/sbin/agetty tty5 9600
|
||||||
|
6:2345:respawn:/sbin/agetty tty6 9600
|
||||||
|
|
||||||
|
# End /etc/inittab
|
||||||
|
<userinput>EOF</userinput></screen>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
|
||||||
&aa-sysvinit-shortdesc;
|
&aa-sysvinit-shortdesc;
|
||||||
&aa-sysvinit-desc;
|
&aa-sysvinit-desc;
|
||||||
|
@ -61,7 +61,34 @@ installed. For more information read the Vim documentation.</para>
|
|||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
&c6-cf-vim;
|
<sect2><title> </title><para> </para></sect2>
|
||||||
|
|
||||||
|
<sect2><title>Configuring Vim</title>
|
||||||
|
|
||||||
|
<para>By default, <command>vim</command> runs in vi-compatible mode. Some
|
||||||
|
people might like this, but we prefer to run <command>vim</command> in its
|
||||||
|
own mode (else we wouldn't have included it in this book, but the original
|
||||||
|
<command>vi</command>). Create a default vim configuration file by running
|
||||||
|
the following:</para>
|
||||||
|
|
||||||
|
<screen><userinput>cat > /etc/vimrc << "EOF"</userinput>
|
||||||
|
" Begin /etc/vimrc
|
||||||
|
|
||||||
|
set nocompatible
|
||||||
|
set backspace=2
|
||||||
|
syntax on
|
||||||
|
|
||||||
|
" End /etc/vimrc
|
||||||
|
<userinput>EOF</userinput></screen>
|
||||||
|
|
||||||
|
<para>The <emphasis>set nocompatible</emphasis> will make
|
||||||
|
<command>vim</command> behave in a more useful way than the default
|
||||||
|
vi-compatible manner. The <emphasis>set backspace=2</emphasis> allows
|
||||||
|
backspacing over line breaks, autoindent and the start of insert. And the
|
||||||
|
<emphasis>syntax on</emphasis> switches on <command>vim</command>'s
|
||||||
|
semantic colouring.</para>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
|
||||||
&aa-vim-shortdesc;
|
&aa-vim-shortdesc;
|
||||||
&aa-vim-desc;
|
&aa-vim-desc;
|
||||||
|
@ -29,9 +29,6 @@
|
|||||||
|
|
||||||
<!ENTITY chapter06 SYSTEM "../chapter06/chapter06.xml">
|
<!ENTITY chapter06 SYSTEM "../chapter06/chapter06.xml">
|
||||||
<!ENTITY c6-aboutdebug SYSTEM "../chapter06/aboutdebug.xml">
|
<!ENTITY c6-aboutdebug SYSTEM "../chapter06/aboutdebug.xml">
|
||||||
<!ENTITY c6-mountproc SYSTEM "../chapter06/mountproc.xml">
|
|
||||||
<!ENTITY c6-cf-keyboard SYSTEM "../chapter06/config-keyboard.xml">
|
|
||||||
<!ENTITY c6-cf-password SYSTEM "../chapter06/create-password.xml">
|
|
||||||
|
|
||||||
<!ENTITY chapter07 SYSTEM "../chapter07/chapter07.xml">
|
<!ENTITY chapter07 SYSTEM "../chapter07/chapter07.xml">
|
||||||
<!ENTITY c7-introduction SYSTEM "../chapter07/introduction.xml">
|
<!ENTITY c7-introduction SYSTEM "../chapter07/introduction.xml">
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
<!ENTITY c5-glibc SYSTEM "../chapter05/glibc.xml">
|
<!ENTITY c5-glibc SYSTEM "../chapter05/glibc.xml">
|
||||||
|
|
||||||
<!ENTITY c6-glibc SYSTEM "../chapter06/glibc.xml">
|
<!ENTITY c6-glibc SYSTEM "../chapter06/glibc.xml">
|
||||||
<!ENTITY c6-cf-glibc SYSTEM "../chapter06/config-glibc.xml">
|
|
||||||
|
|
||||||
<!ENTITY aa-glibc-shortdesc SYSTEM "../appendixa/glibc-shortdesc.xml">
|
<!ENTITY aa-glibc-shortdesc SYSTEM "../appendixa/glibc-shortdesc.xml">
|
||||||
<!ENTITY aa-glibc-desc SYSTEM "../appendixa/glibc-desc.xml">
|
<!ENTITY aa-glibc-desc SYSTEM "../appendixa/glibc-desc.xml">
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<!ENTITY c6-sysklogd SYSTEM "../chapter06/sysklogd.xml">
|
<!ENTITY c6-sysklogd SYSTEM "../chapter06/sysklogd.xml">
|
||||||
<!ENTITY c6-cf-sysklogd SYSTEM "../chapter06/config-sysklogd.xml">
|
|
||||||
|
|
||||||
<!ENTITY c7-sysklogd SYSTEM "../chapter07/sysklogd.xml">
|
<!ENTITY c7-sysklogd SYSTEM "../chapter07/sysklogd.xml">
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<!ENTITY c6-sysvinit SYSTEM "../chapter06/sysvinit.xml">
|
<!ENTITY c6-sysvinit SYSTEM "../chapter06/sysvinit.xml">
|
||||||
<!ENTITY c6-cf-sysvinit SYSTEM "../chapter06/config-sysvinit.xml">
|
|
||||||
|
|
||||||
<!ENTITY aa-sysvinit-shortdesc SYSTEM "../appendixa/sysvinit-shortdesc.xml">
|
<!ENTITY aa-sysvinit-shortdesc SYSTEM "../appendixa/sysvinit-shortdesc.xml">
|
||||||
<!ENTITY aa-sysvinit-desc SYSTEM "../appendixa/sysvinit-desc.xml">
|
<!ENTITY aa-sysvinit-desc SYSTEM "../appendixa/sysvinit-desc.xml">
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<!ENTITY c6-vim SYSTEM "../chapter06/vim.xml">
|
<!ENTITY c6-vim SYSTEM "../chapter06/vim.xml">
|
||||||
<!ENTITY c6-cf-vim SYSTEM "../chapter06/config-vim.xml">
|
|
||||||
|
|
||||||
<!ENTITY aa-vim-shortdesc SYSTEM "../appendixa/vim-shortdesc.xml">
|
<!ENTITY aa-vim-shortdesc SYSTEM "../appendixa/vim-shortdesc.xml">
|
||||||
<!ENTITY aa-vim-dep SYSTEM "../appendixa/vim-dep.xml">
|
<!ENTITY aa-vim-dep SYSTEM "../appendixa/vim-dep.xml">
|
||||||
|
Loading…
Reference in New Issue
Block a user