aboutsummaryrefslogtreecommitdiffstats
path: root/chapter08
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-12-05 13:12:55 +0800
committerXi Ruoyao <xry111@xry111.site>2023-12-05 13:12:55 +0800
commit73d91ac621a4e59f71ff6664c68c935317f9ce42 (patch)
tree4f9b341370b83d97379a1343a69d13d48cb65740 /chapter08
parent6b6a1b958af3a0e59559e44ad700f761d8a49a09 (diff)
parentdc8572f2413a4d25444bb1237ea2a01dfba60429 (diff)
Merge remote-tracking branch 'origin/trunk' into xry111/arm64
Diffstat (limited to 'chapter08')
-rw-r--r--chapter08/automake.xml9
-rw-r--r--chapter08/chapter08.xml1
-rw-r--r--chapter08/dbus.xml2
-rw-r--r--chapter08/gawk.xml11
-rw-r--r--chapter08/glibc.xml54
-rw-r--r--chapter08/gmp.xml2
-rw-r--r--chapter08/iproute2.xml3
-rw-r--r--chapter08/libelf.xml4
-rw-r--r--chapter08/man-db.xml6
-rw-r--r--chapter08/mpc.xml4
-rw-r--r--chapter08/mpfr.xml4
-rw-r--r--chapter08/openssl.xml2
-rw-r--r--chapter08/perl.xml31
-rw-r--r--chapter08/pkgconf.xml15
-rw-r--r--chapter08/pkgmgt.xml39
-rw-r--r--chapter08/python.xml29
-rw-r--r--chapter08/setuptools.xml71
-rw-r--r--chapter08/shadow.xml13
-rw-r--r--chapter08/stripping.xml11
-rw-r--r--chapter08/udev.xml64
-rw-r--r--chapter08/util-linux.xml2
21 files changed, 230 insertions, 147 deletions
diff --git a/chapter08/automake.xml b/chapter08/automake.xml
index 4fc1bd277..5d7541049 100644
--- a/chapter08/automake.xml
+++ b/chapter08/automake.xml
@@ -53,11 +53,14 @@
<screen><userinput remap="make">make</userinput></screen>
- <para> Using the -j4 make option speeds up the tests, even on systems with
- only one processor, due to internal delays in individual tests. To test
+ <para>Using four parallel jobs speeds up the tests, even on systems with
+ less logical cores, due to internal delays in individual tests. To test
the results, issue:</para>
-<screen><userinput remap="test">make -j4 check</userinput></screen>
+<screen><userinput remap="test">make <replaceable>-j$(($(nproc)&gt;4?$(nproc):4))</replaceable> check</userinput></screen>
+
+ <para>Replace <replaceable>$((...))</replaceable> with the number of
+ logical cores you want to use if you don't want to use all.</para>
<para>The test t/subobj.sh is known to fail.</para>
diff --git a/chapter08/chapter08.xml b/chapter08/chapter08.xml
index 8ab81d2f8..2fccb6139 100644
--- a/chapter08/chapter08.xml
+++ b/chapter08/chapter08.xml
@@ -65,6 +65,7 @@
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="python.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="flit-core.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="wheel.xml"/>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="setuptools.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="ninja.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="meson.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="coreutils.xml"/>
diff --git a/chapter08/dbus.xml b/chapter08/dbus.xml
index 8ab4744ad..309e5b2e9 100644
--- a/chapter08/dbus.xml
+++ b/chapter08/dbus.xml
@@ -56,7 +56,7 @@
--disable-static \
--disable-doxygen-docs \
--disable-xml-docs \
- --docdir=/usr/share/doc/dbus-&dbus-version; \
+ --docdir=/usr/share/doc/dbus-&dbus-version; \
--with-system-socket=/run/dbus/system_bus_socket</userinput></screen>
<variablelist>
diff --git a/chapter08/gawk.xml b/chapter08/gawk.xml
index cc9348d90..d8984b58e 100644
--- a/chapter08/gawk.xml
+++ b/chapter08/gawk.xml
@@ -59,15 +59,18 @@ su tester -c "PATH=$PATH make check"</userinput></screen>
<para>Install the package:</para>
-<screen><userinput remap="install">make LN='ln -f' install</userinput></screen>
+<screen><userinput remap="install">rm -f /usr/bin/gawk-&gawk-version;
+make install</userinput></screen>
<variablelist>
- <title>The meaning of the overridden make variable:</title>
+ <title>The meaning of the command:</title>
<varlistentry>
- <term><envar>LN='ln -f'</envar></term>
+ <term><command>rm -f /usr/bin/gawk-&gawk-version;</command></term>
<listitem>
- <para>This variable ensures that the previous hard link installed
+ <para>The building system will not recreate the hard link
+ <filename>gawk-&gawk-version;</filename> if it already exists.
+ Remove it to ensure that the previous hard link installed
in <xref linkend='ch-tools-gawk'/> is updated here.</para>
</listitem>
</varlistentry>
diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml
index 7eac93dbb..06cda8a71 100644
--- a/chapter08/glibc.xml
+++ b/chapter08/glibc.xml
@@ -50,10 +50,10 @@
<screen><userinput remap="pre">patch -Np1 -i ../&glibc-fhs-patch;</userinput></screen>
- <para>Now fix a regression causing the posix_memalign() function
- to be very slow in some conditions:</para>
+ <para>Now fix two security vulnerabilities and a regression causing the
+ posix_memalign() function very slow in some conditions:</para>
-<screen><userinput remap="pre">patch -Np1 -i ../&glibc-memalign-patch;</userinput></screen>
+<screen><userinput remap="pre">patch -Np1 -i ../&glibc-upstream-fixes-patch;</userinput></screen>
<para>The Glibc documentation recommends building Glibc
in a dedicated build directory:</para>
@@ -74,6 +74,7 @@ cd build</userinput></screen>
--enable-kernel=&min-kernel; \
--enable-stack-protector=strong \
--with-headers=/usr/include \
+ --disable-nscd \
libc_cv_slibdir=/usr/lib</userinput></screen>
<variablelist>
@@ -115,6 +116,14 @@ cd build</userinput></screen>
</varlistentry>
<varlistentry>
+ <term><parameter>--disable-nscd</parameter></term>
+ <listitem>
+ <para>Do not build the name service cache daemon which is no
+ longer used.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><parameter>libc_cv_slibdir=/usr/lib</parameter></term>
<listitem>
<para>This variable sets the correct library for all
@@ -206,7 +215,7 @@ esac</userinput></screen>
<command>ldd</command> script:</para>
<screen><userinput remap="install">sed '/RTLDLIST=/s@/usr@@g' -i /usr/bin/ldd</userinput></screen>
-
+<!--
<para>Install the configuration file and runtime directory for
<command>nscd</command>:</para>
@@ -218,7 +227,7 @@ mkdir -pv /var/cache/nscd</userinput></screen>
<screen revision="systemd"><userinput remap="install">install -v -Dm644 ../nscd/nscd.tmpfiles /usr/lib/tmpfiles.d/nscd.conf
install -v -Dm644 ../nscd/nscd.service /usr/lib/systemd/system/nscd.service</userinput></screen>
-
+-->
<para>Next, install the locales that can make the system respond in a
different language. None of these locales are required, but if some of them
are missing, the test suites of some packages will skip important
@@ -320,7 +329,7 @@ localedef -i ja_JP -f SHIFT_JIS ja_JP.SJIS 2> /dev/null || true</userinput></scr
<para>Create a new file <filename>/etc/nsswitch.conf</filename> by running the
following:</para>
-<screen><userinput>cat &gt; /etc/nsswitch.conf &lt;&lt; "EOF"
+<screen revision='sysv'><userinput>cat &gt; /etc/nsswitch.conf &lt;&lt; "EOF"
<literal># Begin /etc/nsswitch.conf
passwd: files
@@ -338,6 +347,24 @@ rpc: files
# End /etc/nsswitch.conf</literal>
EOF</userinput></screen>
+<screen revision='systemd'><userinput>cat &gt; /etc/nsswitch.conf &lt;&lt; "EOF"
+<literal># Begin /etc/nsswitch.conf
+
+passwd: files systemd
+group: files systemd
+shadow: files systemd
+
+hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns
+networks: files
+
+protocols: files
+services: files
+ethers: files
+rpc: files
+
+# End /etc/nsswitch.conf</literal>
+EOF</userinput></screen>
+
</sect3>
<sect3>
@@ -480,7 +507,7 @@ mkdir -pv /etc/ld.so.conf.d</userinput></screen>
<seg>gencat, getconf, getent, iconv, iconvconfig, ldconfig,
ldd, lddlibc4,
ld.so (symlink to ld-linux-aarch64[_be].so.1),
- locale, localedef, makedb, mtrace, nscd,
+ locale, localedef, makedb, mtrace,
pcprofiledump, pldd, sln, sotruss, sprof, tzselect, xtrace,
zdump, and zic</seg>
<seg>ld-linux-aarch64[_be].so.1,
@@ -500,7 +527,7 @@ mkdir -pv /etc/ld.so.conf.d</userinput></screen>
/usr/include/protocols, /usr/include/rpc,
/usr/include/sys, /usr/lib/audit, /usr/lib/gconv, /usr/lib/locale,
/usr/libexec/getconf, /usr/share/i18n, /usr/share/zoneinfo,
- /var/cache/nscd, and /var/lib/nss_db</seg>
+ and /var/lib/nss_db</seg>
</seglistitem>
</segmentedlist>
@@ -634,17 +661,6 @@ mkdir -pv /etc/ld.so.conf.d</userinput></screen>
</listitem>
</varlistentry>
- <varlistentry id="nscd">
- <term><command>nscd</command></term>
- <listitem>
- <para>A daemon that provides a cache for the most common name
- service requests</para>
- <indexterm zone="ch-system-glibc nscd">
- <primary sortas="b-nscd">nscd</primary>
- </indexterm>
- </listitem>
- </varlistentry>
-
<varlistentry id="pcprofiledump">
<term><command>pcprofiledump</command></term>
<listitem>
diff --git a/chapter08/gmp.xml b/chapter08/gmp.xml
index bfd030e1d..c178d2b13 100644
--- a/chapter08/gmp.xml
+++ b/chapter08/gmp.xml
@@ -119,7 +119,7 @@ make install-html</userinput></screen>
<title>Contents of GMP</title>
<segmentedlist>
- <segtitle>Installed Libraries</segtitle>
+ <segtitle>Installed libraries</segtitle>
<segtitle>Installed directory</segtitle>
<seglistitem>
diff --git a/chapter08/iproute2.xml b/chapter08/iproute2.xml
index bfc25331a..cd3e5a658 100644
--- a/chapter08/iproute2.xml
+++ b/chapter08/iproute2.xml
@@ -45,9 +45,6 @@
be built since it depends on Berkeley DB, which is not installed in
LFS. However, a directory and a man page for <command>arpd</command> will still
be installed. Prevent this by running the commands shown below.
- (If the <command>arpd</command> program is needed,
- instructions for compiling Berkeley DB can be found in the BLFS book at
- <ulink url="&blfs-book;server/db.html"/>.)
</para>
<screen><userinput remap="pre">sed -i /ARPD/d Makefile
diff --git a/chapter08/libelf.xml b/chapter08/libelf.xml
index 23b66222a..a17818274 100644
--- a/chapter08/libelf.xml
+++ b/chapter08/libelf.xml
@@ -70,8 +70,8 @@ rm /usr/lib/libelf.a</userinput></screen>
<title>Contents of Libelf</title>
<segmentedlist>
- <segtitle>Installed Library</segtitle>
- <segtitle>Installed Directory</segtitle>
+ <segtitle>Installed library</segtitle>
+ <segtitle>Installed directory</segtitle>
<seglistitem>
<seg>
diff --git a/chapter08/man-db.xml b/chapter08/man-db.xml
index 88c811d33..229111131 100644
--- a/chapter08/man-db.xml
+++ b/chapter08/man-db.xml
@@ -113,11 +113,7 @@
<para>To test the results, issue:</para>
-<screen><userinput remap="test">make -k check</userinput></screen>
-
- <!-- https://gitlab.com/man-db/man-db/-/issues/25 -->
- <para>One test named <filename>man1/lexgrog.1</filename> is known
- to fail.</para>
+<screen><userinput remap="test">make check</userinput></screen>
<para>Install the package:</para>
diff --git a/chapter08/mpc.xml b/chapter08/mpc.xml
index ad46b7e43..941ee041c 100644
--- a/chapter08/mpc.xml
+++ b/chapter08/mpc.xml
@@ -69,8 +69,8 @@ make install-html</userinput></screen>
<title>Contents of MPC</title>
<segmentedlist>
- <segtitle>Installed Libraries</segtitle>
- <segtitle>Installed Directory</segtitle>
+ <segtitle>Installed libraries</segtitle>
+ <segtitle>Installed directory</segtitle>
<seglistitem>
<seg>libmpc.so</seg>
diff --git a/chapter08/mpfr.xml b/chapter08/mpfr.xml
index c9e7c1a7d..cba4a64aa 100644
--- a/chapter08/mpfr.xml
+++ b/chapter08/mpfr.xml
@@ -58,7 +58,7 @@ make html</userinput></screen>
Do not skip it under any circumstances.</para>
</important>
- <para>Test the results and ensure that all 197 tests passed:</para>
+ <para>Test the results and ensure that all 198 tests passed:</para>
<screen><userinput remap="test">make check</userinput></screen>
@@ -74,7 +74,7 @@ make install-html</userinput></screen>
<title>Contents of MPFR</title>
<segmentedlist>
- <segtitle>Installed Libraries</segtitle>
+ <segtitle>Installed libraries</segtitle>
<segtitle>Installed directory</segtitle>
<seglistitem>
diff --git a/chapter08/openssl.xml b/chapter08/openssl.xml
index 6a4441552..25295f056 100644
--- a/chapter08/openssl.xml
+++ b/chapter08/openssl.xml
@@ -63,7 +63,7 @@
<para>To test the results, issue:</para>
-<screen><userinput remap="test">make test</userinput></screen>
+<screen><userinput remap="test">HARNESS_JOBS=<replaceable>$(nproc)</replaceable> make test</userinput></screen>
<para>One test, 30-test_afalg.t, is known to fail if the host kernel
does not have <option>CONFIG_CRYPTO_USER_API_SKCIPHER</option> enabled,
diff --git a/chapter08/perl.xml b/chapter08/perl.xml
index b56e0e5e2..2bb849645 100644
--- a/chapter08/perl.xml
+++ b/chapter08/perl.xml
@@ -76,15 +76,7 @@ export BUILD_BZIP2=0</userinput></screen>
-Dusethreads</userinput></screen>
<variablelist>
- <title>The meaning of the configure options:</title>
-
- <varlistentry>
- <term><parameter>-Dvendorprefix=/usr</parameter></term>
- <listitem>
- <para>This ensures <command>perl</command> knows how to
- tell packages where they should install their Perl modules.</para>
- </listitem>
- </varlistentry>
+ <title>The meaning of the new Configure options:</title>
<varlistentry>
<term><parameter>-Dpager="/usr/bin/less -isR"</parameter></term>
@@ -105,31 +97,12 @@ export BUILD_BZIP2=0</userinput></screen>
</varlistentry>
<varlistentry>
- <term><parameter>-Duseshrplib</parameter></term>
- <listitem>
- <para>Build a shared libperl needed by some Perl modules.</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
<term><parameter>-Dusethreads</parameter></term>
<listitem>
<para>Build Perl with support for threads.</para>
</listitem>
</varlistentry>
- <varlistentry>
- <term><parameter>-Dprivlib,-Darchlib,-Dsitelib,...</parameter></term>
- <listitem>
- <para>These settings define where Perl looks for installed
- modules. The LFS editors chose to put them in a directory structure
- based on the MAJOR.MINOR version of Perl (&perl-version-min;) which
- allows upgrading Perl to newer patch levels (the patch level is
- the last dot separated part in the full version string like
- &perl-version;) without reinstalling all of the modules.</para>
- </listitem>
- </varlistentry>
-
</variablelist>
<para>Compile the package:</para>
@@ -138,7 +111,7 @@ export BUILD_BZIP2=0</userinput></screen>
<para>To test the results (approximately 11 SBU), issue:</para>
-<screen><userinput remap="test">make test</userinput></screen>
+<screen><userinput remap="test">TEST_JOBS=$(nproc) make test_harness</userinput></screen>
<para>Install the package and clean up:</para>
diff --git a/chapter08/pkgconf.xml b/chapter08/pkgconf.xml
index fd61b4d40..b95d7ab2c 100644
--- a/chapter08/pkgconf.xml
+++ b/chapter08/pkgconf.xml
@@ -43,15 +43,12 @@
<sect2 role="installation">
<title>Installation of Pkgconf</title>
-<!--
- <para>Pkgconf-2.0.0 explicitly errors when attempting to run
- <option>- -modversion</option> with multiple arguments, even if these
- arguments are constraints for the same package. This breaks many
- packages in BLFS. Run this sed to reinstate the old
- output for pkgconf:</para>
-
- <screen><userinput remap="pre">sed -i '1330,1336s|^|//|' cli/main.c</userinput></screen>
--->
+
+ <!-- https://github.com/pkgconf/pkgconf/issues/317 -->
+ <para>Fix a regression in pkgconf-2.0.3 breaking BLFS packages:</para>
+
+ <screen><userinput remap="pre">sed -i 's/str\(cmp.*package\)/strn\1, strlen(pkg-&gt;why)/' cli/main.c</userinput></screen>
+
<para>Prepare Pkgconf for compilation:</para>
<screen><userinput remap="configure">./configure --prefix=/usr \
diff --git a/chapter08/pkgmgt.xml b/chapter08/pkgmgt.xml
index 7104d9cba..185538796 100644
--- a/chapter08/pkgmgt.xml
+++ b/chapter08/pkgmgt.xml
@@ -69,6 +69,17 @@
it. </para>
</listitem>
+ <listitem>
+ <para>Reinstalling the same version of Glibc (&glibc-version; for
+ this release of LFS) with patches should be safe when these patches
+ do not change ABI and API. When a security vulnerability is found
+ in Glibc, we often need to apply such a patch to fix the
+ vulnerability and reinstall Glibc. Consult
+ <ulink url='&lfs-root;lfs/advisories/'>LFS security
+ advisories</ulink> if you are alerted for a published Glibc security
+ vulnerability but unsure about the action to take.</para>
+ </listitem>
+
<listitem> <para>If a package containing a shared library is updated, and
if the name of the library changes, then any packages dynamically
linked to the library must be recompiled, to link against the
@@ -152,7 +163,7 @@
provided by <application>coreutils</application> has already
implemented this, and most packages use that command to install binary files and
libraries. This means that you won't be troubled by this issue most of the time.
- However, the install process of some packages (notably Mozilla JS
+ However, the install process of some packages (notably SpiderMonkey
in BLFS) just overwrites the file if it exists; this causes a crash. So
it's safer to save your work and close unneeded running processes
before updating a package.</para> <!-- binary is an adjective, not a noun. -->
@@ -185,19 +196,29 @@
<para>This is a simplistic package management technique that does not need a
special program to manage the packages. Each package is installed in a
separate directory. For example, package foo-1.1 is installed in
- <filename class='directory'>/usr/pkg/foo-1.1</filename>
- and a symlink is made from <filename>/usr/pkg/foo</filename> to
- <filename class='directory'>/usr/pkg/foo-1.1</filename>. When
+ <filename class='directory'>/opt/foo-1.1</filename>
+ and a symlink is made from <filename>/opt/foo</filename> to
+ <filename class='directory'>/opt/foo-1.1</filename>. When
a new version foo-1.2 comes along, it is installed in
- <filename class='directory'>/usr/pkg/foo-1.2</filename> and the previous
+ <filename class='directory'>/opt/foo-1.2</filename> and the previous
symlink is replaced by a symlink to the new version.</para>
<para>Environment variables such as <envar>PATH</envar>,
- <envar>LD_LIBRARY_PATH</envar>, <envar>MANPATH</envar>,
- <envar>INFOPATH</envar> and <envar>CPPFLAGS</envar> need to be expanded to
- include <filename>/usr/pkg/foo</filename>. If you install more than a few packages,
- this scheme becomes unmanageable.</para>
+ <envar>MANPATH</envar>, <envar>INFOPATH</envar>,
+ <envar>PKG_CONFIG_PATH</envar>, <envar>CPPFLAGS</envar>,
+ <envar>LDFLAGS</envar>, and the configuration file
+ <filename>/etc/ld.so.conf</filename> may need to be expanded to
+ include the corresponding subdirectories in
+ <filename class='directory'>/opt/foo-x.y</filename>.</para>
+ <para>
+ This scheme is used by the BLFS book to install some very large
+ packages to make it easier to upgrade them. If you install more
+ than a few packages, this scheme becomes unmanageable. And some
+ packages (for example Linux API headers and Glibc) may not work well
+ with this scheme.
+ <emphasis role='bold'>Never use this scheme system-wide.</emphasis>
+ </para>
</sect3>
<sect3>
diff --git a/chapter08/python.xml b/chapter08/python.xml
index 1ac1b538a..62279880d 100644
--- a/chapter08/python.xml
+++ b/chapter08/python.xml
@@ -48,7 +48,6 @@
<screen><userinput remap="configure">./configure --prefix=/usr \
--enable-shared \
--with-system-expat \
- --with-system-ffi \
--enable-optimizations</userinput></screen>
<variablelist>
@@ -63,14 +62,6 @@
</varlistentry>
<varlistentry>
- <term><parameter>--with-system-ffi</parameter></term>
- <listitem>
- <para>This switch enables linking against the system version of
- <filename class='libraryfile'>libffi.so</filename>.</para>
- </listitem>
- </varlistentry>
-
- <varlistentry>
<term><parameter>--enable-optimizations</parameter></term>
<listitem>
<para>This switch enables extensive, but time-consuming, optimization
@@ -164,21 +155,21 @@ EOF
<screen><userinput remap="install">install -v -dm755 /usr/share/doc/python-&python-version;/html
-tar --strip-components=1 \
- --no-same-owner \
- --no-same-permissions \
- -C /usr/share/doc/python-&python-version;/html \
- -xvf ../python-&python-version;-docs-html.tar.bz2</userinput></screen>
+tar --no-same-owner \
+ -xvf ../python-&python-version;-docs-html.tar.bz2
+cp -R --no-preserve=mode python-&python-version;-docs-html/* \
+ /usr/share/doc/python-&python-version;/html</userinput></screen>
<variablelist>
<title>The meaning of the documentation install commands:</title>
<varlistentry>
- <term><option>--no-same-owner</option> and <option>--no-same-permissions</option></term>
+ <term><option>--no-same-owner</option> (tar) and <option>--no-preserve=mode</option> (cp)</term>
<listitem>
<para>Ensure the installed files have the correct ownership and
permissions. Without these options, <application>tar</application>
- will install the package files with the upstream creator's values.
+ will install the package files with the upstream creator's values
+ and files would have restrictive permissions.
</para>
</listitem>
</varlistentry>
@@ -191,9 +182,9 @@ tar --strip-components=1 \
<title>Contents of Python 3</title>
<segmentedlist>
- <segtitle>Installed Programs</segtitle>
- <segtitle>Installed Library</segtitle>
- <segtitle>Installed Directories</segtitle>
+ <segtitle>Installed programs</segtitle>
+ <segtitle>Installed library</segtitle>
+ <segtitle>Installed directories</segtitle>
<seglistitem>
<seg>
diff --git a/chapter08/setuptools.xml b/chapter08/setuptools.xml
new file mode 100644
index 000000000..257a50328
--- /dev/null
+++ b/chapter08/setuptools.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+ <!ENTITY % general-entities SYSTEM "../general.ent">
+ %general-entities;
+]>
+
+<sect1 id="ch-system-setuptools" role="wrap">
+ <?dbhtml filename="setuptools.html"?>
+
+ <sect1info condition="script">
+ <productname>setuptools</productname>
+ <productnumber>&setuptools-version;</productnumber>
+ <address>&setuptools-url;</address>
+ </sect1info>
+
+ <title>Setuptools-&setuptools-version;</title>
+
+ <indexterm zone="ch-system-setuptools">
+ <primary sortas="a-setuptools">Setuptools</primary>
+ </indexterm>
+
+ <sect2 role="package">
+ <title/>
+
+ <para>Setuptools is a tool used to download, build, install, upgrade,
+ and uninstall Python packages.</para>
+
+ <segmentedlist>
+ <segtitle>&buildtime;</segtitle>
+ <segtitle>&diskspace;</segtitle>
+ <seglistitem>
+ <seg>&setuptools-fin-sbu;</seg>
+ <seg>&setuptools-fin-du;</seg>
+ </seglistitem>
+ </segmentedlist>
+
+ </sect2>
+
+ <sect2 role="installation">
+ <title>Installation of Setuptools</title>
+
+ <para>Build the package:</para>
+
+<screen><userinput remap="install">pip3 wheel -w dist --no-cache-dir --no-build-isolation --no-deps $PWD</userinput></screen>
+
+ <para>Install the package:</para>
+
+<screen><userinput remap="install">pip3 install --no-index --find-links dist setuptools</userinput></screen>
+ </sect2>
+
+ <sect2 id="contents-setuptools" role="content">
+ <title>Contents of Setuptools</title>
+
+ <segmentedlist>
+ <segtitle>Installed directory</segtitle>
+
+ <seglistitem>
+ <seg>
+ /usr/lib/python&python-minor;/site-packages/_distutils_hack,
+ /usr/lib/python&python-minor;/site-packages/pkg_resources,
+ /usr/lib/python&python-minor;/site-packages/setuptools, and
+ /usr/lib/python&python-minor;/site-packages/setuptools-&setuptools-version;.dist-info
+ </seg>
+ </seglistitem>
+ </segmentedlist>
+
+ </sect2>
+
+</sect1>
+
diff --git a/chapter08/shadow.xml b/chapter08/shadow.xml
index f88216a5b..315234c7f 100644
--- a/chapter08/shadow.xml
+++ b/chapter08/shadow.xml
@@ -276,7 +276,7 @@ useradd -D --gid 999</userinput></screen>
<seglistitem>
<seg>chage, chfn, chgpasswd, chpasswd, chsh, expiry, faillog,
getsubids, gpasswd, groupadd, groupdel, groupmems, groupmod, grpck,
- grpconv, grpunconv, lastlog, login, logoutd, newgidmap, newgrp,
+ grpconv, grpunconv, login, logoutd, newgidmap, newgrp,
newuidmap, newusers, nologin, passwd, pwck, pwconv, pwunconv,
sg (link to newgrp), su, useradd, userdel, usermod,
vigr (link to vipw), and vipw</seg>
@@ -459,17 +459,6 @@ useradd -D --gid 999</userinput></screen>
</listitem>
</varlistentry>
- <varlistentry id="lastlog">
- <term><command>lastlog</command></term>
- <listitem>
- <para>Reports the most recent login of all users or of a
- given user</para>
- <indexterm zone="ch-system-shadow lastlog">
- <primary sortas="b-lastlog">lastlog</primary>
- </indexterm>
- </listitem>
- </varlistentry>
-
<varlistentry id="login">
<term><command>login</command></term>
<listitem>
diff --git a/chapter08/stripping.xml b/chapter08/stripping.xml
index 92ecfe310..83f7545fd 100644
--- a/chapter08/stripping.xml
+++ b/chapter08/stripping.xml
@@ -29,9 +29,12 @@
needed by the linker (for static libraries) or dynamic linker (for
dynamically linked binaries and shared libraries).</para>
- <para>The debugging symbols from selected libraries are preserved
- in separate files. That debugging information is needed to run
- regression tests with <ulink
+ <!-- TODO: Zstd is better than Zlib for both speed and size.
+ Unfortunately Valgrind does not support Zstd-compressed debug
+ info yet: https://bugs.kde.org/show_bug.cgi?id=469782 -->
+ <para>The debugging symbols from selected libraries are compressed with
+ <application>Zlib</application> and preserved in separate files. That
+ debugging information is needed to run regression tests with <ulink
url='&blfs-book;/general/valgrind.html'>valgrind</ulink> or <ulink
url='&blfs-book;/general/gdb.html'>gdb</ulink> later, in BLFS.
</para>
@@ -79,7 +82,7 @@
cd /usr/lib
for LIB in $save_usrlib; do
- objcopy --only-keep-debug $LIB $LIB.dbg
+ objcopy --only-keep-debug --compress-debug-sections=zlib $LIB $LIB.dbg
cp $LIB /tmp/$LIB
strip --strip-unneeded /tmp/$LIB
objcopy --add-gnu-debuglink=$LIB.dbg /tmp/$LIB
diff --git a/chapter08/udev.xml b/chapter08/udev.xml
index 35bb12f46..dd686f489 100644
--- a/chapter08/udev.xml
+++ b/chapter08/udev.xml
@@ -55,6 +55,11 @@
<screen><userinput remap="pre">sed '/systemd-sysctl/s/^/#/' -i rules.d/99-systemd.rules.in</userinput></screen>
+ <para>Adjust the hardcoded paths to network configuration files for the
+ standalone udev installation:</para>
+
+ <screen><userinput remap="pre">sed '/NETWORK_DIRS/s/systemd/udev/' -i src/basic/path-lookup.h</userinput></screen>
+
<para>Prepare Udev for compilation:</para>
<screen><userinput remap="configure">mkdir -p build
@@ -66,6 +71,8 @@ meson setup \
-Dmode=release \
-Ddev-kvm-mode=0660 \
-Dlink-udev-shared=false \
+ -Dlogind=false \
+ -Dvconsole=false \
..</userinput></screen>
<variablelist>
@@ -107,35 +114,42 @@ meson setup \
and it's too overkill for a udev-only installation.</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><parameter>-Dlogind=false -Dvconsole=false</parameter></term>
+ <listitem>
+ <para>These options prevent the generation of several udev rule
+ files belonging to the other Systemd components that we won't
+ install.</para>
+ </listitem>
+ </varlistentry>
</variablelist>
<para>Only build the components needed for udev:</para>
- <screen><userinput remap="make">ninja udevadm systemd-hwdb \
- $(grep -o -E "^build (src/libudev|src/udev|rules.d|hwdb.d)[^:]*" \
- build.ninja | awk '{ print $2 }') \
+ <screen><userinput remap="make">ninja udevadm systemd-hwdb \
+ $(ninja -n | grep -Eo '(src/(lib)?udev|rules.d|hwdb.d)/[^ ]*') \
$(realpath libudev.so --relative-to .)</userinput></screen>
- <para>Remove one udev rule file requiring a full Systemd
- installation:</para>
-
-<screen><userinput remap="make">rm rules.d/90-vconsole.rules</userinput></screen>
-
<para>Install the package:</para>
- <screen><userinput remap="install">install -vm755 -d {/usr/lib,/etc}/udev/{hwdb,rules}.d
+ <screen><userinput remap="install">install -vm755 -d {/usr/lib,/etc}/udev/{hwdb.d,rules.d,network}
install -vm755 -d /usr/{lib,share}/pkgconfig
-install -vm755 udevadm /usr/bin/
-install -vm755 systemd-hwdb /usr/bin/udev-hwdb
-ln -svfn ../bin/udevadm /usr/sbin/udevd
-cp -av libudev.so{,*[0-9]} /usr/lib/
-install -vm644 ../src/libudev/libudev.h /usr/include/
-install -vm644 src/libudev/*.pc /usr/lib/pkgconfig/
-install -vm644 src/udev/*.pc /usr/share/pkgconfig/
-install -vm644 ../src/udev/udev.conf /etc/udev/
-install -vm644 rules.d/* ../rules.d/{*.rules,README} /usr/lib/udev/rules.d/
-install -vm644 hwdb.d/* ../hwdb.d/{*.hwdb,README} /usr/lib/udev/hwdb.d/
-install -vm755 $(find src/udev -type f | grep -F -v ".") /usr/lib/udev</userinput></screen>
+install -vm755 udevadm /usr/bin/
+install -vm755 systemd-hwdb /usr/bin/udev-hwdb
+ln -svfn ../bin/udevadm /usr/sbin/udevd
+cp -av libudev.so{,*[0-9]} /usr/lib/
+install -vm644 ../src/libudev/libudev.h /usr/include/
+install -vm644 src/libudev/*.pc /usr/lib/pkgconfig/
+install -vm644 src/udev/*.pc /usr/share/pkgconfig/
+install -vm644 ../src/udev/udev.conf /etc/udev/
+install -vm644 rules.d/* ../rules.d/README /usr/lib/udev/rules.d/
+install -vm644 $(find ../rules.d/*.rules \
+ -not -name '*power-switch*') /usr/lib/udev/rules.d/
+install -vm644 hwdb.d/* ../hwdb.d/{*.hwdb,README} /usr/lib/udev/hwdb.d/
+install -vm755 $(find src/udev \
+ -type f -not -name '*.*') /usr/lib/udev
+install -vm644 ../network/99-default.link /usr/lib/udev/network</userinput></screen>
<para>Install some custom rules and support files useful in an LFS
environment:</para>
@@ -150,13 +164,21 @@ make -f &udev-lfs-version;/Makefile.lfs install</userinput></screen>
<screen><userinput remap="install">tar -xf ../../systemd-man-pages-&systemd-man-version;.tar.xz \
--no-same-owner --strip-components=1 \
-C /usr/share/man --wildcards '*/udev*' '*/libudev*' \
+ '*/systemd.link.5' \
'*/systemd-'{hwdb,udevd.service}.8
+
+sed 's|systemd/network|udev/network|' \
+ /usr/share/man/man5/systemd.link.5 \
+ > /usr/share/man/man5/udev.link.5
+
sed 's/systemd\(\\\?-\)/udev\1/' /usr/share/man/man8/systemd-hwdb.8 \
> /usr/share/man/man8/udev-hwdb.8
+
sed 's|lib.*udevd|sbin/udevd|' \
/usr/share/man/man8/systemd-udevd.service.8 \
> /usr/share/man/man8/udevd.8
-rm /usr/share/man/man8/systemd-*.8</userinput></screen>
+
+rm /usr/share/man/man*/systemd*</userinput></screen>
</sect2>
diff --git a/chapter08/util-linux.xml b/chapter08/util-linux.xml
index 0ec5c1c8e..00f804842 100644
--- a/chapter08/util-linux.xml
+++ b/chapter08/util-linux.xml
@@ -42,7 +42,7 @@
<sect2 role="installation">
<title>Installation of Util-linux</title>
- <para>First, disable a problem test:</para>
+ <para>First, disable a problematic test:</para>
<screen><userinput remap="pre">sed -i '/test_mkfds/s/^/#/' tests/helpers/Makemodule.am</userinput></screen>