diff options
Diffstat (limited to 'chapter08')
-rw-r--r-- | chapter08/automake.xml | 9 | ||||
-rw-r--r-- | chapter08/chapter08.xml | 1 | ||||
-rw-r--r-- | chapter08/gawk.xml | 11 | ||||
-rw-r--r-- | chapter08/glibc.xml | 28 | ||||
-rw-r--r-- | chapter08/man-db.xml | 6 | ||||
-rw-r--r-- | chapter08/openssl.xml | 2 | ||||
-rw-r--r-- | chapter08/perl.xml | 2 | ||||
-rw-r--r-- | chapter08/pkgmgt.xml | 39 | ||||
-rw-r--r-- | chapter08/python.xml | 9 | ||||
-rw-r--r-- | chapter08/setuptools.xml | 71 | ||||
-rw-r--r-- | chapter08/shadow.xml | 13 | ||||
-rw-r--r-- | chapter08/udev.xml | 46 |
12 files changed, 159 insertions, 78 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)>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/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 179357c00..69936c879 100644 --- a/chapter08/glibc.xml +++ b/chapter08/glibc.xml @@ -74,6 +74,7 @@ cd build</userinput></screen> --enable-kernel=&linux-major-version;.&linux-minor-version; \ --enable-stack-protector=strong \ --with-headers=/usr/include \ + --disable-nscd \ libc_cv_slibdir=/usr/lib</userinput></screen> <variablelist> @@ -116,6 +117,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 @@ -207,7 +216,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> @@ -219,7 +228,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 @@ -499,7 +508,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-x86-64.so.2 or ld-linux.so.2), - locale, localedef, makedb, mtrace, nscd, + locale, localedef, makedb, mtrace, pcprofiledump, pldd, sln, sotruss, sprof, tzselect, xtrace, zdump, and zic</seg> <seg>ld-linux-x86-64.so.2, ld-linux.so.2, @@ -519,7 +528,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> @@ -653,17 +662,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/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/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 d3159595c..2bb849645 100644 --- a/chapter08/perl.xml +++ b/chapter08/perl.xml @@ -111,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/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 a4bfeaf91..f7bc19d47 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 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/udev.xml b/chapter08/udev.xml index 35bb12f46..46ab88cff 100644 --- a/chapter08/udev.xml +++ b/chapter08/udev.xml @@ -66,6 +66,8 @@ meson setup \ -Dmode=release \ -Ddev-kvm-mode=0660 \ -Dlink-udev-shared=false \ + -Dlogind=false \ + -Dvconsole=false \ ..</userinput></screen> <variablelist> @@ -107,35 +109,41 @@ 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 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</userinput></screen> <para>Install some custom rules and support files useful in an LFS environment:</para> |