mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-03-06 06:14:47 +00:00
Several minor wording changes in chapter 8 (matt).
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@6318 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
440f8378d1
commit
faca37e6ec
@ -91,6 +91,9 @@ First a summary, then a detailed log.</para>
|
|||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
<listitem><para>July 2nd, 2005 [archaic]: Several minor wording changes in
|
||||||
|
chapter 8 (matt).</para></listitem>
|
||||||
|
|
||||||
<listitem><para>July 1st, 2005 [archaic]: Brought all occurences of
|
<listitem><para>July 1st, 2005 [archaic]: Brought all occurences of
|
||||||
LFS-Bootscripts into conformity.</para></listitem>
|
LFS-Bootscripts into conformity.</para></listitem>
|
||||||
|
|
||||||
|
@ -50,8 +50,8 @@ swap, sysklogd, template, and udev</seg></seglistitem>
|
|||||||
<varlistentry id="checkfs-bootscripts">
|
<varlistentry id="checkfs-bootscripts">
|
||||||
<term><command>checkfs</command></term>
|
<term><command>checkfs</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Checks the file systems before they are mounted (with the exception of journal
|
<para>Checks the integrity of the file systems before they are mounted (with the
|
||||||
and network based file systems)</para>
|
exception of journal and network based file systems)</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts checkfs-bootscripts"><primary sortas="d-checkfs">checkfs</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts checkfs-bootscripts"><primary sortas="d-checkfs">checkfs</primary></indexterm>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -71,8 +71,8 @@ and removes the possibly present <filename>/etc/nologin</filename>,
|
|||||||
<varlistentry id="console-bootscripts">
|
<varlistentry id="console-bootscripts">
|
||||||
<term><command>console</command></term>
|
<term><command>console</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Loads the keymap table specified as proper for the keyboard
|
<para>Loads the correct keymap table for the desired keyboard layout; it also
|
||||||
layout; it also sets the screen font</para>
|
sets the screen font</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts console-bootscripts"><primary sortas="d-console">console</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts console-bootscripts"><primary sortas="d-console">console</primary></indexterm>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -80,8 +80,8 @@ layout; it also sets the screen font</para>
|
|||||||
<varlistentry id="functions-bootscripts">
|
<varlistentry id="functions-bootscripts">
|
||||||
<term><command>functions</command></term>
|
<term><command>functions</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Contains functions shared among different scripts, such as error
|
<para>Contains common functions that are used by several bootscripts, such as
|
||||||
and status checking</para>
|
error and status checking</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts functions-bootscripts"><primary sortas="d-functions">functions</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts functions-bootscripts"><primary sortas="d-functions">functions</primary></indexterm>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -97,7 +97,7 @@ and status checking</para>
|
|||||||
<varlistentry id="hotplug-bootscripts">
|
<varlistentry id="hotplug-bootscripts">
|
||||||
<term><command>hotplug</command></term>
|
<term><command>hotplug</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Load modules for system devices</para>
|
<para>Loads modules for system devices</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts hotplug-bootscripts"><primary sortas="d-hotplug">hotplug</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts hotplug-bootscripts"><primary sortas="d-hotplug">hotplug</primary></indexterm>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -105,7 +105,7 @@ and status checking</para>
|
|||||||
<varlistentry id="ifdown-bootscripts">
|
<varlistentry id="ifdown-bootscripts">
|
||||||
<term><command>ifdown</command></term>
|
<term><command>ifdown</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Assists the network script with network devices</para>
|
<para>Assists the network script with stopping network devices</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts ifdown-bootscripts"><primary sortas="d-ifdown">ifdown</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts ifdown-bootscripts"><primary sortas="d-ifdown">ifdown</primary></indexterm>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -113,7 +113,7 @@ and status checking</para>
|
|||||||
<varlistentry id="ifup-bootscripts">
|
<varlistentry id="ifup-bootscripts">
|
||||||
<term><command>ifup</command></term>
|
<term><command>ifup</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Assists the network script with network devices</para>
|
<para>Assists the network script with starting network devices</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts ifup-bootscripts"><primary sortas="d-ifup">ifup</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts ifup-bootscripts"><primary sortas="d-ifup">ifup</primary></indexterm>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -138,8 +138,8 @@ and status checking</para>
|
|||||||
<varlistentry id="mountkernfs-bootscripts">
|
<varlistentry id="mountkernfs-bootscripts">
|
||||||
<term><command>mountkernfs</command></term>
|
<term><command>mountkernfs</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Is used to mount kernel-provided file systems, such as
|
<para>Mounts virtual kernel file systems, such as <systemitem
|
||||||
<systemitem class="filesystem">proc</systemitem></para>
|
class="filesystem">proc</systemitem></para>
|
||||||
<indexterm zone="ch-scripts-bootscripts mountkernfs-bootscripts"><primary sortas="d-mountkernfs">mountkernfs</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts mountkernfs-bootscripts"><primary sortas="d-mountkernfs">mountkernfs</primary></indexterm>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -156,9 +156,9 @@ the default gateway (where applicable)</para>
|
|||||||
<varlistentry id="rc-bootscripts">
|
<varlistentry id="rc-bootscripts">
|
||||||
<term><command>rc</command></term>
|
<term><command>rc</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>The master run-level control script; it is responsible for
|
<para>The master run-level control script; it is responsible for running all the
|
||||||
running all other scripts one-by-one, in a sequence determined by
|
other bootscripts one-by-one, in a sequence determined by the name of the
|
||||||
the name of the symbolic links being processed</para>
|
symbolic links being processed</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts rc-bootscripts"><primary sortas="d-rc">rc</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts rc-bootscripts"><primary sortas="d-rc">rc</primary></indexterm>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -226,8 +226,8 @@ daemons</para>
|
|||||||
<varlistentry id="udev-bootscripts">
|
<varlistentry id="udev-bootscripts">
|
||||||
<term><command>udev</command></term>
|
<term><command>udev</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Sets up udev and create the device nodes in <filename
|
<para>Prepares the <filename class="directory">/dev</filename> directory and
|
||||||
class="directory">/dev</filename></para>
|
starts Udev</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts udev-bootscripts"><primary sortas="d-udev">udev</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts udev-bootscripts"><primary sortas="d-udev">udev</primary></indexterm>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -11,26 +11,26 @@
|
|||||||
<primary sortas="d-console">console</primary>
|
<primary sortas="d-console">console</primary>
|
||||||
<secondary>configuring</secondary></indexterm>
|
<secondary>configuring</secondary></indexterm>
|
||||||
|
|
||||||
<para>This section discusses how to configure the
|
<para>This section discusses how to configure the <command>console</command>
|
||||||
<command>console</command> initscript that sets up the keyboard map
|
bootscript that sets up the keyboard map and the console font. If non-ASCII
|
||||||
and the console font. If non-ASCII characters (British pound and Euro
|
characters (British pound and Euro character are examples of non-ASCII
|
||||||
character are examples of non-ASCII characters) will not be used and
|
characters) will not be used and the keyboard is a U.S. one, skip this section.
|
||||||
the keyboard is a U.S. one, skip this section. Without the
|
Without the configuration file, the <command>console</command> bootscript will
|
||||||
configuration file, the console initscript will do nothing.</para>
|
do nothing.</para>
|
||||||
|
|
||||||
<para>The <command>console</command> script uses the
|
<para>The <command>console</command> script reads the
|
||||||
<filename>/etc/sysconfig/console</filename> as a configuration file.
|
<filename>/etc/sysconfig/console</filename> file for configuration information.
|
||||||
Decide which keymap and screen font will be used. The
|
Decide which keymap and screen font will be used. Various language-specific
|
||||||
language-specific HOWTO can help with this. A pre-made
|
HOWTO's can also help with this (see <ulink
|
||||||
<filename>/etc/sysconfig/console</filename> file with known settings
|
url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. A pre-made
|
||||||
for several countries was installed with the LFS-Bootscripts package,
|
<filename>/etc/sysconfig/console</filename> file with known settings for several
|
||||||
so the relevant section can be uncommented if the country is
|
countries was installed with the LFS-Bootscripts package, so the relevant
|
||||||
supported. If still in doubt, look in the <filename
|
section can be uncommented if the country is supported. If still in doubt, look
|
||||||
class="directory">/usr/share/kbd</filename> directory for valid
|
in the <filename class="directory">/usr/share/kbd</filename> directory for valid
|
||||||
keymaps and screen fonts. Read the <command>loadkeys</command> and
|
keymaps and screen fonts. Read the <command>loadkeys</command> and
|
||||||
<command>setfont</command> manual pages
|
<command>setfont</command> manual pages and determine the correct arguments for
|
||||||
and determine the correct arguments for these programs. Once decided,
|
these programs. Once decided, create the configuration file with the following
|
||||||
create the configuration file with the following command:</para>
|
command:</para>
|
||||||
|
|
||||||
<screen><userinput>cat >/etc/sysconfig/console <<"EOF"
|
<screen><userinput>cat >/etc/sysconfig/console <<"EOF"
|
||||||
<literal>KEYMAP="<replaceable>[arguments for loadkeys]</replaceable>"
|
<literal>KEYMAP="<replaceable>[arguments for loadkeys]</replaceable>"
|
||||||
|
@ -11,19 +11,19 @@
|
|||||||
<primary sortas="d-localnet">localnet</primary>
|
<primary sortas="d-localnet">localnet</primary>
|
||||||
<secondary>configuring</secondary></indexterm>
|
<secondary>configuring</secondary></indexterm>
|
||||||
|
|
||||||
<para>Part of the <command>localnet</command> script is setting up the system's
|
<para>Part of the job of the <command>localnet</command> script is setting the
|
||||||
hostname. This needs to be configured in the
|
system's hostname. This needs to be configured in the
|
||||||
<filename>/etc/sysconfig/network</filename> file.</para>
|
<filename>/etc/sysconfig/network</filename> file.</para>
|
||||||
|
|
||||||
<para>Create the <filename>/etc/sysconfig/network</filename> file and enter a hostname by
|
<para>Create the <filename>/etc/sysconfig/network</filename> file and enter a
|
||||||
running:</para>
|
hostname by running:</para>
|
||||||
|
|
||||||
<screen><userinput>echo "HOSTNAME=<replaceable>[lfs]</replaceable>" > /etc/sysconfig/network</userinput></screen>
|
<screen><userinput>echo "HOSTNAME=<replaceable>[lfs]</replaceable>" > /etc/sysconfig/network</userinput></screen>
|
||||||
|
|
||||||
<para><replaceable>[lfs]</replaceable> needs to be replaced with the
|
<para><replaceable>[lfs]</replaceable> needs to be replaced with the name given
|
||||||
name the computer is to be called. Do not enter the Fully Qualified
|
to the computer. Do not enter the Fully Qualified Domain Name (FQDN) here. That
|
||||||
Domain Name (FQDN) here. That information will be put in the
|
information will be put in the <filename>/etc/hosts</filename> file in the next
|
||||||
<filename>/etc/hosts</filename> file later.</para>
|
section.</para>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
@ -47,16 +47,15 @@ PREFIX=24
|
|||||||
BROADCAST=192.168.1.255</literal>
|
BROADCAST=192.168.1.255</literal>
|
||||||
EOF</userinput></screen>
|
EOF</userinput></screen>
|
||||||
|
|
||||||
<para>The values of these variables must be changed in every file to
|
<para>The values of these variables must be changed in every file to match the
|
||||||
match the proper setup. If the <envar>ONBOOT</envar> variable is
|
proper setup. If the <envar>ONBOOT</envar> variable is set to <quote>yes</quote>
|
||||||
set to <quote>yes</quote> the network script will bring up the
|
the network script will bring up the Network Interface Card (NIC) during booting
|
||||||
Network Interface Card (NIC) during booting of the system. If set
|
of the system. If set to anything but <quote>yes</quote> the NIC will be ignored
|
||||||
to anything but <quote>yes</quote> the NIC will be ignored by the
|
by the network script and not be brought up.</para>
|
||||||
network script and not brought up.</para>
|
|
||||||
|
|
||||||
<para>The <envar>SERVICE</envar> variable defines the method of obtaining the IP
|
<para>The <envar>SERVICE</envar> variable defines the method used in obtaining
|
||||||
address. The LFS-Bootscripts package has a modular IP assignment format, and
|
the IP address. The LFS-Bootscripts package has a modular IP assignment format,
|
||||||
creating additional files in the <filename
|
and creating additional files in the <filename
|
||||||
class="directory">/etc/sysconfig/network-devices/services</filename> directory
|
class="directory">/etc/sysconfig/network-devices/services</filename> directory
|
||||||
allows other IP assignment methods. This is commonly used for Dynamic Host
|
allows other IP assignment methods. This is commonly used for Dynamic Host
|
||||||
Configuration Protocol (DHCP), which is addressed in the BLFS book.</para>
|
Configuration Protocol (DHCP), which is addressed in the BLFS book.</para>
|
||||||
@ -65,14 +64,14 @@ Configuration Protocol (DHCP), which is addressed in the BLFS book.</para>
|
|||||||
the default gateway IP address, if one is present. If not, then comment out
|
the default gateway IP address, if one is present. If not, then comment out
|
||||||
the variable entirely.</para>
|
the variable entirely.</para>
|
||||||
|
|
||||||
<para>The <envar>PREFIX</envar> variable needs to contain the
|
<para>The <envar>PREFIX</envar> variable needs to contain the number of bits
|
||||||
number of bits used in the subnet. Each octet in an IP address is 8
|
used in the subnet. Each octet in an IP address is 8 bits. If the subnet's
|
||||||
bits. If the subnet's netmask is 255.255.255.0, then it is using the
|
netmask is 255.255.255.0, then it is using the first three octets (24 bits) to
|
||||||
first three octets (24 bits) to specify the network number. If the
|
specify the network number. If the netmask is 255.255.255.240, it would be using
|
||||||
netmask is 255.255.255.240, it would be using the first 28 bits.
|
the first 28 bits. Prefixes longer than 24 bits are commonly used by DSL and
|
||||||
Prefixes longer than 24 bits are commonly used by DSL and cable-based
|
cable-based Internet Service Providers (ISPs). In this example (PREFIX=24), the
|
||||||
Internet Service Providers (ISPs). In this example (PREFIX=24), the netmask
|
netmask is 255.255.255.0. Adjust the <envar>PREFIX</envar> variable according to
|
||||||
is 255.255.255.0. Adjust according to the specific subnet.</para>
|
your specific subnet.</para>
|
||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
|
@ -41,10 +41,9 @@ them properly results in:</para>
|
|||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem><para>The output of programs translated into the native
|
<listitem><para>The output of programs translated into the native
|
||||||
language</para></listitem>
|
language</para></listitem>
|
||||||
<listitem><para>Correct classification of characters into letters,
|
<listitem><para>Correct classification of characters into letters, digits and
|
||||||
digits and other classes. This is necessary for Bash to properly
|
other classes. This is necessary for <command>bash</command> to properly accept
|
||||||
accept non-ASCII characters in command lines in non-English
|
non-ASCII characters in command lines in non-English locales</para></listitem>
|
||||||
locales</para></listitem>
|
|
||||||
<listitem><para>The correct alphabetical sorting order for the
|
<listitem><para>The correct alphabetical sorting order for the
|
||||||
country</para></listitem>
|
country</para></listitem>
|
||||||
<listitem><para>Appropriate default paper size</para></listitem>
|
<listitem><para>Appropriate default paper size</para></listitem>
|
||||||
|
@ -11,28 +11,25 @@
|
|||||||
<primary sortas="d-setclock">setclock</primary>
|
<primary sortas="d-setclock">setclock</primary>
|
||||||
<secondary>configuring</secondary></indexterm>
|
<secondary>configuring</secondary></indexterm>
|
||||||
|
|
||||||
<para>The <command>setclock</command> script reads the time from the hardware clock,
|
<para>The <command>setclock</command> script reads the time from the hardware
|
||||||
also known as the BIOS or the Complementary Metal Oxide Semiconductor
|
clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor
|
||||||
(CMOS) clock. If the hardware clock is set to UTC, this script will convert the hardware clock's time to
|
(CMOS) clock. If the hardware clock is set to UTC, this script will convert the
|
||||||
the local time using the <filename>/etc/localtime</filename> file
|
hardware clock's time to the local time using the
|
||||||
(which tells the <command>hwclock</command> program which timezone the
|
<filename>/etc/localtime</filename> file (which tells the
|
||||||
user is in). There is no way to
|
<command>hwclock</command> program which timezone the user is in). There is no
|
||||||
detect whether or not the hardware clock is set to UTC time, so this
|
way to detect whether or not the hardware clock is set to UTC time, so this
|
||||||
needs to be manually configured.</para>
|
needs to be configured manually.</para>
|
||||||
|
|
||||||
<para>If you cannot remember whether or not the hardware
|
<para>If you cannot remember whether or not the hardware clock is set to UTC
|
||||||
clock is set to UTC time, find out by running
|
time, find out by running the <userinput>hwclock --localtime --show</userinput>
|
||||||
the <userinput>hwclock --localtime --show</userinput> command. This will tell
|
command. This will display what the current time is according to the hardware
|
||||||
what the current time is according to the hardware clock. If this time
|
clock. If this time matches whatever your watch says, then the hardware clock is
|
||||||
matches whatever your watch says, then the hardware clock is set to
|
set to local time. If the output from <command>hwclock</command> is not local
|
||||||
local time. If the output from <command>hwclock</command> is not local
|
time, chances are it is set to UTC time. Verify this by adding or subtracting
|
||||||
time, chances are it is set to UTC time. Verify this by adding or
|
the proper amount of hours for the timezone to the time shown by
|
||||||
subtracting the proper amount of hours for the timezone to this
|
<command>hwclock</command>. For example, if you are currently in the MST
|
||||||
<command>hwclock</command> time. For example, if you live in the MST
|
|
||||||
timezone, which is also known as GMT -0700, add seven hours to the local
|
timezone, which is also known as GMT -0700, add seven hours to the local
|
||||||
time. Then, account for Daylight Savings Time, which requires
|
time.</para>
|
||||||
subtracting an hour (or only add six in the first place) during the summer
|
|
||||||
months.</para>
|
|
||||||
|
|
||||||
<para>Change the value of the <envar>UTC</envar> variable below
|
<para>Change the value of the <envar>UTC</envar> variable below
|
||||||
to a value of <parameter>0</parameter> (zero) if the hardware clock
|
to a value of <parameter>0</parameter> (zero) if the hardware clock
|
||||||
|
@ -12,25 +12,23 @@
|
|||||||
<secondary>usage</secondary></indexterm>
|
<secondary>usage</secondary></indexterm>
|
||||||
|
|
||||||
<para>In <xref linkend="chapter-building-system"/>, we installed the Udev
|
<para>In <xref linkend="chapter-building-system"/>, we installed the Udev
|
||||||
package. Before we go into the details regarding how this works,
|
package. Before we go into the details regarding how this works,
|
||||||
a brief history of previous methods of handling devices is in
|
a brief history of previous methods of handling devices is in
|
||||||
order.</para>
|
order.</para>
|
||||||
|
|
||||||
<para>Linux systems in general traditionally use a static device
|
<para>Linux systems in general traditionally use a static device creation
|
||||||
creation method, whereby a great many device nodes are created under
|
method, whereby a great many device nodes are created under <filename
|
||||||
<filename class="directory">/dev</filename> (sometimes literally
|
class="directory">/dev</filename> (sometimes literally thousands of nodes),
|
||||||
thousands of nodes), regardless of whether the corresponding hardware
|
regardless of whether the corresponding hardware devices actually exist. This is
|
||||||
devices actually exist. This is typically done via a
|
typically done via a <command>MAKEDEV</command> script, which contains a number
|
||||||
<command>MAKEDEV</command> script, which contains a number of
|
of calls to the <command>mknod</command> program with the relevant major and
|
||||||
calls to the <command>mknod</command> program with the relevant major and minor device
|
minor device numbers for every possible device that might exist in the world.
|
||||||
numbers for every possible device that might exist in the world. Using
|
Using the Udev method, only those devices which are detected by the kernel get
|
||||||
the udev method, only those devices which are detected by the kernel
|
device nodes created for them. Because these device nodes will be created each
|
||||||
get device nodes created for them. Because these device nodes will be
|
time the system boots, they will be stored on a <systemitem
|
||||||
created each time the system boots, they will be stored on a
|
class="filesystem">tmpfs</systemitem> file system (a virtual file system that
|
||||||
<systemitem class="filesystem">tmpfs</systemitem> (a file system that
|
resides entirely in system memory). Device nodes do not require much space, so
|
||||||
resides entirely in memory and does not take up any disk space).
|
the memory that is used is negligible.</para>
|
||||||
Device nodes do not require much disk space, so the memory that is
|
|
||||||
used is negligible.</para>
|
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>History</title>
|
<title>History</title>
|
||||||
@ -54,46 +52,45 @@ conditions that are inherent in its design and cannot be fixed
|
|||||||
without a substantial revision to the kernel. It has also been marked
|
without a substantial revision to the kernel. It has also been marked
|
||||||
as deprecated due to a lack of recent maintenance.</para>
|
as deprecated due to a lack of recent maintenance.</para>
|
||||||
|
|
||||||
<para>With the development of the unstable 2.5 kernel tree, later
|
<para>With the development of the unstable 2.5 kernel tree, later released as
|
||||||
released as the 2.6 series of stable kernels, a new virtual filesystem
|
the 2.6 series of stable kernels, a new virtual filesystem called <systemitem
|
||||||
called <systemitem class="filesystem">sysfs</systemitem> came to be.
|
class="filesystem">sysfs</systemitem> came to be. The job of <systemitem
|
||||||
The job of <systemitem class="filesystem">sysfs</systemitem> is to
|
class="filesystem">sysfs</systemitem> is to export a view of the system's
|
||||||
export a view of the system's structure to userspace processes. With
|
hardrware configuration to userspace processes. With this userspace-visible
|
||||||
this userspace visible representation, the possibility of seeing a
|
representation, the possibility of seeing a userspace replacement for
|
||||||
userspace replacement for <systemitem
|
<systemitem class="filesystem">devfs</systemitem> became much more
|
||||||
class="filesystem">devfs</systemitem> became much more
|
|
||||||
realistic.</para>
|
realistic.</para>
|
||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2>
|
<sect2>
|
||||||
<title>Udev Implementation</title>
|
<title>Udev Implementation</title>
|
||||||
|
|
||||||
<para>The <systemitem class="filesystem">sysfs</systemitem> filesystem
|
<para>The <systemitem class="filesystem">sysfs</systemitem> filesystem was
|
||||||
was mentioned briefly above. One may wonder how <systemitem
|
mentioned briefly above. One may wonder how <systemitem
|
||||||
class="filesystem">sysfs</systemitem> knows about the devices present
|
class="filesystem">sysfs</systemitem> knows about the devices present on a
|
||||||
on a system and what device numbers should be used. Drivers that
|
system and what device numbers should be used for them. Drivers that have been
|
||||||
have been compiled into the kernel directly register their objects
|
compiled into the kernel directly register their objects with <systemitem
|
||||||
with <systemitem class="filesystem">sysfs</systemitem> as they are
|
class="filesystem">sysfs</systemitem> as they are detected by the kernel. For
|
||||||
detected by the kernel. For drivers compiled as modules, this will
|
drivers compiled as modules, this registration will happen when the module is
|
||||||
happen when the module is loaded. Once the <systemitem
|
loaded. Once the <systemitem class="filesystem">sysfs</systemitem> filesystem is
|
||||||
class="filesystem">sysfs</systemitem> filesystem is mounted (on
|
mounted (on <filename class="directory">/sys</filename>), data which the
|
||||||
<filename class="directory">/sys</filename>), data which the
|
|
||||||
built-in drivers registered with <systemitem
|
built-in drivers registered with <systemitem
|
||||||
class="filesystem">sysfs</systemitem> are available to userspace
|
class="filesystem">sysfs</systemitem> are available to userspace processes and
|
||||||
processes and to <command>udev</command> for device node creation.</para>
|
to <command>udev</command> for device node creation.</para>
|
||||||
|
|
||||||
<para>The <command>S10udev</command> initscript takes care of creating these
|
<para>The <command>S10udev</command> initscript takes care of creating these
|
||||||
device nodes when Linux is booted. This script starts with registering
|
device nodes when Linux is booted. This script starts by registering
|
||||||
<command>/sbin/udevsend</command> as a hotplug event handler. Hotplug events
|
<command>/sbin/udevsend</command> as a hotplug event handler. Hotplug events
|
||||||
(discussed below) should not be generated during this stage, but
|
(discussed below) are not usually generated during this stage, but
|
||||||
<command>udev</command> is registered just in case they do occur. The
|
<command>udev</command> is registered just in case they do occur. The
|
||||||
<command>udevstart</command> program then walks through the <systemitem
|
<command>udevstart</command> program then walks through the <systemitem
|
||||||
class="filesystem">/sys</systemitem> filesystem and creates devices under
|
class="filesystem">/sys</systemitem> filesystem and creates devices under
|
||||||
<filename class="directory">/dev</filename> that match the descriptions. For
|
<filename class="directory">/dev</filename> that match the descriptions. For
|
||||||
example, <filename>/sys/class/tty/vcs/dev</filename> contains the string
|
example, <filename>/sys/class/tty/vcs/dev</filename> contains the string
|
||||||
<quote>7:0</quote> This string is used by <command>udevstart</command> to create
|
<quote>7:0</quote> This string is used by <command>udevstart</command> to create
|
||||||
<filename>/dev/vcs</filename> with major number <emphasis>7</emphasis> and minor
|
<filename>/dev/vcs</filename> with major number <emphasis>7</emphasis> and minor
|
||||||
<emphasis>0</emphasis>. The names and permissions of the nodes created under
|
<emphasis>0</emphasis>. The names and permissions of the nodes created under
|
||||||
the <filename class="directory">/dev</filename> directory are configured
|
the <filename class="directory">/dev</filename> directory are configured
|
||||||
according to the rules specified in the files within the <filename
|
according to the rules specified in the files within the <filename
|
||||||
class="directory">/etc/udev/rules.d/</filename> directory. These are numbered in
|
class="directory">/etc/udev/rules.d/</filename> directory. These are numbered in
|
||||||
@ -101,39 +98,34 @@ a similar fashion to the LFS-Bootscripts package. If <command>udev</command>
|
|||||||
can't find a rule for the device it is creating, it will default permissions to
|
can't find a rule for the device it is creating, it will default permissions to
|
||||||
<emphasis>660</emphasis> and ownership to <emphasis>root:root</emphasis>.</para>
|
<emphasis>660</emphasis> and ownership to <emphasis>root:root</emphasis>.</para>
|
||||||
|
|
||||||
<para>Once the above stage is complete, all devices that were already
|
<para>Once the above stage is complete, all devices that were already present
|
||||||
present and have compiled-in drivers will be available for use. What
|
and have compiled-in drivers will be available for use. This leads us to the
|
||||||
about those devices that have modular drivers?</para>
|
devices that have modular drivers.</para>
|
||||||
|
|
||||||
<para>Earlier, we mentioned the concept of a <quote>hotplug event
|
<para>Earlier, we mentioned the concept of a <quote>hotplug event
|
||||||
handler.</quote> When a new device connection is detected by the
|
handler.</quote> When a new device connection is detected by the kernel, the
|
||||||
kernel, the kernel will generate a hotplug event and look at the file
|
kernel will generate a hotplug event and look at the file
|
||||||
<filename>/proc/sys/kernel/hotplug</filename> to find out the
|
<filename>/proc/sys/kernel/hotplug</filename> to determine the userspace program
|
||||||
userspace program that handles the device's connection. The
|
that handles the device's connection. The <command>udev</command> bootscript
|
||||||
<command>udev</command> initscript registered <command>udevsend</command>
|
registered <command>udevsend</command> as this handler. When these hotplug
|
||||||
as this handler. When these hotplug events are generated, the kernel
|
events are generated, the kernel will tell <command>udev</command> to check the
|
||||||
will tell <command>udev</command> to check the <filename
|
<filename class="directory">/sys</filename> filesystem for the information
|
||||||
class="directory">/sys</filename> filesystem for the information
|
|
||||||
pertaining to this new device and create the <filename
|
pertaining to this new device and create the <filename
|
||||||
class="directory">/dev</filename> entry for it.</para>
|
class="directory">/dev</filename> entry for it.</para>
|
||||||
|
|
||||||
<para>This brings us to one problem that exists with
|
<para>This brings us to one problem that exists with <command>udev</command>,
|
||||||
<command>udev</command>, and likewise with <systemitem
|
and likewise with <systemitem class="filesystem">devfs</systemitem> before it.
|
||||||
class="filesystem">devfs</systemitem> before it. It is commonly
|
It is commonly referred to as the <quote>chicken and egg</quote> problem. Most
|
||||||
referred to as the <quote>chicken and egg</quote> problem. Most Linux
|
Linux distributions handle loading modules via entries in
|
||||||
distributions handle loading modules via entries in
|
<filename>/etc/modules.conf</filename>. Access to a device node causes the
|
||||||
<filename>/etc/modules.conf</filename>. Access to a device node causes
|
appropriate kernel module to load. With <command>udev</command>, this method
|
||||||
the appropriate kernel module to load. With <command>udev</command>,
|
will not work because the device node does not exist until the module is loaded.
|
||||||
this method will not work because the device node does not exist until
|
To solve this, the <command>S05modules</command> bootscript was added to the
|
||||||
the module is loaded. To solve this, the
|
|
||||||
<command>S05modules</command> bootscript was added to the
|
|
||||||
LFS-Bootscripts package, along with the
|
LFS-Bootscripts package, along with the
|
||||||
<filename>/etc/sysconfig/modules</filename> file. By
|
<filename>/etc/sysconfig/modules</filename> file. By adding module names to the
|
||||||
adding module
|
<filename>modules</filename> file, these modules will be loaded when the
|
||||||
names to the <filename>modules</filename> file, these modules will be
|
computer is starts up. This allows <command>udev</command> to detect the devices
|
||||||
loaded when the computer is starting up. This allows
|
and create the appropriate device nodes.</para>
|
||||||
<command>udev</command> to detect the devices and create the
|
|
||||||
appropriate device nodes.</para>
|
|
||||||
|
|
||||||
<para>Note that on slower machines or for drivers that create a lot
|
<para>Note that on slower machines or for drivers that create a lot
|
||||||
of device nodes, the process of creating devices may take a few
|
of device nodes, the process of creating devices may take a few
|
||||||
@ -167,14 +159,12 @@ device nodes:</para>
|
|||||||
<para>1) A kernel driver may not export its data to <systemitem
|
<para>1) A kernel driver may not export its data to <systemitem
|
||||||
class="filesystem">sysfs</systemitem>.</para>
|
class="filesystem">sysfs</systemitem>.</para>
|
||||||
|
|
||||||
<para>This is most common with third party drivers from outside the
|
<para>This is most common with third party drivers from outside the kernel tree.
|
||||||
kernel tree. These drivers will not end up having their device nodes
|
Udev will be unable to automatically create device nodes for such drivers. Use
|
||||||
created. Use the
|
the <filename>/etc/sysconfig/createfiles</filename> configuration file to
|
||||||
<filename>/etc/sysconfig/createfiles</filename> configuration file to
|
manually create the devices. Consult the <filename>devices.txt</filename> file
|
||||||
manually create the devices. Consult the
|
inside the kernel documentation or the documentation for that driver to find the
|
||||||
<filename>devices.txt</filename> file inside the kernel documentation
|
proper major/minor numbers.</para>
|
||||||
or the documentation for that driver to find the proper major/minor
|
|
||||||
numbers.</para>
|
|
||||||
|
|
||||||
<para>2) A non-hardware device is required. This is most common with
|
<para>2) A non-hardware device is required. This is most common with
|
||||||
the Advanced Linux Sound Architecture (ALSA) project's Open Sound
|
the Advanced Linux Sound Architecture (ALSA) project's Open Sound
|
||||||
|
@ -11,21 +11,19 @@
|
|||||||
<primary sortas="a-Bootscripts">Bootscripts</primary>
|
<primary sortas="a-Bootscripts">Bootscripts</primary>
|
||||||
<secondary>usage</secondary></indexterm>
|
<secondary>usage</secondary></indexterm>
|
||||||
|
|
||||||
<para>Linux uses a special booting facility named SysVinit that is
|
<para>Linux uses a special booting facility named SysVinit that is based on a
|
||||||
based on a concept of <emphasis>run-levels</emphasis>. It can be quite
|
concept of <emphasis>run-levels</emphasis>. It can be quite different from one
|
||||||
different from one system to another, so it cannot be assumed that
|
system to another, so it cannot be assumed that because things worked in one
|
||||||
because things worked in <insert distro name>, they should work
|
particular Linux distribution, they should work the same in LFS too. LFS has its
|
||||||
the same in LFS too. LFS has its own way of doing things, but it
|
own way of doing things, but it respects generally accepted standards.</para>
|
||||||
respects generally accepted standards.</para>
|
|
||||||
|
|
||||||
<para>SysVinit (which will be referred to as <quote>init</quote> from
|
<para>SysVinit (which will be referred to as <quote>init</quote> from now on)
|
||||||
now on) works using a run-levels scheme. There are seven (from 0 to 6)
|
works using a run-levels scheme. There are seven (from 0 to 6) run-levels
|
||||||
run-levels (actually, there are more run-levels, but they are for
|
(actually, there are more run-levels, but they are for special cases and are
|
||||||
special cases and are generally not used. The init man page describes
|
generally not used. The init manual page describes those details), and each one
|
||||||
those details), and each one of those corresponds to the actions the
|
of those corresponds to the actions the computer is supposed to perform when it
|
||||||
computer is supposed to perform when it starts up. The default
|
starts up. The default run-level is 3. Here are the descriptions of the
|
||||||
run-level is 3. Here are the descriptions of the different run-levels
|
different run-levels as they are implemented:</para>
|
||||||
as they are implemented:</para>
|
|
||||||
|
|
||||||
<literallayout>0: halt the computer
|
<literallayout>0: halt the computer
|
||||||
1: single-user mode
|
1: single-user mode
|
||||||
@ -37,24 +35,23 @@ as they are implemented:</para>
|
|||||||
|
|
||||||
<para>The command used to change run-levels is <command>init
|
<para>The command used to change run-levels is <command>init
|
||||||
<replaceable>[runlevel]</replaceable></command>, where
|
<replaceable>[runlevel]</replaceable></command>, where
|
||||||
<replaceable>[runlevel]</replaceable> is the target run-level. For
|
<replaceable>[runlevel]</replaceable> is the target run-level. For example, to
|
||||||
example, to reboot the computer, a user would issue the <command>init
|
reboot the computer, a user could issue the <command>init 6</command> command,
|
||||||
6</command> command. The <command>reboot</command> command is an
|
which is an alias for the <command>reboot</command> command. Likewise,
|
||||||
alias for it, as is the <command>halt</command> command an alias for
|
<command>init 0</command> is an alias for the <command>halt</command>
|
||||||
<command>init 0</command>.</para>
|
command.</para>
|
||||||
|
|
||||||
<para>There are a number of directories under <filename
|
<para>There are a number of directories under <filename
|
||||||
class="directory">/etc/rc.d</filename> that look like <filename
|
class="directory">/etc/rc.d</filename> that look like <filename
|
||||||
class="directory">rc?.d</filename> (where ? is the number of the
|
class="directory">rc?.d</filename> (where ? is the number of the run-level) and
|
||||||
run-level) and <filename class="directory">rcsysinit.d</filename>, all
|
<filename class="directory">rcsysinit.d</filename>, all containing a number of
|
||||||
containing a number of symbolic links. Some begin with a
|
symbolic links. Some begin with a <emphasis>K</emphasis>, the others begin with
|
||||||
<emphasis>K</emphasis>, the others begin with an
|
an <emphasis>S</emphasis>, and all of them have two numbers following the
|
||||||
<emphasis>S</emphasis>, and all of them have two numbers following the
|
initial letter. The K means to stop (kill) a service and the S means to start a
|
||||||
initial letter. The K means to stop (kill) a service and the S means
|
service. The numbers determine the order in which the scripts are run, from 00
|
||||||
to start a service. The numbers determine the order in which the
|
to 99—the lower the number the earlier it gets executed. When
|
||||||
scripts are run, from 00 to 99—the lower the number the earlier it
|
<command>init</command> switches to another run-level, the appropriate services
|
||||||
gets executed. When init switches to another run-level, the
|
are either started or stopped, depending on the runlevel chosen.</para>
|
||||||
appropriate services get killed and others get started.</para>
|
|
||||||
|
|
||||||
<para>The real scripts are in <filename
|
<para>The real scripts are in <filename
|
||||||
class="directory">/etc/rc.d/init.d</filename>. They do the actual
|
class="directory">/etc/rc.d/init.d</filename>. They do the actual
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!ENTITY version "SVN-20050701">
|
<!ENTITY version "SVN-20050702">
|
||||||
<!ENTITY releasedate "July 01, 2005">
|
<!ENTITY releasedate "July 02, 2005">
|
||||||
<!ENTITY milestone "6.2">
|
<!ENTITY milestone "6.2">
|
||||||
<!ENTITY generic-version "svn"> <!-- Use "svn", "testing", or "x.y[-pre{x}]" -->
|
<!ENTITY generic-version "svn"> <!-- Use "svn", "testing", or "x.y[-pre{x}]" -->
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user