aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrejzi <krejzi@linuxfromscratch.org>2013-12-21 19:46:16 +0000
committerKrejzi <krejzi@linuxfromscratch.org>2013-12-21 19:46:16 +0000
commit94f4fb86521f57d6fabe8caecccd9d0ce316a6c1 (patch)
tree791be31383320ea44a5162830d900d738fe19009
parentc158fe6ad6aeb823b8743cdfd0de4bccd427ee28 (diff)
Misc updates.
git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/systemd/BOOK@10404 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
-rw-r--r--chapter01/changelog.xml8
-rw-r--r--chapter06/attr.xml5
-rw-r--r--chapter06/bc.xml4
-rw-r--r--chapter06/dbus.xml2
-rw-r--r--chapter06/gperf.xml3
-rw-r--r--chapter06/systemd.xml77
-rw-r--r--chapter07/network.xml56
-rw-r--r--general.ent2
-rw-r--r--network-scripts/lfs/units/ifupdownat.service9
9 files changed, 127 insertions, 39 deletions
diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml
index d685f6389..ffb04d89c 100644
--- a/chapter01/changelog.xml
+++ b/chapter01/changelog.xml
@@ -39,6 +39,14 @@
<para>2013-12-21</para>
<itemizedlist>
<listitem>
+ <para>[krejzi] - Update Systemd instructions and contents
+ for latest version of Systemd.</para>
+ </listitem>
+ <listitem>
+ <para>[krejzi] - Update network configuration page to
+ use LFS Systemd specific network configuration.</para>
+ </listitem>
+ <listitem>
<para>[krejzi] - Merge LFS SVN-20131216 book.</para>
</listitem>
</itemizedlist>
diff --git a/chapter06/attr.xml b/chapter06/attr.xml
index 557673997..27a3311ee 100644
--- a/chapter06/attr.xml
+++ b/chapter06/attr.xml
@@ -46,6 +46,11 @@
<screen><userinput remap="pre">sed -i -e 's|/@pkg_name@|&amp;-@pkg_version@|' include/builddefs.in</userinput></screen>
+ <para>Prevent installation of manual pages that were already installed by
+ Man-Pages package:</para>
+
+<screen><userinput remap="pre">sed -i -e "/SUBDIRS/s|man2||" man/Makefile</userinput></screen>
+
<para>Prepare Attr for compilation:</para>
<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen>
diff --git a/chapter06/bc.xml b/chapter06/bc.xml
index 8e37d0132..92f7cbe73 100644
--- a/chapter06/bc.xml
+++ b/chapter06/bc.xml
@@ -43,7 +43,9 @@
<para>Prepare Bc for compilation:</para>
-<screen><userinput remap="configure">./configure --prefix=/usr --with-readline</userinput></screen>
+<screen><userinput remap="configure">./configure --prefix=/usr \
+ --with-readline \
+ --mandir=/usr/share/man</userinput></screen>
<variablelist>
<title>The meaning of the configure options:</title>
diff --git a/chapter06/dbus.xml b/chapter06/dbus.xml
index 9939ac269..565c547df 100644
--- a/chapter06/dbus.xml
+++ b/chapter06/dbus.xml
@@ -93,7 +93,7 @@
<para>Create a symlink, so that D-Bus and Systemd can use the same
<filename>machine-id</filename> file:</para>
-<screen><userinput>ln -s /etc/machine-id /var/lib/dbus</userinput></screen>
+<screen><userinput remap="install">ln -sv /etc/machine-id /var/lib/dbus</userinput></screen>
</sect2>
diff --git a/chapter06/gperf.xml b/chapter06/gperf.xml
index 92dd637c7..341d74d8d 100644
--- a/chapter06/gperf.xml
+++ b/chapter06/gperf.xml
@@ -42,7 +42,8 @@
<para>Prepare Gperf for compilation:</para>
-<screen><userinput remap="configure">./configure --prefix=/usr --docdir=/usr/share/doc/gperf-&gperf-version;</userinput></screen>
+<screen><userinput remap="configure">./configure --prefix=/usr \
+ --docdir=/usr/share/doc/gperf-&gperf-version;</userinput></screen>
<para>Compile the package:</para>
diff --git a/chapter06/systemd.xml b/chapter06/systemd.xml
index f7fd6f7ff..5c62d9b77 100644
--- a/chapter06/systemd.xml
+++ b/chapter06/systemd.xml
@@ -57,7 +57,7 @@
<title>The meaning of the configure options:</title>
<varlistentry>
- <term><parameter>--with-root*</parameter></term>
+ <term><parameter>--with-root-*</parameter></term>
<listitem>
<para>These switches ensure that core programs and
shared libraries are installed in the subdirectories
@@ -95,11 +95,24 @@
<screen><userinput remap="install">make install</userinput></screen>
+ <para>Install manual pages which are shipped in the tarball, but were
+ not installed by install process:</para>
+
+<screen><userinput remap="install">for cat in 1 3 5 7 8
+do
+ install -v -m644 man/*.${cat} /usr/share/man/man${cat}
+done</userinput></screen>
+
+ <para>Move NSS myhostname library to <filename
+ class="directory">/lib</filename>:</para>
+
+<screen><userinput remap="install">mv -v /usr/lib/libnss_myhostname.so.2 /lib</userinput></screen>
+
<para>Create the Sysvinit compatibility symlinks, so Systemd is used
as the default init system:</para>
<screen><userinput remap="install">for tool in runlevel reboot shutdown poweroff halt telinit; do
- ln -sfv ../bin/systemctl /sbin/$tool
+ ln -sfv ../bin/systemctl /sbin/${tool}
done
ln -sfv ../lib/systemd/systemd /sbin/init</userinput></screen>
@@ -110,7 +123,7 @@ ln -sfv ../lib/systemd/systemd /sbin/init</userinput></screen>
<para>Create the <filename>/etc/machine-id</filename> file needed by
Journald:</para>
-<screen><userinput>systemd-machine-id-setup</userinput></screen>
+<screen><userinput remap="install">systemd-machine-id-setup</userinput></screen>
</sect2>
@@ -123,22 +136,22 @@ ln -sfv ../lib/systemd/systemd /sbin/init</userinput></screen>
<segtitle>Installed directories</segtitle>
<seglistitem>
- <seg>halt, hostnamectl, init, journalctl, kernel-install, localectl,
- loginctl, poweroff, reboot, runlevel, shutdown, systemctl,
- systemd-analyze, systemd-ask-password, systemd-cat, systemd-cgls,
- systemd-cgtop, systemd-coredumpctl, systemd-delta, systemd-detect-virt,
- systemd-inhibit, systemd-machine-id-setup, systemd-notify,
- systemd-nspawn, systemd-stdio-bridge, systemd-tmpfiles,
- systemd-tty-ask-password-agent, telinit, timedatectl and
- udevadm</seg>
+ <seg>bootctl, halt, hostnamectl, init, journalctl, kernel-install, localectl,
+ loginctl, machinectl, poweroff, reboot, runlevel, shutdown, systemctl,
+ systemd-analyze, systemd-ask-password, systemd-cat, systemd-cgls, systemd-cgtop,
+ systemd-coredumpctl, systemd-delta, systemd-detect-virt, systemd-inhibit,
+ systemd-machine-id-setup, systemd-notify, systemd-nspawn, systemd-run,
+ systemd-stdio-bridge, systemd-tmpfiles, systemd-tty-ask-password-agent, telinit,
+ timedatectl, and udevadm</seg>
<seg>libnss_myhostname.so.2, libsystemd-daemon.so, libsystemd-id128.so,
- libsystemd-journal.so, libsystemd-login.so and libudev.so</seg>
- <seg>/etc/binfmt.d, /etc/init.d, /etc/kernel, /etc/modules-load.d, /etc/rpm,
+ libsystemd-journal.so, libsystemd-login.so, and libudev.so</seg>
+ <seg>/etc/binfmt.d, /etc/init.d, /etc/kernel, /etc/modules-load.d,
/etc/sysctl.d, /etc/systemd, /etc/tmpfiles.d, /etc/udev,
/etc/xdg/systemd, /lib/systemd, /lib/udev, /usr/include/systemd,
- /usr/lib/binfmt.d, /usr/lib/kernel, /usr/lib/modules-load.d, /usr/lib/sysctl.d,
- /usr/lib/systemd, /usr/lib/tmpfiles.d, /usr/share/doc/systemd-&systemd-version;,
- /usr/share/systemd, /var/lib/systemd and /var/log/journal</seg>
+ /usr/lib/binfmt.d, /usr/lib/kernel, /usr/lib/modules-load.d, /usr/lib/rpm,
+ /usr/lib/sysctl.d, /usr/lib/systemd, /usr/lib/tmpfiles.d,
+ /usr/share/doc/systemd-&systemd-version;, /usr/share/systemd,
+ /var/lib/systemd and /var/log/journal</seg>
</seglistitem>
</segmentedlist>
@@ -147,6 +160,16 @@ ln -sfv ../lib/systemd/systemd /sbin/init</userinput></screen>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
+<!-- <varlistentry id="bootctl">
+ <term><command>bootctl</command></term>
+ <listitem>
+ <para></para>
+ <indexterm zone="ch-system-systemd bootctl">
+ <primary sortas="b-bootctl">bootctl</primary>
+ </indexterm>
+ </listitem>
+ </varlistentry> -->
+
<varlistentry id="halt">
<term><command>halt</command></term>
<listitem>
@@ -227,6 +250,17 @@ ln -sfv ../lib/systemd/systemd /sbin/init</userinput></screen>
</listitem>
</varlistentry>
+ <varlistentry id="machinectl">
+ <term><command>machinectl</command></term>
+ <listitem>
+ <para>used to introspect and control the state of the Systemd Virtual
+ Machine and Container Registration Manager</para>
+ <indexterm zone="ch-system-systemd machinectl">
+ <primary sortas="b-machinectl">machinectl</primary>
+ </indexterm>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="poweroff">
<term><command>poweroff</command></term>
<listitem>
@@ -413,6 +447,17 @@ ln -sfv ../lib/systemd/systemd /sbin/init</userinput></screen>
</listitem>
</varlistentry>
+ <varlistentry id="systemd-run">
+ <term><command>systemd-run</command></term>
+ <listitem>
+ <para>used to create and start a transient .service or a .scope unit and
+ run the specified command in it.</para>
+ <indexterm zone="ch-system-systemd systemd-run">
+ <primary sortas="b-systemd-run">systemd-run</primary>
+ </indexterm>
+ </listitem>
+ </varlistentry>
+
<!-- <varlistentry id="systemd-stdio-bridge">
<term><command>systemd-stdio-bridge</command></term>
<listitem>
diff --git a/chapter07/network.xml b/chapter07/network.xml
index 93ee84229..49d4594e2 100644
--- a/chapter07/network.xml
+++ b/chapter07/network.xml
@@ -22,21 +22,30 @@
<para>Which interfaces are brought up and down by the network script
depends on the files in <filename
- class="directory">/etc/sysconfig/</filename>. This directory should
+ class="directory">/etc/sysconfig/</filename>. This directory should
contain a file for each interface to be configured, such as
<filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is
- meaningful to the administrator such as the device name (e.g. eth0).
+ required to be a Network Card Interface name (e.g. eth0).
Inside this file are attributes to this interface, such as its IP
address(es), subnet masks, and so forth. It is necessary that
the stem of the filename be <emphasis>ifconfig</emphasis>.</para>
+ <note><para>Udev may assign random Network Card Interface names
+ for some network cards such as enp2s1. If you are not sure what
+ your Network Card Interface name is, you can always run
+ <command>ip l</command> after you have booted your system. Again,
+ it is important that <filename>ifconfig.xyz</filename> is named
+ after correct Network Card Interface name (e.g.
+ <filename>ifconfig.enp2s1</filename> or
+ <filename>ifconfig.eth0</filename>) or Systemd will fail to bring
+ up your network interface.</para></note>
+
<para>The following command creates a sample file for the
<emphasis>eth0</emphasis> device with a static IP address:</para>
<screen><userinput>cd /etc/sysconfig/
cat &gt; ifconfig.eth0 &lt;&lt; "EOF"
-<literal>ONBOOT=yes
-IFACE=eth0
+<literal>IFACE=eth0
SERVICE=ipv4-static
IP=192.168.1.1
GATEWAY=192.168.1.2
@@ -47,20 +56,13 @@ EOF</userinput></screen>
<para>The values of these variables must be changed in every file to match
the proper setup.</para>
- <para>If the <envar>ONBOOT</envar> variable is set to <quote>yes</quote> the
- network script will bring up the Network Interface Card (NIC) during
- booting of the system. If set to anything but <quote>yes</quote> the NIC
- will be ignored by the network script and not be automatically brought up.
- The interface can be manually started or stopped with the
- <command>ifup</command> and <command>ifdown</command> commands.</para>
-
<para>The <envar>IFACE</envar> variable defines the interface name,
- for example, eth0. It is required for all network device configuration
- files. </para>
+ for example, eth0. It is required for all network device configuration
+ files.</para>
<para>The <envar>SERVICE</envar> variable defines the method used for
- obtaining the IP address. The LFS-Bootscripts package has a modular IP
- assignment format, and creating additional files in the <filename
+ obtaining the IP address. The LFS-Network-Scripts package has a modular
+ IP assignment format, and creating additional files in the <filename
class="directory">/lib/services/</filename> directory allows other IP
assignment methods. This is commonly used for Dynamic Host Configuration
Protocol (DHCP), which is addressed in the BLFS book.</para>
@@ -83,6 +85,30 @@ EOF</userinput></screen>
</sect2>
+ <sect2>
+ <title>Configuring the Network Interface Card at boot</title>
+
+ <para>Enabling of the Network Interface Card configuration is
+ done per interface. To enable Network Interface Card
+ configuration at boot, run:</para>
+
+<screen><userinput>systemctl enable ifupdown@eth0</userinput></screen>
+
+ <para>To disable previously enabled Network Interface
+ Card configuration at boot, run:</para>
+
+<screen><userinput>systemctl disable ifupdown@eth0</userinput></screen>
+
+ <para>To manually start the Network Interface Card configuration,
+ run:</para>
+
+<screen><userinput>systemctl start ifupdown@eth0</userinput></screen>
+
+ <para>Replace eth0 with the correct Network Interface Card
+ name as described on the beginning of this page.</para>
+
+ </sect2>
+
<sect2 id="resolv.conf">
<title>Creating the /etc/resolv.conf File</title>
diff --git a/general.ent b/general.ent
index 82ec4e311..8e3791d67 100644
--- a/general.ent
+++ b/general.ent
@@ -1,4 +1,4 @@
-<!ENTITY version "SYTEMD-20131221">
+<!ENTITY version "SYSTEMD-20131221">
<!ENTITY releasedate "December 21, 2013">
<!ENTITY copyrightdate "1999-2013"><!-- jhalfs needs a literal dash, not &ndash; -->
<!ENTITY milestone "7.5">
diff --git a/network-scripts/lfs/units/ifupdownat.service b/network-scripts/lfs/units/ifupdownat.service
index 3c5dc494b..c5ea9e7f2 100644
--- a/network-scripts/lfs/units/ifupdownat.service
+++ b/network-scripts/lfs/units/ifupdownat.service
@@ -1,11 +1,12 @@
[Unit]
-Description=Start ifupdown for %i
-Requires=sys-subsystem-net-devices-%i.device
+Description=Start ifupdown for %I
After=sys-subsystem-net-devices-%i.device
+BindTo=sys-subsystem-net-devices-%i.device
+ConditionPathExists=/etc/sysconfig/ifconfig.%i
[Service]
-ExecStart=/sbin/ifup %i
-ExecStop=/sbin/ifdown %i
+ExecStart=/sbin/ifup %I
+ExecStop=/sbin/ifdown %I
RemainAfterExit=true
[Install]