Author: krejzi
Date: Fri Feb 15 13:14:37 2013
New Revision: 10159
Log:
Move Chapter 7 in place for Systemd.
Added:
branches/systemd/BOOK/chapter07/locale.xml
- copied, changed from r10151, branches/systemd/BOOK/chapter07/profile.xml
Deleted:
branches/systemd/BOOK/chapter07/bootscripts.xml
branches/systemd/BOOK/chapter07/profile.xml
branches/systemd/BOOK/chapter07/sysklogd.xml
branches/systemd/BOOK/chapter07/usage.xml
Modified:
branches/systemd/BOOK/chapter07/chapter07.xml
branches/systemd/BOOK/chapter07/hostname.xml
branches/systemd/BOOK/chapter07/introduction.xml
branches/systemd/BOOK/chapter07/network.xml
branches/systemd/BOOK/chapter07/symlinks.xml
branches/systemd/BOOK/chapter07/udev.xml
Modified: branches/systemd/BOOK/chapter07/chapter07.xml
==============================================================================
--- branches/systemd/BOOK/chapter07/chapter07.xml Fri Feb 15 12:48:29
2013 (r10158)
+++ branches/systemd/BOOK/chapter07/chapter07.xml Fri Feb 15 13:14:37
2013 (r10159)
@@ -16,13 +16,10 @@
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hosts.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="udev.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="symlinks.xml"/>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
href="bootscripts.xml"/>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="usage.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hostname.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="setclock.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="console.xml"/>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysklogd.xml"/>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="profile.xml"/>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="locale.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="inputrc.xml"/>
</chapter>
Modified: branches/systemd/BOOK/chapter07/hostname.xml
==============================================================================
--- branches/systemd/BOOK/chapter07/hostname.xml Fri Feb 15 12:48:29
2013 (r10158)
+++ branches/systemd/BOOK/chapter07/hostname.xml Fri Feb 15 13:14:37
2013 (r10159)
@@ -15,14 +15,13 @@
<secondary>configuring</secondary>
</indexterm>
- <para>Part of the job of the <command>localnet</command> script is setting
the
- system's hostname. This needs to be configured in the
- <filename>/etc/sysconfig/network</filename> file.</para>
+ <para>Systemd reads <filename>/etc/hostname</filename> to determine which
+ hostname should be set.</para>
- <para>Create the <filename>/etc/sysconfig/network</filename> file and enter a
+ <para>Create the <filename>/etc/hostname</filename> file and enter a
hostname by running:</para>
-<screen><userinput>echo "HOSTNAME=<replaceable><lfs></replaceable>" >
/etc/sysconfig/network</userinput></screen>
+<screen><userinput>echo "<replaceable><lfs></replaceable>" >
/etc/hostname</userinput></screen>
<para><replaceable><lfs></replaceable> needs to be replaced with the
name given
to the computer. Do not enter the Fully Qualified Domain Name (FQDN) here.
That
Modified: branches/systemd/BOOK/chapter07/introduction.xml
==============================================================================
--- branches/systemd/BOOK/chapter07/introduction.xml Fri Feb 15 12:48:29
2013 (r10158)
+++ branches/systemd/BOOK/chapter07/introduction.xml Fri Feb 15 13:14:37
2013 (r10159)
@@ -34,28 +34,10 @@
</listitem>
</itemizedlist>
- <para>The next sections detail how to install and configure the LFS system
- scripts needed during the boot process. Most of these scripts will work
- without modification, but a few require additional configuration files
- because they deal with hardware-dependent information.</para>
-
- <para>System-V style init scripts are employed in this book because they are
- widely used and relatively simple. For additional options, a hint detailing
- the BSD style init setup is available at <ulink
- url="&hints-root;bsd-init.txt"/>. Searching the LFS mailing lists for
- <quote>depinit</quote>, <quote>upstart</quote>, or <quote>systemd</quote>
- will also offer additional information.</para>
-
- <para>If using an alternative style of init scripts, skip these
sections.</para>
+ <para>Third, configuring hostname, keyboard layout and system clock.</para>
<itemizedlist>
<listitem>
- <para><xref linkend="ch-scripts-bootscripts" role="."/></para>
- </listitem>
- <listitem>
- <para><xref linkend="ch-scripts-usage" role="."/></para>
- </listitem>
- <listitem>
<para><xref linkend="ch-scripts-hostname" role="."/></para>
</listitem>
<listitem>
@@ -64,9 +46,6 @@
<listitem>
<para><xref linkend="ch-scripts-console" role="."/></para>
</listitem>
- <listitem>
- <para><xref linkend="ch-scripts-sysklogd" role="."/></para>
- </listitem>
</itemizedlist>
@@ -75,7 +54,7 @@
<itemizedlist>
<listitem>
- <para><xref linkend="ch-scripts-profile" role="."/></para>
+ <para><xref linkend="ch-scripts-locale" role="."/></para>
</listitem>
<listitem>
<para><xref linkend="ch-scripts-inputrc" role="."/></para>
Copied and modified: branches/systemd/BOOK/chapter07/locale.xml (from r10151,
branches/systemd/BOOK/chapter07/profile.xml)
==============================================================================
--- branches/systemd/BOOK/chapter07/profile.xml Fri Feb 15 06:06:47 2013
(r10151, copy source)
+++ branches/systemd/BOOK/chapter07/locale.xml Fri Feb 15 13:14:37 2013
(r10159)
@@ -5,39 +5,16 @@
%general-entities;
]>
-<sect1 id="ch-scripts-profile">
- <?dbhtml filename="profile.html"?>
+<sect1 id="ch-scripts-locale">
+ <?dbhtml filename="locale.html"?>
- <title>The Bash Shell Startup Files</title>
+ <title>Configuring the System Locale</title>
- <indexterm zone="ch-scripts-profile">
- <primary sortas="e-/etc/profile">/etc/profile</primary>
+ <indexterm zone="ch-scripts-locale">
+ <primary sortas="e-etc-locale-conf">/etc/locale.conf</primary>
</indexterm>
- <para>The shell program <command>/bin/bash</command> (hereafter referred to
- as <quote>the shell</quote>) uses a collection of startup files to help
- create an environment to run in. Each file has a specific use and may affect
- login and interactive environments differently. The files in the <filename
- class="directory">/etc</filename> directory provide global settings. If an
- equivalent file exists in the home directory, it may override the global
- settings.</para>
-
- <para>An interactive login shell is started after a successful login, using
- <command>/bin/login</command>, by reading the
<filename>/etc/passwd</filename>
- file. An interactive non-login shell is started at the command-line (e.g.,
- <prompt>[prompt]$</prompt><command>/bin/bash</command>). A non-interactive
- shell is usually present when a shell script is running. It is
non-interactive
- because it is processing a script and not waiting for user input between
- commands.</para>
-
- <para>For more information, see <command>info bash</command> under the
- <emphasis>Bash Startup Files and Interactive Shells</emphasis>
section.</para>
-
- <para>The files <filename>/etc/profile</filename> and
- <filename>~/.bash_profile</filename> are read when the shell is
- invoked as an interactive login shell.</para>
-
- <para>The base <filename>/etc/profile</filename> below sets some
+ <para>The <filename>/etc/locale.conf</filename> below sets some
environment variables necessary for native language support. Setting
them properly results in:</para>
@@ -135,14 +112,10 @@
might provide some useful information.</para>
<para>Once the proper locale settings have been determined, create the
- <filename>/etc/profile</filename> file:</para>
-
-<screen><userinput>cat > /etc/profile << "EOF"
-<literal># Begin /etc/profile
-
-export
LANG=<replaceable><ll>_<CC>.<charmap><@modifiers></replaceable>
+ <filename>/etc/locale.conf</filename> file:</para>
-# End /etc/profile</literal>
+<screen><userinput>cat > /etc/locale.conf << "EOF"
+<literal>LANG=<replaceable><ll>_<CC>.<charmap><@modifiers></replaceable></literal>
EOF</userinput></screen>
<para>The <quote>C</quote> (default) and <quote>en_US</quote> (the
recommended
Modified: branches/systemd/BOOK/chapter07/network.xml
==============================================================================
--- branches/systemd/BOOK/chapter07/network.xml Fri Feb 15 12:48:29 2013
(r10158)
+++ branches/systemd/BOOK/chapter07/network.xml Fri Feb 15 13:14:37 2013
(r10159)
@@ -17,104 +17,6 @@
<para>This section only applies if a network card is to be
configured.</para>
- <para>If a network card will not be used, there is likely no need to create
- any configuration files relating to network cards. If that is the case, you
- will need to remove the <filename class="symlink">network</filename> symlinks
- from all run-level directories (<filename
- class="directory">/etc/rc.d/rc*.d</filename>) after the bootscripts are
- installed in <xref linkend="ch-scripts-bootscripts"/>.</para>
-
- <sect2 id='stable-net-names'>
- <title>Creating stable names for network interfaces</title>
-
- <para>If there is only one network interface in the system to be
- configured, this section is optional, although it will never be wrong to do
- it. In many cases (e.g. a laptop with a wireless and a wired interface),
- accomplishing the configuration in this section is necessary.</para>
-
- <para>With Udev and modular network drivers, the network interface
numbering
- is not persistent across reboots by default, because the drivers are loaded
- in parallel and, thus, in random order. For example, on a computer having
- two network cards made by Intel and Realtek, the network card manufactured
- by Intel may become <filename class="devicefile">eth0</filename> and the
- Realtek card becomes <filename class="devicefile">eth1</filename>. In some
- cases, after a reboot the cards get renumbered the other way around. To
- avoid this, Udev comes with a script and some rules to assign stable names
- to network cards based on their MAC address.</para>
-
- <para>The rules were pre-generated in the build instructions for
- <application>udev (systemd)</application> in the last chapter. Inspect the
- <filename>/etc/udev/rules.d/70-persistent-net.rules</filename> file, to
- find out which name was assigned to which network device:</para>
-
-<screen role="nodump"><userinput>cat
/etc/udev/rules.d/70-persistent-net.rules</userinput></screen>
-
- <note><para>In some cases such as when MAC addresess have been assigned to
- a network card manually or in a virtual environment such as Xen,
- the network rules file may not have been generated because addresses
- are not consistently assigned. In these cases, just continue to
- the next section.</para></note>
-
- <para>The file begins with a comment block followed by two lines for each
- NIC. The first line for each NIC is a commented description showing its
- hardware IDs (e.g. its PCI vendor and device IDs, if it's a PCI card),
- along with its driver in parentheses, if the driver can be found. Neither
- the hardware ID nor the driver is used to determine which name to give an
- interface; this information is only for reference. The second line is the
- Udev rule that matches this NIC and actually assigns it a name.</para>
-
- <para>All Udev rules are made up of several keys, separated by commas and
- optional whitespace. This rule's keys and an explanation of each of them
- are as follows:</para>
-
- <itemizedlist>
- <listitem>
- <para><literal>SUBSYSTEM=="net"</literal> - This tells Udev to ignore
- devices that are not network cards.</para>
- </listitem>
- <listitem>
- <para><literal>ACTION=="add"</literal> - This tells Udev to ignore this
- rule for a uevent that isn't an add ("remove" and "change" uevents also
- happen, but don't need to rename network interfaces).</para>
- </listitem>
- <listitem>
- <para><literal>DRIVERS=="?*"</literal> - This exists so that Udev will
- ignore VLAN or bridge sub-interfaces (because these sub-interfaces do
- not have drivers). These sub-interfaces are skipped because the name
- that would be assigned would collide with their parent devices.</para>
- </listitem>
- <listitem>
- <para><literal>ATTR{address}</literal> - The value of this key is the
- NIC's MAC address.</para>
- </listitem>
- <listitem>
- <para><literal>ATTR{type}=="1"</literal> - This ensures the rule only
- matches the primary interface in the case of certain wireless drivers,
- which create multiple virtual interfaces. The secondary interfaces are
- skipped for the same reason that VLAN and bridge sub-interfaces are
- skipped: there would be a name collision otherwise.</para>
- </listitem>
- <listitem>
- <para><literal>KERNEL=="eth*"</literal> - This key was added to the
- Udev rule generator to handle machines that have multiple network
- interfaces, all with the same MAC address (the PS3 is one such
- machine). If the independent interfaces have different basenames,
- this key will allow Udev to tell them apart. This is generally not
- necessary for most Linux From Scratch users, but does not hurt.</para>
- </listitem>
- <listitem>
- <para><literal>NAME</literal> - The value of this key is the name that
- Udev will assign to this interface.</para>
- </listitem>
- </itemizedlist>
-
- <para>The value of <literal>NAME</literal> is the important part. Make sure
- you know which name has been assigned to each of your network cards before
- proceeding, and be sure to use that <literal>NAME</literal> value when
- creating your configuration files below.</para>
-
- </sect2>
-
<sect2>
<title>Creating Network Interface Configuration Files</title>
Modified: branches/systemd/BOOK/chapter07/symlinks.xml
==============================================================================
--- branches/systemd/BOOK/chapter07/symlinks.xml Fri Feb 15 12:48:29
2013 (r10158)
+++ branches/systemd/BOOK/chapter07/symlinks.xml Fri Feb 15 13:14:37
2013 (r10159)
@@ -12,92 +12,6 @@
<sect2>
- <title>CD-ROM symlinks</title>
-
- <para>Some software that you may want to install later (e.g., various
- media players) expect the <filename class="symlink">/dev/cdrom</filename>
- and <filename class="symlink">/dev/dvd</filename> symlinks to exist, and
- to point to a CD-ROM or DVD-ROM device. Also, it may be convenient to put
- references to those symlinks into <filename>/etc/fstab</filename>. Udev
- comes with a script that will generate rules files to create these symlinks
- for you, depending on the capabilities of each device, but you need to
- decide which of two modes of operation you wish to have the script
use.</para>
-
- <para>First, the script can operate in <quote>by-path</quote> mode (used by
- default for USB and FireWire devices), where the rules it creates depend on
- the physical path to the CD or DVD device. Second, it can operate in
- <quote>by-id</quote> mode (default for IDE and SCSI devices), where the
- rules it creates depend on identification strings stored in the CD or DVD
- device itself. The path is determined by Udev's <command>path_id</command>
- script, and the identification strings are read from the hardware by its
- <command>ata_id</command> or <command>scsi_id</command> programs, depending
- on which type of device you have.</para>
-
- <para>There are advantages to each approach; the correct approach to use
- will depend on what kinds of device changes may happen. If you expect the
- physical path to the device (that is, the ports and/or slots that it plugs
- into) to change, for example because you plan on moving the drive to a
- different IDE port or a different USB connector, then you should use the
- <quote>by-id</quote> mode. On the other hand, if you expect the device's
- identification to change, for example because it may die, and you would
- replace it with a different device with the same capabilities and which
- is plugged into the same connectors, then you should use the
- <quote>by-path</quote> mode.</para>
-
- <para>If either type of change is possible with your drive, then choose a
- mode based on the type of change you expect to happen more often.</para>
-
-<!-- If you use by-id mode, the symlinks will survive even the transition
- to libata for IDE drives, but that is not for the book. -->
-
- <important><para>External devices (for example, a USB-connected CD drive)
- should not use by-path persistence, because each time the device is plugged
- into a new external port, its physical path will change. All
- externally-connected devices will have this problem if you write Udev rules
- to recognize them by their physical path; the problem is not limited to CD
- and DVD drives.</para></important>
-
- <para>If you wish to see the values that the Udev scripts will use, then
- for the appropriate CD-ROM device, find the corresponding directory under
- <filename class="directory">/sys</filename> (e.g., this can be
- <filename class="directory">/sys/block/hdd</filename>) and
- run a command similar to the following:</para>
-
-<screen role="nodump"><userinput>udevadm test
/sys/block/hdd</userinput></screen>
-
- <para>Look at the lines containing the output of various *_id programs.
- The <quote>by-id</quote> mode will use the ID_SERIAL value if it exists and
- is not empty, otherwise it will use a combination of ID_MODEL and
- ID_REVISION. The <quote>by-path</quote> mode will use the ID_PATH
value.</para>
-
- <para>If the default mode is not suitable for your situation, then the
- following modification can be made to the
- <filename>/lib/udev/rules.d/75-cd-aliases-generator.rules</filename> file,
- as follows (where <replaceable>mode</replaceable> is one of
- <quote>by-id</quote> or <quote>by-path</quote>):</para>
-
-<screen role="nodump"><userinput>sed -i -e 's/"write_cd_rules"/"write_cd_rules
<replaceable>mode</replaceable>"/' \
- /lib/udev/rules.d/75-cd-aliases-generator.rules</userinput></screen>
-
- <para>Note that it is not necessary to create the rules files or symlinks
- at this time, because you have bind-mounted the host's
- <filename class="directory">/dev</filename> directory into the LFS system,
- and we assume the symlinks exist on the host. The rules and symlinks will
- be created the first time you boot your LFS system.</para>
-
- <para>However, if you have multiple CD-ROM devices, then the symlinks
- generated at that time may point to different devices than they point to on
- your host, because devices are not discovered in a predictable order. The
- assignments created when you first boot the LFS system will be stable, so
- this is only an issue if you need the symlinks on both systems to point to
- the same device. If you need that, then inspect (and possibly edit) the
- generated <filename>/etc/udev/rules.d/70-persistent-cd.rules</filename>
- file after booting, to make sure the assigned symlinks match what you
need.</para>
-
- </sect2>
-
- <sect2>
-
<title>Dealing with duplicate devices</title>
<para>As explained in <xref linkend="ch-scripts-udev"/>, the order in
Modified: branches/systemd/BOOK/chapter07/udev.xml
==============================================================================
--- branches/systemd/BOOK/chapter07/udev.xml Fri Feb 15 12:48:29 2013
(r10158)
+++ branches/systemd/BOOK/chapter07/udev.xml Fri Feb 15 13:14:37 2013
(r10159)
@@ -121,46 +121,6 @@
initially.</para> </sect3>
<sect3>
- <title>Udev Bootscripts</title>
-
- <para>The first LFS bootscript,
- <filename>/etc/init.d/mountvirtfs</filename> will copy any devices
- located in <filename class="directory">/lib/udev/devices</filename> to
- <filename class="directory">/dev</filename>. This is necessary because
- some devices, directories, and symlinks are needed before the dynamic
- device handling processes are available during the early stages of
- booting a system, or are required by <command>udevd</command> itself.
- Creating static device nodes in <filename
- class="directory">/lib/udev/devices</filename> also provides an easy
- workaround for devices that are not supported by the dynamic device
- handling infrastructure.</para>
-
- <para>The <filename>/etc/rc.d/init.d/udev</filename> initscript starts
- <command>udevd</command>, triggers any "coldplug" devices that have
- already been created by the kernel and waits for any rules to complete.
- The script also unsets the uevent handler from the default of
- <filename>/sbin/hotplug </filename>. This is done because the kernel no
- longer needs to call out to an external binary. Instead
- <command>udevd</command> will listen on a netlink socket for uevents that
- the kernel raises.</para>
-
- <para>The <command>/etc/rc.d/init.d/udev_retry</command> initscript takes
- care of re-triggering events for subsystems whose rules may rely on
- filesystems that are not mounted until the <command>mountfs</command>
- script is run (in particular, <filename class="directory">/usr</filename>
- and <filename class="directory">/var</filename> may cause this). This
- script runs after the <command>mountfs</command> script, so those rules
- (if re-triggered) should succeed the second time around. It is
- configured from the <filename>/etc/sysconfig/udev_retry</filename> file;
- any words in this file other than comments are considered subsystem names
- to trigger at retry time. To find the subsystem of a device, use
- <command>udevadm info --attribute-walk <device></command> where
- <device> is a an absolure path in /dev or /sys such as /dev/sr0 or
- /sys/class/rtc.</para>
-
- </sect3>
-
- <sect3>
<title>Module Loading</title>
<para>Device drivers compiled as modules may have aliases built into
them.
--
http://linuxfromscratch.org/mailman/listinfo/lfs-book
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page